mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
When putting a bangle on an armour stand make sure the armour stand has an arm to hold it
This commit is contained in:
parent
8f68b6414f
commit
442b361f6d
1 changed files with 11 additions and 1 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.client.render.item.ItemRenderer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.decoration.ArmorStandEntity;
|
||||||
import net.minecraft.item.DyeableItem;
|
import net.minecraft.item.DyeableItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
|
@ -42,7 +43,7 @@ public class BraceletFeatureRenderer<
|
||||||
ItemStack item = entity.getEquippedStack(EquipmentSlot.CHEST);
|
ItemStack item = entity.getEquippedStack(EquipmentSlot.CHEST);
|
||||||
|
|
||||||
if (item.getItem() instanceof FriendshipBraceletItem) {
|
if (item.getItem() instanceof FriendshipBraceletItem) {
|
||||||
VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getArmorCutoutNoCull(TEXTURE), false, false);
|
|
||||||
|
|
||||||
int j = ((DyeableItem)item.getItem()).getColor(item);
|
int j = ((DyeableItem)item.getItem()).getColor(item);
|
||||||
|
|
||||||
|
@ -50,6 +51,15 @@ public class BraceletFeatureRenderer<
|
||||||
|
|
||||||
BraceletModel model = alex ? alexModel : steveModel;
|
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.setAngles(getContextModel());
|
||||||
model.setVisible(entity.getMainArm());
|
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);
|
model.render(stack, consumer, ((GlowableItem)item.getItem()).isGlowing(item) ? 0x0F00F0 : lightUv, OverlayTexture.DEFAULT_UV, Color.r(j), Color.g(j), Color.b(j), 1);
|
||||||
|
|
Loading…
Reference in a new issue