ModelRabbit .java

net.minecraft.client.model.ModelRabbit (class): members: rabbitRightThigh, rabbitLeftThigh, rabbitRightFoot, field_178699_n, field_178701_m, rabbitLeftArm.

net.minecraft.client.modelclass198 linesclientextends ModelBase8.9 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 (14)

rabbitLeftFoot
rabbitRightFoot
rabbitLeftThigh
rabbitRightThigh
rabbitBody
rabbitLeftArm
rabbitRightArm
rabbitHead
rabbitRightEar
rabbitLeftEar
rabbitTail
rabbitNose
field_178701_m
field_178699_n

String literals (4)

"head.main"
"head.nose"
"head.ear1"
"head.ear2"

Code Graph: Dependencies (7)

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

Full Source

ModelRabbit.java198 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.model;
2
3
import net.minecraft.client.renderer.GlStateManager;
4
import net.minecraft.entity.Entity;
5
import net.minecraft.entity.EntityLivingBase;
6
import net.minecraft.entity.passive.EntityRabbit;
7
import net.minecraft.util.MathHelper;
8
9
public class ModelRabbit extends ModelBase
10
{
11
    /** The Rabbit's Left Foot */
12
    ModelRenderer rabbitLeftFoot;
13
14
    /** The Rabbit's Right Foot */
15
    ModelRenderer rabbitRightFoot;
16
17
    /** The Rabbit's Left Thigh */
18
    ModelRenderer rabbitLeftThigh;
19
20
    /** The Rabbit's Right Thigh */
21
    ModelRenderer rabbitRightThigh;
22
23
    /** The Rabbit's Body */
24
    ModelRenderer rabbitBody;
25
26
    /** The Rabbit's Left Arm */
27
    ModelRenderer rabbitLeftArm;
28
29
    /** The Rabbit's Right Arm */
30
    ModelRenderer rabbitRightArm;
31
32
    /** The Rabbit's Head */
33
    ModelRenderer rabbitHead;
34
35
    /** The Rabbit's Right Ear */
36
    ModelRenderer rabbitRightEar;
37
38
    /** The Rabbit's Left Ear */
39
    ModelRenderer rabbitLeftEar;
40
41
    /** The Rabbit's Tail */
42
    ModelRenderer rabbitTail;
43
44
    /** The Rabbit's Nose */
45
    ModelRenderer rabbitNose;
46
    private float field_178701_m = 0.0F;
47
    private float field_178699_n = 0.0F;
48
49
    public ModelRabbit()
50
    {
51
        this.setTextureOffset("head.main", 0, 0);
52
        this.setTextureOffset("head.nose", 0, 24);
53
        this.setTextureOffset("head.ear1", 0, 10);
54
        this.setTextureOffset("head.ear2", 6, 10);
55
        this.rabbitLeftFoot = new ModelRenderer(this, 26, 24);
56
        this.rabbitLeftFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
57
        this.rabbitLeftFoot.setRotationPoint(3.0F, 17.5F, 3.7F);
58
        this.rabbitLeftFoot.mirror = true;
59
        this.setRotationOffset(this.rabbitLeftFoot, 0.0F, 0.0F, 0.0F);
60
        this.rabbitRightFoot = new ModelRenderer(this, 8, 24);
61
        this.rabbitRightFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
62
        this.rabbitRightFoot.setRotationPoint(-3.0F, 17.5F, 3.7F);
63
        this.rabbitRightFoot.mirror = true;
64
        this.setRotationOffset(this.rabbitRightFoot, 0.0F, 0.0F, 0.0F);
65
        this.rabbitLeftThigh = new ModelRenderer(this, 30, 15);
66
        this.rabbitLeftThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
67
        this.rabbitLeftThigh.setRotationPoint(3.0F, 17.5F, 3.7F);
68
        this.rabbitLeftThigh.mirror = true;
69
        this.setRotationOffset(this.rabbitLeftThigh, -0.34906584F, 0.0F, 0.0F);
70
        this.rabbitRightThigh = new ModelRenderer(this, 16, 15);
71
        this.rabbitRightThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
72
        this.rabbitRightThigh.setRotationPoint(-3.0F, 17.5F, 3.7F);
73
        this.rabbitRightThigh.mirror = true;
74
        this.setRotationOffset(this.rabbitRightThigh, -0.34906584F, 0.0F, 0.0F);
75
        this.rabbitBody = new ModelRenderer(this, 0, 0);
76
        this.rabbitBody.addBox(-3.0F, -2.0F, -10.0F, 6, 5, 10);
77
        this.rabbitBody.setRotationPoint(0.0F, 19.0F, 8.0F);
78
        this.rabbitBody.mirror = true;
79
        this.setRotationOffset(this.rabbitBody, -0.34906584F, 0.0F, 0.0F);
80
        this.rabbitLeftArm = new ModelRenderer(this, 8, 15);
81
        this.rabbitLeftArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
82
        this.rabbitLeftArm.setRotationPoint(3.0F, 17.0F, -1.0F);
83
        this.rabbitLeftArm.mirror = true;
84
        this.setRotationOffset(this.rabbitLeftArm, -0.17453292F, 0.0F, 0.0F);
85
        this.rabbitRightArm = new ModelRenderer(this, 0, 15);
86
        this.rabbitRightArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
87
        this.rabbitRightArm.setRotationPoint(-3.0F, 17.0F, -1.0F);
88
        this.rabbitRightArm.mirror = true;
89
        this.setRotationOffset(this.rabbitRightArm, -0.17453292F, 0.0F, 0.0F);
90
        this.rabbitHead = new ModelRenderer(this, 32, 0);
91
        this.rabbitHead.addBox(-2.5F, -4.0F, -5.0F, 5, 4, 5);
92
        this.rabbitHead.setRotationPoint(0.0F, 16.0F, -1.0F);
93
        this.rabbitHead.mirror = true;
94
        this.setRotationOffset(this.rabbitHead, 0.0F, 0.0F, 0.0F);
95
        this.rabbitRightEar = new ModelRenderer(this, 52, 0);
96
        this.rabbitRightEar.addBox(-2.5F, -9.0F, -1.0F, 2, 5, 1);
97
        this.rabbitRightEar.setRotationPoint(0.0F, 16.0F, -1.0F);
98
        this.rabbitRightEar.mirror = true;
99
        this.setRotationOffset(this.rabbitRightEar, 0.0F, -0.2617994F, 0.0F);
100
        this.rabbitLeftEar = new ModelRenderer(this, 58, 0);
101
        this.rabbitLeftEar.addBox(0.5F, -9.0F, -1.0F, 2, 5, 1);
102
        this.rabbitLeftEar.setRotationPoint(0.0F, 16.0F, -1.0F);
103
        this.rabbitLeftEar.mirror = true;
104
        this.setRotationOffset(this.rabbitLeftEar, 0.0F, 0.2617994F, 0.0F);
105
        this.rabbitTail = new ModelRenderer(this, 52, 6);
106
        this.rabbitTail.addBox(-1.5F, -1.5F, 0.0F, 3, 3, 2);
107
        this.rabbitTail.setRotationPoint(0.0F, 20.0F, 7.0F);
108
        this.rabbitTail.mirror = true;
109
        this.setRotationOffset(this.rabbitTail, -0.3490659F, 0.0F, 0.0F);
110
        this.rabbitNose = new ModelRenderer(this, 32, 9);
111
        this.rabbitNose.addBox(-0.5F, -2.5F, -5.5F, 1, 1, 1);
112
        this.rabbitNose.setRotationPoint(0.0F, 16.0F, -1.0F);
113
        this.rabbitNose.mirror = true;
114
        this.setRotationOffset(this.rabbitNose, 0.0F, 0.0F, 0.0F);
115
    }
116
117
    private void setRotationOffset(ModelRenderer p_178691_1_, float p_178691_2_, float p_178691_3_, float p_178691_4_)
118
    {
119
        p_178691_1_.rotateAngleX = p_178691_2_;
120
        p_178691_1_.rotateAngleY = p_178691_3_;
121
        p_178691_1_.rotateAngleZ = p_178691_4_;
122
    }
123
124
    /**
125
     * Sets the models various rotation angles then renders the model.
126
     */
127
    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)
128
    {
129
        this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);
130
131
        if (this.isChild)
132
        {
133
            float f = 2.0F;
134
            GlStateManager.pushMatrix();
135
            GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
136
            this.rabbitHead.render(scale);
137
            this.rabbitLeftEar.render(scale);
138
            this.rabbitRightEar.render(scale);
139
            this.rabbitNose.render(scale);
140
            GlStateManager.popMatrix();
141
            GlStateManager.pushMatrix();
142
            GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
143
            GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
144
            this.rabbitLeftFoot.render(scale);
145
            this.rabbitRightFoot.render(scale);
146
            this.rabbitLeftThigh.render(scale);
147
            this.rabbitRightThigh.render(scale);
148
            this.rabbitBody.render(scale);
149
            this.rabbitLeftArm.render(scale);
150
            this.rabbitRightArm.render(scale);
151
            this.rabbitTail.render(scale);
152
            GlStateManager.popMatrix();
153
        }
154
        else
155
        {
156
            this.rabbitLeftFoot.render(scale);
157
            this.rabbitRightFoot.render(scale);
158
            this.rabbitLeftThigh.render(scale);
159
            this.rabbitRightThigh.render(scale);
160
            this.rabbitBody.render(scale);
161
            this.rabbitLeftArm.render(scale);
162
            this.rabbitRightArm.render(scale);
163
            this.rabbitHead.render(scale);
164
            this.rabbitRightEar.render(scale);
165
            this.rabbitLeftEar.render(scale);
166
            this.rabbitTail.render(scale);
167
            this.rabbitNose.render(scale);
168
        }
169
    }
170
171
    /**
172
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
173
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
174
     * "far" arms and legs can swing at most.
175
     */
176
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
177
    {
178
        float f = ageInTicks - (float)entityIn.ticksExisted;
179
        EntityRabbit entityrabbit = (EntityRabbit)entityIn;
180
        this.rabbitNose.rotateAngleX = this.rabbitHead.rotateAngleX = this.rabbitRightEar.rotateAngleX = this.rabbitLeftEar.rotateAngleX = headPitch * 0.017453292F;
181
        this.rabbitNose.rotateAngleY = this.rabbitHead.rotateAngleY = netHeadYaw * 0.017453292F;
182
        this.rabbitRightEar.rotateAngleY = this.rabbitNose.rotateAngleY - 0.2617994F;
183
        this.rabbitLeftEar.rotateAngleY = this.rabbitNose.rotateAngleY + 0.2617994F;
184
        this.field_178701_m = MathHelper.sin(entityrabbit.func_175521_o(f) * (float)Math.PI);
185
        this.rabbitLeftThigh.rotateAngleX = this.rabbitRightThigh.rotateAngleX = (this.field_178701_m * 50.0F - 21.0F) * 0.017453292F;
186
        this.rabbitLeftFoot.rotateAngleX = this.rabbitRightFoot.rotateAngleX = this.field_178701_m * 50.0F * 0.017453292F;
187
        this.rabbitLeftArm.rotateAngleX = this.rabbitRightArm.rotateAngleX = (this.field_178701_m * -40.0F - 11.0F) * 0.017453292F;
188
    }
189
190
    /**
191
     * Used for easily adding entity-dependent animations. The second and third float params here are the same second
192
     * and third as in the setRotationAngles method.
193
     */
194
    public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
195
    {
196
    }
197
}
198

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