| 1 | package net.minecraft.client.renderer.entity.layers;
|
| 2 |
|
| 3 | import net.minecraft.client.model.ModelWither;
|
| 4 | import net.minecraft.client.renderer.GlStateManager;
|
| 5 | import net.minecraft.client.renderer.entity.RenderWither;
|
| 6 | import net.minecraft.entity.boss.EntityWither;
|
| 7 | import net.minecraft.util.MathHelper;
|
| 8 | import net.minecraft.util.ResourceLocation;
|
| 9 |
|
| 10 | public class LayerWitherAura implements LayerRenderer<EntityWither>
|
| 11 | {
|
| 12 | private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png");
|
| 13 | private final RenderWither witherRenderer;
|
| 14 | private final ModelWither witherModel = new ModelWither(0.5F);
|
| 15 |
|
| 16 | public LayerWitherAura(RenderWither witherRendererIn)
|
| 17 | {
|
| 18 | this.witherRenderer = witherRendererIn;
|
| 19 | }
|
| 20 |
|
| 21 | public void doRenderLayer(EntityWither 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.isArmored())
|
| 24 | {
|
| 25 | GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
|
| 26 | this.witherRenderer.bindTexture(WITHER_ARMOR);
|
| 27 | GlStateManager.matrixMode(5890);
|
| 28 | GlStateManager.loadIdentity();
|
| 29 | float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
|
| 30 | float f1 = MathHelper.cos(f * 0.02F) * 3.0F;
|
| 31 | float f2 = f * 0.01F;
|
| 32 | GlStateManager.translate(f1, f2, 0.0F);
|
| 33 | GlStateManager.matrixMode(5888);
|
| 34 | GlStateManager.enableBlend();
|
| 35 | float f3 = 0.5F;
|
| 36 | GlStateManager.color(f3, f3, f3, 1.0F);
|
| 37 | GlStateManager.disableLighting();
|
| 38 | GlStateManager.blendFunc(1, 1);
|
| 39 | this.witherModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks);
|
| 40 | this.witherModel.setModelAttributes(this.witherRenderer.getMainModel());
|
| 41 | this.witherModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
|
| 42 | GlStateManager.matrixMode(5890);
|
| 43 | GlStateManager.loadIdentity();
|
| 44 | GlStateManager.matrixMode(5888);
|
| 45 | GlStateManager.enableLighting();
|
| 46 | GlStateManager.disableBlend();
|
| 47 | }
|
| 48 | }
|
| 49 |
|
| 50 | public boolean shouldCombineTextures()
|
| 51 | {
|
| 52 | return false;
|
| 53 | }
|
| 54 | }
|
| 55 |
|