RenderWither .java

net.minecraft.client.renderer.entity.RenderWither (class, 56 lines): members: invulnerableWitherTextures, witherTextures, preRenderCallback, doRender.

net.minecraft.client.renderer.entityclass56 linesclientextends RenderLiving<EntityWither>2.0 KB

API Surface (3)

void doRender(EntityWither entity, double x, double y, double z, float entityYaw, float partialTicks)
ResourceLocation getEntityTexture(EntityWither entity)
void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime)

Fields & Constants (2)

invulnerableWitherTextures
witherTextures

String literals (2)

"textures/entity/wither/wither_invulnerable.png"
"textures/entity/wither/wither.png"

Full Source

RenderWither.java56 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.renderer.entity;
2
3
import net.minecraft.client.model.ModelWither;
4
import net.minecraft.client.renderer.GlStateManager;
5
import net.minecraft.client.renderer.entity.layers.LayerWitherAura;
6
import net.minecraft.entity.boss.BossStatus;
7
import net.minecraft.entity.boss.EntityWither;
8
import net.minecraft.util.ResourceLocation;
9
10
public class RenderWither extends RenderLiving<EntityWither>
11
{
12
    private static final ResourceLocation invulnerableWitherTextures = new ResourceLocation("textures/entity/wither/wither_invulnerable.png");
13
    private static final ResourceLocation witherTextures = new ResourceLocation("textures/entity/wither/wither.png");
14
15
    public RenderWither(RenderManager renderManagerIn)
16
    {
17
        super(renderManagerIn, new ModelWither(0.0F), 1.0F);
18
        this.addLayer(new LayerWitherAura(this));
19
    }
20
21
    /**
22
     * Renders the desired {@code T} type Entity.
23
     */
24
    public void doRender(EntityWither entity, double x, double y, double z, float entityYaw, float partialTicks)
25
    {
26
        BossStatus.setBossStatus(entity, true);
27
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
28
    }
29
30
    /**
31
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
32
     */
33
    protected ResourceLocation getEntityTexture(EntityWither entity)
34
    {
35
        int i = entity.getInvulTime();
36
        return i > 0 && (i > 80 || i / 5 % 2 != 1) ? invulnerableWitherTextures : witherTextures;
37
    }
38
39
    /**
40
     * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
41
     * entityLiving, partialTickTime
42
     */
43
    protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime)
44
    {
45
        float f = 2.0F;
46
        int i = entitylivingbaseIn.getInvulTime();
47
48
        if (i > 0)
49
        {
50
            f -= ((float)i - partialTickTime) / 220.0F * 0.5F;
51
        }
52
53
        GlStateManager.scale(f, f, f);
54
    }
55
}
56

Deobfuscated MCP 1.8.9 source of RenderWither from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/renderer/entity/RenderWither.java), stored verbatim.