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;

/**
 * LegsJade - Cleric_red
 * Created using Tabula 4.1.1
 */
public class ModelBodyJade extends LOTRModelBiped {
    public ModelRenderer lpad;
    public ModelRenderer lribbon;
    public ModelRenderer neck3;
    public ModelRenderer neck2;
    public ModelRenderer neck1;
    public ModelRenderer rpad;
    public ModelRenderer rribbon;

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

        this.neck1 = new ModelRenderer(this, 13, 0);
        this.neck1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.neck1.addBox(-3.7F, -2.1F, -3.4F, 3, 3, 1, 0.0F);
        this.setRotateAngle(neck1, 0.5009094953223726F, 0.22759093446006054F, 0.0F);

        this.lpad = new ModelRenderer(this, 16, 0);
        this.lpad.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.lpad.addBox(3.5F, -4.5F, -2.5F, 1, 7, 5, 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.rribbon = new ModelRenderer(this, 16, 7);
        this.rribbon.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rribbon.addBox(-4F, 2.5F, -2.5F, 0, 2, 5, 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.5F);
        this.setRotateAngle(bipedRightArm, 4.371139006309477E-9F, 0.0F, -0.02639634720981121F);

        this.neck2 = new ModelRenderer(this, 13, 0);
        this.neck2.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.neck2.addBox(0.7F, -2.1F, -3.4F, 3, 3, 1, 0.0F);
        this.setRotateAngle(neck2, 0.5009094953223726F, -0.22759093446006054F, 0.0F);

        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.5F);
        this.setRotateAngle(bipedLeftArm, -4.371139006309477E-9F, 0.0F, 0.02639634720981121F);

        this.lribbon = new ModelRenderer(this, 16, 7);
        this.lribbon.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.lribbon.addBox(4F, 2.5F, -2.5F, 0, 2, 5, 0.0F);
        this.rpad = new ModelRenderer(this, 16, 0);
        this.rpad.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rpad.addBox(-4.5F, -4.5F, -2.5F, 1, 7, 5, 0.0F);

        this.neck3 = new ModelRenderer(this, 13, 0);
        this.neck3.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.neck3.addBox(-1.5F, -2.0F, -3.2F, 3, 3, 1, 0.0F);
        this.setRotateAngle(neck3, 0.5009094953223726F, 0.0F, 0.0F);
        this.bipedBody.addChild(this.neck1);
        this.bipedLeftArm.addChild(this.lpad);
        this.bipedRightArm.addChild(this.rribbon);
        this.bipedBody.addChild(this.neck2);
        this.bipedLeftArm.addChild(this.lribbon);
        this.bipedRightArm.addChild(this.rpad);
        this.bipedBody.addChild(this.neck3);

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