2015-03-07 12:51:28 +01:00
|
|
|
package ellpeck.actuallyadditions.blocks.render;
|
2015-03-07 02:23:31 +01:00
|
|
|
|
2015-04-24 19:22:03 +02:00
|
|
|
import ellpeck.actuallyadditions.tile.TileEntityCompost;
|
2015-03-07 02:23:31 +01:00
|
|
|
import net.minecraft.client.model.ModelRenderer;
|
|
|
|
|
2015-03-07 12:51:28 +01:00
|
|
|
public class ModelCompost extends ModelBaseAA{
|
2015-03-07 02:23:31 +01:00
|
|
|
|
|
|
|
public ModelRenderer floor;
|
|
|
|
public ModelRenderer wallOne;
|
|
|
|
public ModelRenderer wallTwo;
|
|
|
|
public ModelRenderer wallThree;
|
|
|
|
public ModelRenderer wallFour;
|
2015-04-24 19:22:03 +02:00
|
|
|
public ModelRenderer[] innerRawList = new ModelRenderer[13];
|
|
|
|
public ModelRenderer innerDone;
|
2015-03-07 02:23:31 +01:00
|
|
|
|
|
|
|
public ModelCompost(){
|
|
|
|
this.textureWidth = 64;
|
2015-04-24 19:22:03 +02:00
|
|
|
this.textureHeight = 128;
|
2015-03-07 02:23:31 +01:00
|
|
|
this.wallThree = new ModelRenderer(this, 0, 0);
|
|
|
|
this.wallThree.setRotationPoint(-6.0F, 8.0F, 6.0F);
|
|
|
|
this.wallThree.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F);
|
|
|
|
this.wallFour = new ModelRenderer(this, 0, 0);
|
|
|
|
this.wallFour.setRotationPoint(-6.0F, 8.0F, -7.0F);
|
|
|
|
this.wallFour.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F);
|
|
|
|
this.wallOne = new ModelRenderer(this, 0, 0);
|
|
|
|
this.wallOne.setRotationPoint(-7.0F, 8.0F, -7.0F);
|
|
|
|
this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F);
|
|
|
|
this.wallTwo = new ModelRenderer(this, 0, 0);
|
|
|
|
this.wallTwo.setRotationPoint(6.0F, 8.0F, -7.0F);
|
|
|
|
this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F);
|
|
|
|
this.floor = new ModelRenderer(this, 0, 0);
|
|
|
|
this.floor.setRotationPoint(-7.0F, 23.0F, -7.0F);
|
|
|
|
this.floor.addBox(0.0F, 0.0F, 0.0F, 14, 1, 14, 0.0F);
|
2015-04-24 19:22:03 +02:00
|
|
|
|
|
|
|
for(int i = 0; i < this.innerRawList.length; i++){
|
|
|
|
this.innerRawList[i] = new ModelRenderer(this, 0, 29);
|
|
|
|
this.innerRawList[i].setRotationPoint(-6.0F, 10.0F, -6.0F);
|
|
|
|
this.innerRawList[i].addBox(0.0F, 12-i, 0.0F, 12, i+1, 12, 0.0F);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.innerDone = new ModelRenderer(this, 0, 54);
|
|
|
|
this.innerDone.setRotationPoint(-6.0F, 10.0F, -6.0F);
|
|
|
|
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void renderExtra(float f, TileEntityCompost tile){
|
|
|
|
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
|
|
|
if(meta > 0 && meta <= tile.amountNeededToConvert){
|
|
|
|
int heightToDisplay = meta*13/tile.amountNeededToConvert;
|
|
|
|
if(heightToDisplay > 13) heightToDisplay = 13;
|
|
|
|
|
|
|
|
this.innerRawList[heightToDisplay-1].render(f);
|
|
|
|
}
|
|
|
|
if(meta == tile.amountNeededToConvert+1){
|
|
|
|
this.innerDone.render(f);
|
|
|
|
}
|
2015-03-07 02:23:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void render(float f){
|
|
|
|
this.wallThree.render(f);
|
|
|
|
this.wallFour.render(f);
|
|
|
|
this.wallOne.render(f);
|
|
|
|
this.wallTwo.render(f);
|
|
|
|
this.floor.render(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getName(){
|
|
|
|
return "modelCompost";
|
|
|
|
}
|
|
|
|
}
|