This commit is contained in:
modmuss50 2019-03-20 18:52:51 +00:00
parent fa4b8dfc92
commit f7617b19c1
6 changed files with 18 additions and 17 deletions

View file

@ -26,8 +26,8 @@ targetCompatibility = 1.8
archivesBaseName = "fabric"
def baseVersion = "0.2.3"
def mcVersion = "19w11b"
def baseVersion = "0.2.4"
def mcVersion = "19w12a"
def ENV = System.getenv()
version = baseVersion + "." + (ENV.BUILD_NUMBER ?: "local")
@ -38,7 +38,7 @@ minecraft {
dependencies {
minecraft "com.mojang:minecraft:$mcVersion"
mappings "net.fabricmc:yarn:$mcVersion.3"
mappings "net.fabricmc:yarn:$mcVersion.1"
modCompile "net.fabricmc:fabric-loader:0.3.7.109"
}

View file

@ -106,6 +106,6 @@ public final class PlayerStream {
public static Stream<PlayerEntity> around(World world, BlockPos pos, double radius) {
double radiusSq = radius * radius;
return world(world).filter((p) -> p.squaredDistanceToCenter(pos) <= radiusSq);
return world(world).filter((p) -> p.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) <= radiusSq);
}
}

View file

@ -16,9 +16,9 @@
package net.fabricmc.fabric.impl.client.texture;
import net.minecraft.class_1050;
import net.minecraft.client.resource.metadata.AnimationResourceMetadata;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.PngFile;
import net.minecraft.util.Identifier;
public class FabricSprite extends Sprite {
@ -26,7 +26,7 @@ public class FabricSprite extends Sprite {
super(var1, var2, var3);
}
public FabricSprite(Identifier identifier, class_1050 class_1050, AnimationResourceMetadata animationResourceMetadata) {
super(identifier, class_1050, animationResourceMetadata);
public FabricSprite(Identifier identifier, PngFile pngFile, AnimationResourceMetadata animationResourceMetadata) {
super(identifier, pngFile, animationResourceMetadata);
}
}

View file

@ -17,9 +17,9 @@
package net.fabricmc.fabric.impl.itemgroup;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.class_4185;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
@ -39,7 +39,7 @@ public class FabricCreativeGuiComponents {
COMMON_GROUPS.add(ItemGroup.HOTBAR);
}
public static class ItemGroupButtonWidget extends class_4185 {
public static class ItemGroupButtonWidget extends ButtonWidget {
CreativeGuiExtensions extensions;
CreativePlayerInventoryScreen gui;
@ -53,7 +53,7 @@ public class FabricCreativeGuiComponents {
}
@Override
public void method_1826() {
public void onPressed() {
type.clickConsumer.accept(extensions);
}
@ -67,9 +67,9 @@ public class FabricCreativeGuiComponents {
minecraftClient.getTextureManager().bindTexture(BUTTON_TEX);
GlStateManager.disableLighting();
GlStateManager.color4f(1F, 1F, 1F, 1F);
this.drawTexturedRect(this.x, this.y, (type == Type.NEXT ? 12 : 0), (enabled ? 0 : 12), 12, 12);
this.drawTexturedRect(this.field_2069, this.field_2068, (type == Type.NEXT ? 12 : 0), (enabled ? 0 : 12), 12, 12);
if(mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height){
if(mouseX >= this.field_2069 && mouseY >= this.field_2068 && mouseX < this.field_2069 + this.width && mouseY < this.field_2068 + this.height){
gui.drawTooltip(I18n.translate("fabric.gui.creativeTabPage", extensions.fabric_currentPage() + 1, ((ItemGroup.GROUPS.length - 12) / 9) + 2), mouseX, mouseY);
}
}

View file

@ -60,7 +60,7 @@ public final class RegistrySyncManager {
context.getTaskQueue().executeFuture(() -> {
if (compound == null) {
errorHandler.accept(new RemapException("Received null compound tag in sync packet!"));
return;
return null;
}
try {
@ -68,6 +68,7 @@ public final class RegistrySyncManager {
} catch (RemapException e) {
errorHandler.accept(e);
}
return null;
}).get(30, TimeUnit.SECONDS);
} catch (ExecutionException | InterruptedException | TimeoutException e) {
errorHandler.accept(e);

View file

@ -20,10 +20,10 @@ import com.google.common.base.Joiner;
import net.fabricmc.fabric.api.client.texture.*;
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
import net.fabricmc.fabric.impl.client.texture.FabricSprite;
import net.minecraft.class_1050;
import net.minecraft.client.resource.metadata.AnimationResourceMetadata;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.PngFile;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.crash.CrashException;
@ -60,15 +60,15 @@ public abstract class MixinSpriteAtlasTexture {
*/
@SuppressWarnings("JavaDoc")
@Redirect(method = "method_18160", at = @At(value = "NEW", target = "net/minecraft/client/texture/Sprite"))
public Sprite newSprite(Identifier id, class_1050 c, AnimationResourceMetadata animationMetadata) {
public Sprite newSprite(Identifier id, PngFile pngFile, AnimationResourceMetadata animationMetadata) {
if (fabric_injectedSprites.containsKey(id)) {
return fabric_injectedSprites.get(id);
} else {
return new FabricSprite(id, c, animationMetadata);
return new FabricSprite(id, pngFile, animationMetadata);
}
}
@ModifyVariable(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/SpriteAtlasTexture;method_18164(Lnet/minecraft/resource/ResourceManager;Ljava/util/Set;)Ljava/util/Collection;"), method = "stitch")
@ModifyVariable(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/SpriteAtlasTexture;loadSprites(Lnet/minecraft/resource/ResourceManager;Ljava/util/Set;)Ljava/util/Collection;"), method = "stitch")
public Set<Identifier> setHook(Set<Identifier> set) {
fabric_injectedSprites = new HashMap<>();
ClientSpriteRegistryCallback.Registry registry = new ClientSpriteRegistryCallback.Registry(fabric_injectedSprites, set::add);