    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 var1 = 20;
    021        byte var2 = 8;
    022        byte var3 = 16;
    023        byte var4 = 4;
    024        this.sideModels[0].addBox((float)(-var1 / 2), (float)(-var3 / 2), -1.0F, var1, var3, 2, 0.0F);
    025        this.sideModels[0].setRotationPoint(0.0F, (float)var4, 0.0F);
    026        this.sideModels[5].addBox((float)(-var1 / 2 + 1), (float)(-var3 / 2 + 1), -1.0F, var1 - 2, var3 - 2, 1, 0.0F);
    027        this.sideModels[5].setRotationPoint(0.0F, (float)var4, 0.0F);
    028        this.sideModels[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
    029        this.sideModels[1].setRotationPoint((float)(-var1 / 2 + 1), (float)var4, 0.0F);
    030        this.sideModels[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
    031        this.sideModels[2].setRotationPoint((float)(var1 / 2 - 1), (float)var4, 0.0F);
    032        this.sideModels[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
    033        this.sideModels[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1));
    034        this.sideModels[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
    035        this.sideModels[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 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 var8 = 0; var8 < 6; ++var8)
    051        {
    052            this.sideModels[var8].render(par7);
    053        }
    054    }
    055}