ModelBase .java

net.minecraft.client.model.ModelBase (class, 81 lines): members: getRandomModelBox, getTextureOffset, copyModelAngles, modelTextureMap, boxList, isRiding.

net.minecraft.client.modelclass81 linesclient2.8 KB

API Surface (8)

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)
ModelRenderer getRandomModelBox(Random rand)
void setTextureOffset(String partName, int x, int y)
TextureOffset getTextureOffset(String partName)
void copyModelAngles(ModelRenderer source, ModelRenderer dest)
void setModelAttributes(ModelBase model)

Fields & Constants (7)

swingProgress
isRiding
isChild
boxList
modelTextureMap
textureWidth
textureHeight

Code Graph: Dependencies (4)

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

Full Source

ModelBase.java81 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.model;
2
3
import com.google.common.collect.Lists;
4
import com.google.common.collect.Maps;
5
import java.util.List;
6
import java.util.Map;
7
import java.util.Random;
8
import net.minecraft.entity.Entity;
9
import net.minecraft.entity.EntityLivingBase;
10
11
public abstract class ModelBase
12
{
13
    public float swingProgress;
14
    public boolean isRiding;
15
    public boolean isChild = true;
16
    public List<ModelRenderer> boxList = Lists.<ModelRenderer>newArrayList();
17
    private Map<String, TextureOffset> modelTextureMap = Maps.<String, TextureOffset>newHashMap();
18
    public int textureWidth = 64;
19
    public int textureHeight = 32;
20
21
    /**
22
     * Sets the models various rotation angles then renders the model.
23
     */
24
    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)
25
    {
26
    }
27
28
    /**
29
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
30
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
31
     * "far" arms and legs can swing at most.
32
     */
33
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
34
    {
35
    }
36
37
    /**
38
     * Used for easily adding entity-dependent animations. The second and third float params here are the same second
39
     * and third as in the setRotationAngles method.
40
     */
41
    public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
42
    {
43
    }
44
45
    public ModelRenderer getRandomModelBox(Random rand)
46
    {
47
        return (ModelRenderer)this.boxList.get(rand.nextInt(this.boxList.size()));
48
    }
49
50
    protected void setTextureOffset(String partName, int x, int y)
51
    {
52
        this.modelTextureMap.put(partName, new TextureOffset(x, y));
53
    }
54
55
    public TextureOffset getTextureOffset(String partName)
56
    {
57
        return (TextureOffset)this.modelTextureMap.get(partName);
58
    }
59
60
    /**
61
     * Copies the angles from one object to another. This is used when objects should stay aligned with each other, like
62
     * the hair over a players head.
63
     */
64
    public static void copyModelAngles(ModelRenderer source, ModelRenderer dest)
65
    {
66
        dest.rotateAngleX = source.rotateAngleX;
67
        dest.rotateAngleY = source.rotateAngleY;
68
        dest.rotateAngleZ = source.rotateAngleZ;
69
        dest.rotationPointX = source.rotationPointX;
70
        dest.rotationPointY = source.rotationPointY;
71
        dest.rotationPointZ = source.rotationPointZ;
72
    }
73
74
    public void setModelAttributes(ModelBase model)
75
    {
76
        this.swingProgress = model.swingProgress;
77
        this.isRiding = model.isRiding;
78
        this.isChild = model.isChild;
79
    }
80
}
81

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