| 1 | package net.minecraft.client.renderer.entity.layers;
|
| 2 |
|
| 3 | import net.minecraft.client.Minecraft;
|
| 4 | import net.minecraft.client.model.ModelQuadruped;
|
| 5 | import net.minecraft.client.renderer.BlockRendererDispatcher;
|
| 6 | import net.minecraft.client.renderer.GlStateManager;
|
| 7 | import net.minecraft.client.renderer.entity.RenderMooshroom;
|
| 8 | import net.minecraft.client.renderer.texture.TextureMap;
|
| 9 | import net.minecraft.entity.passive.EntityMooshroom;
|
| 10 | import net.minecraft.init.Blocks;
|
| 11 |
|
| 12 | public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom>
|
| 13 | {
|
| 14 | private final RenderMooshroom mooshroomRenderer;
|
| 15 |
|
| 16 | public LayerMooshroomMushroom(RenderMooshroom mooshroomRendererIn)
|
| 17 | {
|
| 18 | this.mooshroomRenderer = mooshroomRendererIn;
|
| 19 | }
|
| 20 |
|
| 21 | public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
|
| 22 | {
|
| 23 | if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
|
| 24 | {
|
| 25 | BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
| 26 | this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
|
| 27 | GlStateManager.enableCull();
|
| 28 | GlStateManager.cullFace(1028);
|
| 29 | GlStateManager.pushMatrix();
|
| 30 | GlStateManager.scale(1.0F, -1.0F, 1.0F);
|
| 31 | GlStateManager.translate(0.2F, 0.35F, 0.5F);
|
| 32 | GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
|
| 33 | GlStateManager.pushMatrix();
|
| 34 | GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
| 35 | blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
|
| 36 | GlStateManager.popMatrix();
|
| 37 | GlStateManager.pushMatrix();
|
| 38 | GlStateManager.translate(0.1F, 0.0F, -0.6F);
|
| 39 | GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
|
| 40 | GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
| 41 | blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
|
| 42 | GlStateManager.popMatrix();
|
| 43 | GlStateManager.popMatrix();
|
| 44 | GlStateManager.pushMatrix();
|
| 45 | ((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
|
| 46 | GlStateManager.scale(1.0F, -1.0F, 1.0F);
|
| 47 | GlStateManager.translate(0.0F, 0.7F, -0.2F);
|
| 48 | GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
|
| 49 | GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
| 50 | blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
|
| 51 | GlStateManager.popMatrix();
|
| 52 | GlStateManager.cullFace(1029);
|
| 53 | GlStateManager.disableCull();
|
| 54 | }
|
| 55 | }
|
| 56 |
|
| 57 | public boolean shouldCombineTextures()
|
| 58 | {
|
| 59 | return true;
|
| 60 | }
|
| 61 | }
|
| 62 |
|