package armorModel;
import java.util.ArrayList;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
public class ModelHelmet extends ModelBiped
{
//fields
ModelRenderer head1;
ModelRenderer head2;
ModelRenderer head3;
ModelRenderer head4;
ModelRenderer head5;
ModelRenderer head6;
ModelRenderer head7;
ModelRenderer head8;
ModelRenderer head9;
ModelRenderer head10;
ModelRenderer head11;
private ArrayList<ModelRenderer> modelList = new ArrayList<ModelRenderer>();
{
modelList.add(head1);
modelList.add(head2);
modelList.add(head3);
modelList.add(head4);
modelList.add(head5);
modelList.add(head6);
modelList.add(head7);
modelList.add(head8);
modelList.add(head9);
modelList.add(head10);
modelList.add(head11);
}
public ModelHelmet()
{
super.textureWidth = 256;
super.textureHeight = 64;
this.head1 = new ModelRenderer(this, 34, 22);
this.head1.addBox(-5F, -8.5F, -5F, 10, 7, 10);
this.head1.setRotationPoint(0F, 0F, 0F);
this.head1.setTextureSize(256, 64);
this.head1.mirror = true;
this.setRotation(head1, 0F, 0F, 0F);
this.head2 = new ModelRenderer(this, 74, 12);
this.head2.addBox(-4.5F, -9.5F, -4.5F, 9, 2, 9);
this.head2.setRotationPoint(0F, 0F, 0F);
this.head2.setTextureSize(256, 64);
this.head2.mirror = true;
this.setRotation(head2, 0F, 0F, 0F);
this.head3 = new ModelRenderer(this, 112, 9);
this.head3.addBox(3.7F, -5.7F, 5.1F, 1, 2, 7);
this.head3.setRotationPoint(0F, 0F, 0F);
this.head3.setTextureSize(256, 64);
this.head3.mirror = true;
this.setRotation(head3, 0.9098432F, 0.2117115F, 0.1418984F);
this.head4 = new ModelRenderer(this, 122, 32);
this.head4.addBox(-1F, -14F, -5.5F, 2, 13, 1);
this.head4.setRotationPoint(0F, 0F, 0F);
this.head4.setTextureSize(256, 64);
this.head4.mirror = true;
this.setRotation(head4, 0F, 0F, 0F);
this.head5 = new ModelRenderer(this, 102, 5);
this.head5.addBox(3F, -5.2F, 7F, 1, 1, 4);
this.head5.setRotationPoint(0F, 0F, 0F);
this.head5.setTextureSize(256, 64);
this.head5.mirror = true;
this.setRotation(head5, 1.22173F, 0.1373543F, 0.2010743F);
this.head6 = new ModelRenderer(this, 112, 0);
this.head6.addBox(-4.6F, -6.5F, 4.5F, 1, 2, 7);
this.head6.setRotationPoint(0F, 0F, 0F);
this.head6.setTextureSize(256, 64);
this.head6.mirror = true;
this.setRotation(head6, 0.8726646F, -0.1745329F, -0.1745329F);
this.head7 = new ModelRenderer(this, 102, 0);
this.head7.addBox(-4.5F, -5F, 7F, 1, 1, 4);
this.head7.setRotationPoint(0F, 0F, 0F);
this.head7.setTextureSize(256, 64);
this.head7.mirror = true;
this.setRotation(head7, 1.256637F, -0.1396263F, -0.1570796F);
this.head8 = new ModelRenderer(this, 92, 23);
this.head8.addBox(-1F, -4F, 8F, 2, 2, 3);
this.head8.setRotationPoint(0F, 0F, 0F);
this.head8.setTextureSize(256, 64);
this.head8.mirror = true;
this.setRotation(head8, 0.7853982F, 0F, 0F);
this.head9 = new ModelRenderer(this, 74, 23);
this.head9.addBox(-2F, -5F, 11F, 4, 4, 4);
this.head9.setRotationPoint(0F, 0F, 0F);
this.head9.setTextureSize(256, 64);
this.head9.mirror = true;
this.setRotation(head9, 0.7853982F, 0F, 0F);
this.head10 = new ModelRenderer(this, 74, 31);
this.head10.addBox(-1.5F, -8.7F, 9F, 3, 5, 3);
this.head10.setRotationPoint(0F, 0F, 0F);
this.head10.setTextureSize(256, 64);
this.head10.mirror = true;
this.setRotation(head10, 0.2230717F, 0F, 0F);
this.head11 = new ModelRenderer(this, 26, 40);
this.head11.addBox(-1F, -6.7F, 8F, 2, 5, 2);
this.head11.setRotationPoint(0F, 0F, 0F);
this.head11.setTextureSize(256, 64);
this.head11.mirror = true;
this.setRotation(head11, 0F, 0F, 0F);
}
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);
if(entity instanceof EntityPlayer) {
EntityPlayer ep = (EntityPlayer)entity;
if(ep.isSneaking() && !ep.isInWater()) {
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 0.1F, 0.0F);
GL11.glRotatef(25.0F, 1.0F, 0.0F, 0.0F);
GL11.glPopMatrix();
}
}
head1.render(f5);
head2.render(f5);
head3.render(f5);
head4.render(f5);
head5.render(f5);
head6.render(f5);
head7.render(f5);
head8.render(f5);
head9.render(f5);
head10.render(f5);
head11.render(f5);
}
public void render(float f5) {
this.head1.render(f5);
this.head2.render(f5);
this.head3.render(f5);
this.head4.render(f5);
this.head5.render(f5);
this.head6.render(f5);
this.head7.render(f5);
this.head8.render(f5);
this.head9.render(f5);
this.head10.render(f5);
this.head11.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}