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 pneumaticCraft.lib.Textures;
public class ModelSafetyValve extends ModelBase implements IBaseModel{
// fields
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
public ModelSafetyValve(){
textureWidth = 64;
textureHeight = 32;
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 3, 3, 2);
Shape1.setRotationPoint(-1.5F, 14.5F, 2F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 0, 0);
Shape2.addBox(0F, 0F, 0F, 2, 2, 3);
Shape2.setRotationPoint(-1F, 15F, 4F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 0, 0);
Shape3.addBox(0F, 0F, 0F, 1, 1, 3);
Shape3.setRotationPoint(2F, 15.5F, 4F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, -0.5934119F, 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);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
}
public void renderModel(float size){
Shape1.render(size);
Shape2.render(size);
Shape3.render(size);
}
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 tile){
renderModel(size);
}
@Override
public ResourceLocation getModelTexture(TileEntity tile){
return Textures.MODEL_GREY_TEXTURE;
}
@Override
public boolean rotateModelBasedOnBlockMeta(){
return false;
}
@Override
public void renderDynamic(float size, TileEntity te, float partialTicks){
// TODO Auto-generated method stub
}
}