From 9fc4c384cbf5a53e03ca4b65020b76e989ad656e Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 4 Jan 2022 17:58:09 +0200 Subject: [PATCH] Fixed bracelets being offset slightly --- .../client/minelittlepony/BangleGear.java | 9 ++------- .../client/render/BraceletFeatureRenderer.java | 16 +++++----------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BangleGear.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BangleGear.java index 51e92cc7..6d4b16b9 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BangleGear.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BangleGear.java @@ -35,8 +35,8 @@ class BangleGear implements IGear { public BangleGear() { Dilation dilation = new Dilation(0.3F); - steveModel = new BraceletModel(BraceletModel.getData(dilation, false, -1, 4, 0).createModel(), false); - alexModel = new BraceletModel(BraceletModel.getData(dilation, true, -1, 4, 0).createModel(), true); + steveModel = new BraceletModel(BraceletModel.getData(dilation, false, -1, 4, 0).createModel()); + alexModel = new BraceletModel(BraceletModel.getData(dilation, true, -1, 4, 0).createModel()); } @Override @@ -57,11 +57,6 @@ class BangleGear implements IGear { @Override public void setModelAttributes(IModel model, Entity entity) { - - Dilation dilation = new Dilation(0.3F); - steveModel = new BraceletModel(BraceletModel.getData(dilation, false, -1, 4, 0).createModel(), false); - alexModel = new BraceletModel(BraceletModel.getData(dilation, true, -1, 4, 0).createModel(), true); - ItemStack item = ((LivingEntity)entity).getEquippedStack(EquipmentSlot.CHEST); color = ((DyeableItem)item.getItem()).getColor(item); diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java index 2443a23a..c3a9d3b9 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java @@ -43,8 +43,8 @@ public class BraceletFeatureRenderer implements Accessor public BraceletFeatureRenderer(FeatureRendererContext> context) { this.context = context; Dilation dilation = new Dilation(0.3F); - steveModel = new BraceletModel(BraceletModel.getData(dilation, false, 0, 0, 0).createModel(), false); - alexModel = new BraceletModel(BraceletModel.getData(dilation, true, 0, 0, 0).createModel(), true); + steveModel = new BraceletModel(BraceletModel.getData(dilation, false, 0, 0, 0).createModel()); + alexModel = new BraceletModel(BraceletModel.getData(dilation, true, 0, 0, 0).createModel()); } @Override @@ -90,7 +90,7 @@ public class BraceletFeatureRenderer implements Accessor boolean glowing = ((GlowableItem)item.getItem()).isGlowing(item); - if (!MineLPConnector.getPlayerPonyRace().isDefault()) { + if (!MineLPConnector.getPlayerPonyRace((ClientPlayerEntity)entity).isDefault()) { stack.translate(side == Arm.LEFT ? 0.06 : -0.06, 0.3, 0); } else { stack.translate(0, -0.1, 0); @@ -109,11 +109,8 @@ public class BraceletFeatureRenderer implements Accessor private final ModelPart leftArm; private final ModelPart rightArm; - private final boolean alex; - - public BraceletModel(ModelPart tree, boolean alex) { + public BraceletModel(ModelPart tree) { super(RenderLayer::getEntityTranslucent); - this.alex = alex; this.leftArm = tree.getChild(EntityModelPartNames.LEFT_ARM); this.rightArm = tree.getChild(EntityModelPartNames.RIGHT_ARM); } @@ -122,7 +119,7 @@ public class BraceletFeatureRenderer implements Accessor ModelData data = new ModelData(); ModelPartData root = data.getRoot(); - root.addChild(EntityModelPartNames.RIGHT_ARM, ModelPartBuilder.create().uv(0, alex ? 6 : 0).cuboid(-3 + x, 7 + y, -2 + z, alex ? 3 : 4, 2, 4, dilation), ModelTransform.NONE); + root.addChild(EntityModelPartNames.RIGHT_ARM, ModelPartBuilder.create().uv(0, alex ? 6 : 0).cuboid(-2 + x, 7 + y, -2 + z, alex ? 3 : 4, 2, 4, dilation), ModelTransform.NONE); root.addChild(EntityModelPartNames.LEFT_ARM, ModelPartBuilder.create().mirrored().uv(0, alex ? 6 : 0).cuboid(-1 - x, 7 + y, -2 + z, alex ? 3 : 4, 2, 4, dilation), ModelTransform.NONE); return TexturedModelData.of(data, 64, 32); @@ -131,9 +128,6 @@ public class BraceletFeatureRenderer implements Accessor public void setAngles(BipedEntityModel biped) { leftArm.copyTransform(biped.leftArm); rightArm.copyTransform(biped.rightArm); - if (alex) { - rightArm.pivotX++; - } } public void setVisible(Arm arm) {