2025-03-11 00:23:54 +01:00
|
|
|
package game.renderer.layers;
|
|
|
|
|
2025-03-18 10:24:05 +01:00
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2025-03-11 00:23:54 +01:00
|
|
|
import game.Game;
|
|
|
|
import game.entity.animal.EntityMooshroom;
|
|
|
|
import game.init.Blocks;
|
|
|
|
import game.renderer.BlockRenderer;
|
|
|
|
import game.renderer.GlState;
|
|
|
|
import game.renderer.entity.RenderMooshroom;
|
|
|
|
import game.renderer.model.ModelQuadruped;
|
|
|
|
import game.renderer.texture.TextureMap;
|
|
|
|
|
|
|
|
public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom>
|
|
|
|
{
|
|
|
|
private final RenderMooshroom mooshroomRenderer;
|
|
|
|
|
|
|
|
public LayerMooshroomMushroom(RenderMooshroom mooshroomRendererIn)
|
|
|
|
{
|
|
|
|
this.mooshroomRenderer = mooshroomRendererIn;
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
if (!entitylivingbaseIn.isChild()) // && !entitylivingbaseIn.isInvisible())
|
|
|
|
{
|
|
|
|
BlockRenderer blockrendererdispatcher = Game.getGame().getBlockRendererDispatcher();
|
|
|
|
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
|
|
|
|
GlState.enableCull();
|
2025-03-19 23:31:33 +01:00
|
|
|
GlState.cullFace(GL11.GL_FRONT);
|
2025-03-18 10:24:05 +01:00
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glScalef(1.0F, -1.0F, 1.0F);
|
|
|
|
GL11.glTranslatef(0.2F, 0.35F, 0.5F);
|
|
|
|
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
|
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
|
2025-03-11 00:23:54 +01:00
|
|
|
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getState(), 1.0F);
|
2025-03-18 10:24:05 +01:00
|
|
|
GL11.glPopMatrix();
|
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
|
|
|
|
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
|
2025-03-11 00:23:54 +01:00
|
|
|
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getState(), 1.0F);
|
2025-03-18 10:24:05 +01:00
|
|
|
GL11.glPopMatrix();
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
GL11.glPushMatrix();
|
2025-03-11 00:23:54 +01:00
|
|
|
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
|
2025-03-18 10:24:05 +01:00
|
|
|
GL11.glScalef(1.0F, -1.0F, 1.0F);
|
|
|
|
GL11.glTranslatef(0.0F, 0.7F, -0.2F);
|
|
|
|
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
|
2025-03-11 00:23:54 +01:00
|
|
|
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getState(), 1.0F);
|
2025-03-18 10:24:05 +01:00
|
|
|
GL11.glPopMatrix();
|
2025-03-19 23:31:33 +01:00
|
|
|
GlState.cullFace(GL11.GL_BACK);
|
2025-03-11 00:23:54 +01:00
|
|
|
GlState.disableCull();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean shouldCombineTextures()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|