ModelIronGolem .java

net.minecraft.client.model.ModelIronGolem (class, 129 lines): members: ironGolemRightArm, ironGolemRightLeg, ironGolemLeftArm, ironGolemLeftLeg, render.

net.minecraft.client.modelclass129 linesclientextends ModelBase5.8 KB

API Surface (3)

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)
void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)

Fields & Constants (6)

ironGolemHead
ironGolemBody
ironGolemRightArm
ironGolemLeftArm
ironGolemLeftLeg
ironGolemRightLeg

Code Graph: Dependencies (5)

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

Full Source

ModelIronGolem.java129 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.EntityIronGolem;
6
7
public class ModelIronGolem extends ModelBase
8
{
9
    /** The head model for the iron golem. */
10
    public ModelRenderer ironGolemHead;
11
12
    /** The body model for the iron golem. */
13
    public ModelRenderer ironGolemBody;
14
15
    /** The right arm model for the iron golem. */
16
    public ModelRenderer ironGolemRightArm;
17
18
    /** The left arm model for the iron golem. */
19
    public ModelRenderer ironGolemLeftArm;
20
21
    /** The left leg model for the Iron Golem. */
22
    public ModelRenderer ironGolemLeftLeg;
23
24
    /** The right leg model for the Iron Golem. */
25
    public ModelRenderer ironGolemRightLeg;
26
27
    public ModelIronGolem()
28
    {
29
        this(0.0F);
30
    }
31
32
    public ModelIronGolem(float p_i1161_1_)
33
    {
34
        this(p_i1161_1_, -7.0F);
35
    }
36
37
    public ModelIronGolem(float p_i46362_1_, float p_i46362_2_)
38
    {
39
        int i = 128;
40
        int j = 128;
41
        this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(i, j);
42
        this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i46362_2_, -2.0F);
43
        this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i46362_1_);
44
        this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i46362_1_);
45
        this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(i, j);
46
        this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i46362_2_, 0.0F);
47
        this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i46362_1_);
48
        this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i46362_1_ + 0.5F);
49
        this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(i, j);
50
        this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F);
51
        this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_);
52
        this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(i, j);
53
        this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F);
54
        this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_);
55
        this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(i, j);
56
        this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i46362_2_, 0.0F);
57
        this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_);
58
        this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(i, j);
59
        this.ironGolemRightLeg.mirror = true;
60
        this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + p_i46362_2_, 0.0F);
61
        this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_);
62
    }
63
64
    /**
65
     * Sets the models various rotation angles then renders the model.
66
     */
67
    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)
68
    {
69
        this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);
70
        this.ironGolemHead.render(scale);
71
        this.ironGolemBody.render(scale);
72
        this.ironGolemLeftLeg.render(scale);
73
        this.ironGolemRightLeg.render(scale);
74
        this.ironGolemRightArm.render(scale);
75
        this.ironGolemLeftArm.render(scale);
76
    }
77
78
    /**
79
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
80
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
81
     * "far" arms and legs can swing at most.
82
     */
83
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
84
    {
85
        this.ironGolemHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI);
86
        this.ironGolemHead.rotateAngleX = headPitch / (180F / (float)Math.PI);
87
        this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(limbSwing, 13.0F) * limbSwingAmount;
88
        this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(limbSwing, 13.0F) * limbSwingAmount;
89
        this.ironGolemLeftLeg.rotateAngleY = 0.0F;
90
        this.ironGolemRightLeg.rotateAngleY = 0.0F;
91
    }
92
93
    /**
94
     * Used for easily adding entity-dependent animations. The second and third float params here are the same second
95
     * and third as in the setRotationAngles method.
96
     */
97
    public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
98
    {
99
        EntityIronGolem entityirongolem = (EntityIronGolem)entitylivingbaseIn;
100
        int i = entityirongolem.getAttackTimer();
101
102
        if (i > 0)
103
        {
104
            this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - partialTickTime, 10.0F);
105
            this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - partialTickTime, 10.0F);
106
        }
107
        else
108
        {
109
            int j = entityirongolem.getHoldRoseTick();
110
111
            if (j > 0)
112
            {
113
                this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)j, 70.0F);
114
                this.ironGolemLeftArm.rotateAngleX = 0.0F;
115
            }
116
            else
117
            {
118
                this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
119
                this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
120
            }
121
        }
122
    }
123
124
    private float func_78172_a(float p_78172_1_, float p_78172_2_)
125
    {
126
        return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F);
127
    }
128
}
129

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