// Date: 31-5-2015 16:23:42
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package pneumaticCraft.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidTankInfo;
import pneumaticCraft.client.util.RenderUtils;
import pneumaticCraft.client.util.RenderUtils.RenderInfo;
import pneumaticCraft.common.tileentity.TileEntityThermopneumaticProcessingPlant;
import pneumaticCraft.lib.Textures;
public class ModelThermopneumaticProcessingPlant extends ModelBase implements IBaseModel{
//fields
ModelRenderer itemPart;
ModelRenderer inputTank;
ModelRenderer outputTank;
ModelRenderer pipe1;
ModelRenderer pipe2;
ModelRenderer pipe3;
ModelRenderer pipe4;
ModelRenderer airBottom;
ModelRenderer airBack;
ModelRenderer airLeft;
ModelRenderer airRight;
public ModelThermopneumaticProcessingPlant(){
textureWidth = 64;
textureHeight = 64;
itemPart = new ModelRenderer(this, 0, 23);
itemPart.addBox(0F, 0F, 0F, 6, 8, 6);
itemPart.setRotationPoint(-3F, 16F, -8F);
itemPart.setTextureSize(64, 64);
itemPart.mirror = true;
setRotation(itemPart, 0F, 0F, 0F);
inputTank = new ModelRenderer(this, 0, 0);
inputTank.addBox(0F, 0F, 0F, 7, 12, 7);
inputTank.setRotationPoint(-8F, 12F, 1F);
inputTank.setTextureSize(64, 64);
inputTank.mirror = true;
setRotation(inputTank, 0F, 0F, 0F);
outputTank = new ModelRenderer(this, 0, 0);
outputTank.addBox(0F, 0F, 0F, 7, 12, 7);
outputTank.setRotationPoint(1F, 12F, 1F);
outputTank.setTextureSize(64, 64);
outputTank.mirror = true;
setRotation(outputTank, 0F, 0F, 0F);
pipe1 = new ModelRenderer(this, 28, 8);
pipe1.addBox(0F, 0F, 0F, 1, 1, 1);
pipe1.setRotationPoint(-4F, 19F, -6F);
pipe1.setTextureSize(64, 64);
pipe1.mirror = true;
setRotation(pipe1, 0F, 0F, 0F);
pipe2 = new ModelRenderer(this, 28, 0);
pipe2.addBox(0F, 0F, 0F, 1, 1, 7);
pipe2.setRotationPoint(-5F, 19F, -6F);
pipe2.setTextureSize(64, 64);
pipe2.mirror = true;
setRotation(pipe2, 0F, 0F, 0F);
pipe3 = new ModelRenderer(this, 28, 0);
pipe3.addBox(0F, 0F, 0F, 1, 1, 7);
pipe3.setRotationPoint(4F, 19F, -6F);
pipe3.setTextureSize(64, 64);
pipe3.mirror = true;
setRotation(pipe3, 0F, 0F, 0F);
pipe4 = new ModelRenderer(this, 28, 8);
pipe4.addBox(0F, 0F, 0F, 1, 1, 1);
pipe4.setRotationPoint(3F, 19F, -6F);
pipe4.setTextureSize(64, 64);
pipe4.mirror = true;
setRotation(pipe4, 0F, 0F, 0F);
airBottom = new ModelRenderer(this, 44, 0);
airBottom.addBox(0F, 0F, 0F, 4, 1, 4);
airBottom.setRotationPoint(-2F, 23F, -2F);
airBottom.setTextureSize(64, 64);
airBottom.mirror = true;
setRotation(airBottom, 0F, 0F, 0F);
airBack = new ModelRenderer(this, 45, 5);
airBack.addBox(0F, 0F, 0F, 2, 4, 1);
airBack.setRotationPoint(-1F, 14F, 7F);
airBack.setTextureSize(64, 64);
airBack.mirror = true;
setRotation(airBack, 0F, 0F, 0F);
airLeft = new ModelRenderer(this, 44, 10);
airLeft.addBox(0F, 0F, 0F, 1, 4, 3);
airLeft.setRotationPoint(-8F, 14F, -2F);
airLeft.setTextureSize(64, 64);
airLeft.mirror = true;
setRotation(airLeft, 0F, 0F, 0F);
airRight = new ModelRenderer(this, 44, 17);
airRight.addBox(0F, 0F, 0F, 1, 4, 3);
airRight.setRotationPoint(7F, 14F, -2F);
airRight.setTextureSize(64, 64);
airRight.mirror = true;
setRotation(airRight, 0F, 0F, 0F);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
itemPart.render(f5);
inputTank.render(f5);
outputTank.render(f5);
pipe1.render(f5);
pipe2.render(f5);
pipe3.render(f5);
pipe4.render(f5);
airBottom.render(f5);
airBack.render(f5);
airLeft.render(f5);
airRight.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z){
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void renderStatic(float size, TileEntity te){
itemPart.render(size);
inputTank.render(size);
outputTank.render(size);
pipe1.render(size);
pipe2.render(size);
pipe3.render(size);
pipe4.render(size);
airBottom.render(size);
airBack.render(size);
airLeft.render(size);
airRight.render(size);
if(te != null) {
TileEntityThermopneumaticProcessingPlant processor = (TileEntityThermopneumaticProcessingPlant)te;
FluidTankInfo info = processor.getTankInfo(null)[0];
if(info.fluid != null && info.fluid.amount > 10) {
float percentageFull = (float)info.fluid.amount / info.capacity;
RenderInfo renderInfo = new RenderInfo(-8 / 16F + 0.01F, 24 / 16F - percentageFull * 9.999F / 16F, 1 / 16F + 0.01F, -1 / 16F - 0.01F, 24 / 16F - 0.01F, 8 / 16F - 0.01F);
RenderUtils.INSTANCE.renderLiquid(info, renderInfo, processor.getWorldObj());
}
info = processor.getTankInfo(null)[1];
if(info.fluid != null && info.fluid.amount > 10) {
float percentageFull = (float)info.fluid.amount / info.capacity;
RenderInfo renderInfo = new RenderInfo(1 / 16F + 0.01F, 24 / 16F - percentageFull * 9.999F / 16F, 1 / 16F + 0.01F, 8 / 16F - 0.01F, 24 / 16F - 0.01F, 8 / 16F - 0.01F);
RenderUtils.INSTANCE.renderLiquid(info, renderInfo, processor.getWorldObj());
}
}
}
@Override
public void renderDynamic(float size, TileEntity te, float partialTicks){
}
@Override
public ResourceLocation getModelTexture(TileEntity tile){
return Textures.MODEL_THERMOPNEUMATIC_PROCESSING_PLANT;
}
@Override
public boolean rotateModelBasedOnBlockMeta(){
return true;
}
}