package com.zivilon.cinder_loe.client.model;

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

public class ModelNexToxinChestplate extends LOTRModelBiped {

    public ModelRenderer upperrightarm;
    public ModelRenderer upperleftarm;
    public ModelRenderer banner;
    public ModelRenderer hood;
    public ModelRenderer rightribbon;
    public ModelRenderer leftribbon;

    public ModelNexToxinChestplate(float f) {
        super (f);
        this.textureWidth = 64;
        this.textureHeight = 32;
        this.bipedBody.cubeList.clear();
        this.bipedRightArm.cubeList.clear();
        this.bipedLeftArm.cubeList.clear();

        this.banner = new ModelRenderer(this, 0, 17);
        this.banner.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.banner.addBox(-4.0F, 0.0F, -2.7F, 8, 15, 0, 0.0F);
        this.bipedRightArm = new ModelRenderer(this, 40, 16);
        this.bipedRightArm.mirror = true;
        this.bipedRightArm.setRotationPoint(5.0F, 2.0F, 0.0F);
        this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F);
        this.setRotateAngle(bipedRightArm, 0.0F, 0.0F, -0.026354471705114374F);
        this.bipedLeftArm = new ModelRenderer(this, 40, 16);
        this.bipedLeftArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
        this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F);
        this.setRotateAngle(bipedLeftArm, 0.0F, 0.0F, 0.026354471705114374F);
        this.hood = new ModelRenderer(this, 0, 0);
        this.hood.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.hood.addBox(-5.4F, 0.0F, 0.7F, 11, 4, 7, 0.0F);
        this.setRotateAngle(hood, 0.5009094953223726F, 0.0F, 0.0F);
        this.rightribbon = new ModelRenderer(this, 57, 17);
        this.rightribbon.mirror = true;
        this.rightribbon.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rightribbon.addBox(-4.0F, -0.8F, 8.3F, 3, 15, 0, 0.0F);
        this.leftribbon = new ModelRenderer(this, 57, 17);
        this.leftribbon.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.leftribbon.addBox(1.0F, -0.8F, 8.3F, 3, 15, 0, 0.0F);
        this.bipedBody = new ModelRenderer(this, 16, 16);
        this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.5F);
        this.upperleftarm = new ModelRenderer(this, 40, 16);
        this.upperleftarm.mirror = true;
        this.upperleftarm.setRotationPoint(5.0F, 2.0F, 0.0F);
        this.upperleftarm.addBox(-6.0F, -4.0F, -2.0F, 4, 7, 4, 0.5F);
        this.setRotateAngle(upperleftarm, 0.0F, 0.0F, -0.026354471705114374F);
        this.upperrightarm = new ModelRenderer(this, 40, 16);
        this.upperrightarm.setRotationPoint(-5.0F, 2.0F, 0.0F);
        this.upperrightarm.addBox(2.0F, -4.0F, -2.0F, 4, 7, 4, 0.5F);
        this.setRotateAngle(upperrightarm, 0.0F, 0.0F, 0.026354471705114374F);
        this.bipedRightArm.addChild(this.upperrightarm);
        this.bipedLeftArm.addChild(this.upperleftarm);
        this.bipedBody.addChild(this.banner);
        this.bipedBody.addChild(this.hood);
        this.bipedBody.addChild(this.rightribbon);
        this.bipedBody.addChild(this.leftribbon);

        this.bipedHead.cubeList.clear();
        this.bipedHeadwear.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.bipedRightArm.render(f5);
        this.bipedLeftArm.render(f5);
        this.bipedBody.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;
    }
}
