    001package net.minecraft.client.model;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.entity.Entity;
    006
    007@SideOnly(Side.CLIENT)
    008public class ModelMinecart extends ModelBase
    009{
    010    public ModelRenderer[] sideModels = new ModelRenderer[7];
    011
    012    public ModelMinecart()
    013    {
    014        this.sideModels[0] = new ModelRenderer(this, 0, 10);
    015        this.sideModels[1] = new ModelRenderer(this, 0, 0);
    016        this.sideModels[2] = new ModelRenderer(this, 0, 0);
    017        this.sideModels[3] = new ModelRenderer(this, 0, 0);
    018        this.sideModels[4] = new ModelRenderer(this, 0, 0);
    019        this.sideModels[5] = new ModelRenderer(this, 44, 10);
    020        byte b0 = 20;
    021        byte b1 = 8;
    022        byte b2 = 16;
    023        byte b3 = 4;
    024        this.sideModels[0].addBox((float)(-b0 / 2), (float)(-b2 / 2), -1.0F, b0, b2, 2, 0.0F);
    025        this.sideModels[0].setRotationPoint(0.0F, (float)b3, 0.0F);
    026        this.sideModels[5].addBox((float)(-b0 / 2 + 1), (float)(-b2 / 2 + 1), -1.0F, b0 - 2, b2 - 2, 1, 0.0F);
    027        this.sideModels[5].setRotationPoint(0.0F, (float)b3, 0.0F);
    028        this.sideModels[1].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
    029        this.sideModels[1].setRotationPoint((float)(-b0 / 2 + 1), (float)b3, 0.0F);
    030        this.sideModels[2].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
    031        this.sideModels[2].setRotationPoint((float)(b0 / 2 - 1), (float)b3, 0.0F);
    032        this.sideModels[3].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
    033        this.sideModels[3].setRotationPoint(0.0F, (float)b3, (float)(-b2 / 2 + 1));
    034        this.sideModels[4].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
    035        this.sideModels[4].setRotationPoint(0.0F, (float)b3, (float)(b2 / 2 - 1));
    036        this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F);
    037        this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F);
    038        this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F);
    039        this.sideModels[3].rotateAngleY = (float)Math.PI;
    040        this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F);
    041    }
    042
    043    /**
    044     * Sets the models various rotation angles then renders the model.
    045     */
    046    public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    047    {
    048        this.sideModels[5].rotationPointY = 4.0F - par4;
    049
    050        for (int i = 0; i < 6; ++i)
    051        {
    052            this.sideModels[i].render(par7);
    053        }
    054    }
    055}