| 1 | package net.minecraft.client.model;
|
| 2 |
|
| 3 | import net.minecraft.entity.Entity;
|
| 4 |
|
| 5 | public class ModelMinecart extends ModelBase
|
| 6 | {
|
| 7 | public ModelRenderer[] sideModels = new ModelRenderer[7];
|
| 8 |
|
| 9 | public ModelMinecart()
|
| 10 | {
|
| 11 | this.sideModels[0] = new ModelRenderer(this, 0, 10);
|
| 12 | this.sideModels[1] = new ModelRenderer(this, 0, 0);
|
| 13 | this.sideModels[2] = new ModelRenderer(this, 0, 0);
|
| 14 | this.sideModels[3] = new ModelRenderer(this, 0, 0);
|
| 15 | this.sideModels[4] = new ModelRenderer(this, 0, 0);
|
| 16 | this.sideModels[5] = new ModelRenderer(this, 44, 10);
|
| 17 | int i = 20;
|
| 18 | int j = 8;
|
| 19 | int k = 16;
|
| 20 | int l = 4;
|
| 21 | this.sideModels[0].addBox((float)(-i / 2), (float)(-k / 2), -1.0F, i, k, 2, 0.0F);
|
| 22 | this.sideModels[0].setRotationPoint(0.0F, (float)l, 0.0F);
|
| 23 | this.sideModels[5].addBox((float)(-i / 2 + 1), (float)(-k / 2 + 1), -1.0F, i - 2, k - 2, 1, 0.0F);
|
| 24 | this.sideModels[5].setRotationPoint(0.0F, (float)l, 0.0F);
|
| 25 | this.sideModels[1].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F);
|
| 26 | this.sideModels[1].setRotationPoint((float)(-i / 2 + 1), (float)l, 0.0F);
|
| 27 | this.sideModels[2].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F);
|
| 28 | this.sideModels[2].setRotationPoint((float)(i / 2 - 1), (float)l, 0.0F);
|
| 29 | this.sideModels[3].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F);
|
| 30 | this.sideModels[3].setRotationPoint(0.0F, (float)l, (float)(-k / 2 + 1));
|
| 31 | this.sideModels[4].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F);
|
| 32 | this.sideModels[4].setRotationPoint(0.0F, (float)l, (float)(k / 2 - 1));
|
| 33 | this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F);
|
| 34 | this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F);
|
| 35 | this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F);
|
| 36 | this.sideModels[3].rotateAngleY = (float)Math.PI;
|
| 37 | this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F);
|
| 38 | }
|
| 39 |
|
| 40 | /**
|
| 41 | * Sets the models various rotation angles then renders the model.
|
| 42 | */
|
| 43 | 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)
|
| 44 | {
|
| 45 | this.sideModels[5].rotationPointY = 4.0F - p_78088_4_;
|
| 46 |
|
| 47 | for (int i = 0; i < 6; ++i)
|
| 48 | {
|
| 49 | this.sideModels[i].render(scale);
|
| 50 | }
|
| 51 | }
|
| 52 | }
|
| 53 |
|