diff --git a/src/main/java/com/minelittlepony/client/model/entity/VillagerPonyModel.java b/src/main/java/com/minelittlepony/client/model/entity/VillagerPonyModel.java index d34ee736..ddb47280 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/VillagerPonyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/VillagerPonyModel.java @@ -21,7 +21,6 @@ import com.minelittlepony.mson.api.ModelContext; public class VillagerPonyModel extends AlicornModel implements ModelWithHat { private final ModelPart apron; - private final ModelPart trinket; private IPart batWings; private IPart batEars; @@ -29,7 +28,6 @@ public class VillagerPonyModel e public VillagerPonyModel(ModelPart tree) { super(tree, false); apron = tree.getChild("apron"); - trinket = tree.getChild("trinket"); } @Override @@ -59,7 +57,6 @@ public class VillagerPonyModel e protected void shakeBody(float move, float swing, float bodySwing, float ticks) { super.shakeBody(move, swing, bodySwing, ticks); apron.yaw = bodySwing; - trinket.yaw = bodySwing; } @Override @@ -70,14 +67,12 @@ public class VillagerPonyModel e attributes.visualHeight += PonyTextures.isCrownPony(entity) ? 0.3F : -0.1F; apron.visible = !special && profession == VillagerProfession.BUTCHER; - trinket.visible = !special && !apron.visible && profession != VillagerProfession.NONE && profession != VillagerProfession.NITWIT; } @Override protected void renderBody(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) { super.renderBody(stack, vertices, overlayUv, lightUv, red, green, blue, alpha); apron.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha); - //trinket.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha); } @Override diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java index b2ccf494..1c4538fc 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java @@ -88,7 +88,7 @@ class NpcClothingFeature< Identifier key = new Identifier("minelittlepony", (typeId + "/" + profId + "/" + level).replace(':', '_')); if (MinecraftClient.getInstance().getTextureManager().getOrDefault(key, null) == null) { - TextureFlattener.flatten(computeTextures(type, profession, typeId, profId, level), (Identifier)key); + TextureFlattener.flatten(computeTextures(type, profession, typeId, profId, level), key); } return key; diff --git a/src/main/java/com/minelittlepony/client/util/render/TextureFlattener.java b/src/main/java/com/minelittlepony/client/util/render/TextureFlattener.java index e68ecbea..d1a2e4c1 100644 --- a/src/main/java/com/minelittlepony/client/util/render/TextureFlattener.java +++ b/src/main/java/com/minelittlepony/client/util/render/TextureFlattener.java @@ -19,14 +19,11 @@ public class TextureFlattener { MinecraftClient.getInstance().getTextureManager().registerTexture(output, new ResourceTexture(output) { @Override public void load(ResourceManager resManager) throws IOException { - NativeImage image = null; - for (int i = 0; i < textures.size(); i++) { - TextureData data = TextureData.load(resManager, textures.get(0)); - data.checkException(); - if (image == null) { - image = data.getImage(); - } else { + NativeImage image = TextureData.load(resManager, textures.get(0)).getImage(); + + for (int i = 1; i < textures.size(); i++) { + try (TextureData data = TextureData.load(resManager, textures.get(i))) { copyOver(data.getImage(), image); } } @@ -54,9 +51,9 @@ public class TextureFlattener { } public static void copyOver(NativeImage from, NativeImage to, int x, int y, int w, int h) { - for (; x < w; x++) { - for (; y < h; y++) { - copy(from, to, x, y); + for (int xx = x; xx < w; xx++) { + for (int yy = y; yy < h; yy++) { + copy(from, to, xx, yy); } } }