|
43 | 43 | import net.minecraft.client.renderer.texture.OverlayTexture;
|
44 | 44 | import net.minecraft.resources.ResourceLocation;
|
45 | 45 | import net.minecraft.world.entity.Entity;
|
| 46 | +import net.minecraft.world.entity.monster.Zombie; |
46 | 47 | import org.jetbrains.annotations.Nullable;
|
47 | 48 |
|
48 | 49 | public class SpaceGearRenderLayer<T extends Entity, M extends EntityModel<T>> extends RenderLayer<T, M> {
|
@@ -101,10 +102,18 @@ public SpaceGearRenderLayer(RenderLayerParent<T, M> context) {
|
101 | 102 | @Override
|
102 | 103 | public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
103 | 104 | VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.entityCutoutNoCull(this.getTextureLocation(entity), true));
|
104 |
| - if (mask != null) { |
105 |
| - mask.yRot = headYaw * (float) (Math.PI / 180.0); |
106 |
| - mask.xRot = headPitch * (float) (Math.PI / 180.0); |
107 |
| - mask.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY); |
| 105 | + if ((Entity)entity instanceof Zombie) { |
| 106 | + Zombie zombie = (Zombie) entity; |
| 107 | + if (zombie.isBaby()) { |
| 108 | + matrices.scale(0.75F, 0.75F, 0.75F); |
| 109 | + matrices.translate(0.0F, 1.0F, 0.0F); |
| 110 | + } |
| 111 | + } |
| 112 | + |
| 113 | + if (this.mask != null) { |
| 114 | + this.mask.yRot = headYaw * (float) (Math.PI / 180.0); |
| 115 | + this.mask.xRot = headPitch * (float) (Math.PI / 180.0); |
| 116 | + this.mask.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY); |
108 | 117 | }
|
109 | 118 |
|
110 | 119 | if (this.tank != null) {
|
|
0 commit comments