From 442b361f6df9ebb7d2a16c86b1df66bbffaedbb6 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 7 Feb 2021 18:00:26 +0200 Subject: [PATCH] When putting a bangle on an armour stand make sure the armour stand has an arm to hold it --- .../client/render/BraceletFeatureRenderer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 5c8a1194..b2a193fd 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java @@ -18,6 +18,7 @@ import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.decoration.ArmorStandEntity; import net.minecraft.item.DyeableItem; import net.minecraft.item.ItemStack; import net.minecraft.util.Arm; @@ -42,7 +43,7 @@ public class BraceletFeatureRenderer< ItemStack item = entity.getEquippedStack(EquipmentSlot.CHEST); if (item.getItem() instanceof FriendshipBraceletItem) { - VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getArmorCutoutNoCull(TEXTURE), false, false); + int j = ((DyeableItem)item.getItem()).getColor(item); @@ -50,6 +51,15 @@ public class BraceletFeatureRenderer< BraceletModel model = alex ? alexModel : steveModel; + + if (entity instanceof ArmorStandEntity) { + ModelPart arm = entity.getMainArm() == Arm.LEFT ? getContextModel().leftArm : getContextModel().rightArm; + arm.visible = true; + VertexConsumer consumer = renderContext.getBuffer(getContextModel().getLayer(getTexture(entity))); + arm.render(stack, consumer, lightUv, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); + } + + VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getArmorCutoutNoCull(TEXTURE), false, false); model.setAngles(getContextModel()); model.setVisible(entity.getMainArm()); model.render(stack, consumer, ((GlowableItem)item.getItem()).isGlowing(item) ? 0x0F00F0 : lightUv, OverlayTexture.DEFAULT_UV, Color.r(j), Color.g(j), Color.b(j), 1);