ModelMagmaCube .java

net.minecraft.client.model.ModelMagmaCube (class, 72 lines): members: segments, core, setLivingAnimations, render. imports: EntityMagmaCube, Entity.

net.minecraft.client.modelclass72 linesclientextends ModelBase2.1 KB

API Surface (2)

void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)

Fields & Constants (2)

segments
core

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ModelMagmaCube.java72 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.model;
2
3
import net.minecraft.entity.Entity;
4
import net.minecraft.entity.EntityLivingBase;
5
import net.minecraft.entity.monster.EntityMagmaCube;
6
7
public class ModelMagmaCube extends ModelBase
8
{
9
    ModelRenderer[] segments = new ModelRenderer[8];
10
    ModelRenderer core;
11
12
    public ModelMagmaCube()
13
    {
14
        for (int i = 0; i < this.segments.length; ++i)
15
        {
16
            int j = 0;
17
            int k = i;
18
19
            if (i == 2)
20
            {
21
                j = 24;
22
                k = 10;
23
            }
24
            else if (i == 3)
25
            {
26
                j = 24;
27
                k = 19;
28
            }
29
30
            this.segments[i] = new ModelRenderer(this, j, k);
31
            this.segments[i].addBox(-4.0F, (float)(16 + i), -4.0F, 8, 1, 8);
32
        }
33
34
        this.core = new ModelRenderer(this, 0, 16);
35
        this.core.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4);
36
    }
37
38
    /**
39
     * Used for easily adding entity-dependent animations. The second and third float params here are the same second
40
     * and third as in the setRotationAngles method.
41
     */
42
    public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
43
    {
44
        EntityMagmaCube entitymagmacube = (EntityMagmaCube)entitylivingbaseIn;
45
        float f = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * partialTickTime;
46
47
        if (f < 0.0F)
48
        {
49
            f = 0.0F;
50
        }
51
52
        for (int i = 0; i < this.segments.length; ++i)
53
        {
54
            this.segments[i].rotationPointY = (float)(-(4 - i)) * f * 1.7F;
55
        }
56
    }
57
58
    /**
59
     * Sets the models various rotation angles then renders the model.
60
     */
61
    public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
62
    {
63
        this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);
64
        this.core.render(scale);
65
66
        for (int i = 0; i < this.segments.length; ++i)
67
        {
68
            this.segments[i].render(scale);
69
        }
70
    }
71
}
72

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