ModelSquid .java

net.minecraft.client.model.ModelSquid (class, 62 lines): extends ModelBase. members: squidTentacles, squidBody, setRotationAngles, render. imports: Entity.

net.minecraft.client.modelclass62 linesclientextends ModelBase2.3 KB

API Surface (2)

void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
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)

squidBody
squidTentacles

Code Graph: Dependencies (3)

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

Full Source

ModelSquid.java62 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.model;
2
3
import net.minecraft.entity.Entity;
4
5
public class ModelSquid extends ModelBase
6
{
7
    /** The squid's body */
8
    ModelRenderer squidBody;
9
10
    /** The squid's tentacles */
11
    ModelRenderer[] squidTentacles = new ModelRenderer[8];
12
13
    public ModelSquid()
14
    {
15
        int i = -16;
16
        this.squidBody = new ModelRenderer(this, 0, 0);
17
        this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12);
18
        this.squidBody.rotationPointY += (float)(24 + i);
19
20
        for (int j = 0; j < this.squidTentacles.length; ++j)
21
        {
22
            this.squidTentacles[j] = new ModelRenderer(this, 48, 0);
23
            double d0 = (double)j * Math.PI * 2.0D / (double)this.squidTentacles.length;
24
            float f = (float)Math.cos(d0) * 5.0F;
25
            float f1 = (float)Math.sin(d0) * 5.0F;
26
            this.squidTentacles[j].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2);
27
            this.squidTentacles[j].rotationPointX = f;
28
            this.squidTentacles[j].rotationPointZ = f1;
29
            this.squidTentacles[j].rotationPointY = (float)(31 + i);
30
            d0 = (double)j * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D);
31
            this.squidTentacles[j].rotateAngleY = (float)d0;
32
        }
33
    }
34
35
    /**
36
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
37
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
38
     * "far" arms and legs can swing at most.
39
     */
40
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
41
    {
42
        for (ModelRenderer modelrenderer : this.squidTentacles)
43
        {
44
            modelrenderer.rotateAngleX = ageInTicks;
45
        }
46
    }
47
48
    /**
49
     * Sets the models various rotation angles then renders the model.
50
     */
51
    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)
52
    {
53
        this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);
54
        this.squidBody.render(scale);
55
56
        for (int i = 0; i < this.squidTentacles.length; ++i)
57
        {
58
            this.squidTentacles[i].render(scale);
59
        }
60
    }
61
}
62

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