package com.zivilon.cinder_loe.client.model;

import lotr.client.model.LOTRModelBiped;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;


public class ModelRhudaurHelmet extends LOTRModelBiped {
    public ModelRenderer backhelm;
    public ModelRenderer topfur;
    public ModelRenderer righthelm;
    public ModelRenderer fronthelm;
    public ModelRenderer lefthelm;
    public ModelRenderer rightfur;
    public ModelRenderer leftfur;
    public ModelRenderer Middlefur;
    public ModelRenderer backfur;

    public ModelRhudaurHelmet(float f) {
        super(f);
        this.textureWidth = 64;
        this.textureHeight = 32;
        this.Middlefur = new ModelRenderer(this, 24, 11);
        this.Middlefur.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Middlefur.addBox(-4.0F, -8.0F, -4.1F, 8, 1, 0, 1.3F);
        this.lefthelm = new ModelRenderer(this, 0, 0);
        this.lefthelm.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.lefthelm.addBox(4.0F, -5.85F, -5.5F, 1, 2, 9, 0.6F);
        this.setRotateAngle(lefthelm, -0.22759093446006054F, 0.0F, 0.0F);
        this.fronthelm = new ModelRenderer(this, 0, 0);
        this.fronthelm.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.fronthelm.addBox(-5.0F, -5.85F, -6.5F, 10, 2, 1, 0.6F);
        this.setRotateAngle(fronthelm, -0.22759093446006054F, 0.0F, 0.0F);
        this.backhelm = new ModelRenderer(this, 0, 0);
        this.backhelm.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.backhelm.addBox(-5.0F, -5.0F, 3.9F, 10, 2, 1, 0.6F);
        this.rightfur = new ModelRenderer(this, 32, 11);
        this.rightfur.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rightfur.addBox(-4.1F, -8.2F, -4.0F, 0, 3, 8, 1.3F);
        this.righthelm = new ModelRenderer(this, 0, 0);
        this.righthelm.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.righthelm.addBox(-5.0F, -5.85F, -5.5F, 1, 2, 9, 0.6F);
        this.setRotateAngle(righthelm, -0.22759093446006054F, 0.0F, 0.0F);
        this.backfur = new ModelRenderer(this, 24, 11);
        this.backfur.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.backfur.addBox(-4.0F, -8.0F, 4.1F, 8, 3, 0, 1.3F);
        this.leftfur = new ModelRenderer(this, 32, 11);
        this.leftfur.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.leftfur.addBox(4.1F, -8.2F, -4.0F, 0, 3, 8, 1.3F);
        this.topfur = new ModelRenderer(this, 16, 11);
        this.topfur.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.topfur.addBox(-4.0F, -8.2F, -4.0F, 8, 0, 8, 1.3F);

        this.bipedHead.cubeList.clear();

        this.bipedHead = new ModelRenderer(this, 0, 11);
        this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 1.0F);

        this.bipedHead.addChild(this.Middlefur);
        this.bipedHead.addChild(this.lefthelm);
        this.bipedHead.addChild(this.fronthelm);
        this.bipedHead.addChild(this.backhelm);
        this.bipedHead.addChild(this.rightfur);
        this.bipedHead.addChild(this.righthelm);
        this.bipedHead.addChild(this.backfur);
        this.bipedHead.addChild(this.leftfur);
        this.bipedHead.addChild(this.topfur);

        // Clear unnecessary parts
        this.bipedHeadwear.cubeList.clear();
        this.bipedBody.cubeList.clear();
        this.bipedRightArm.cubeList.clear();
        this.bipedLeftArm.cubeList.clear();
        this.bipedRightLeg.cubeList.clear();
        this.bipedLeftLeg.cubeList.clear();
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { 
        this.bipedHead.render(f5);
    }

    /**
     * This is a helper function from Tabula to set the rotation of model parts
     */
    public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}
