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 ModelLegsJade extends LOTRModelBiped {
    public ModelRenderer rarmor;
    public ModelRenderer rftrim;
    public ModelRenderer rbtrim;
    public ModelRenderer larmor;
    public ModelRenderer lftrim;
    public ModelRenderer lbtrim;

    public ModelLegsJade(float f) {
        super(f);
        this.textureWidth = 64;
        this.textureHeight = 32;
        this.bipedRightLeg.cubeList.clear();
        this.bipedLeftLeg.cubeList.clear();

        this.lftrim = new ModelRenderer(this, 2, 24);
        this.lftrim.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.lftrim.addBox(-2.0F, 0.1F, -3.1F, 4, 1, 1, 0.0F);

        this.bipedRightLeg = new ModelRenderer(this, 0, 16);
        this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
        this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.5F);

        this.rbtrim = new ModelRenderer(this, 1, 21);
        this.rbtrim.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rbtrim.addBox(-2.0F, 0.1F, 2.1F, 4, 1, 1, 0.0F);

        this.larmor = new ModelRenderer(this, -1, 0);
        this.larmor.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.larmor.addBox(1.0F, 1.0F, -3F, 4, 1, 6, 0.0F);
        this.setRotateAngle(larmor, 0.0F, 0.0F, 2.0943951023931953F);

        this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
        this.bipedLeftLeg.mirror = true;
        this.bipedLeftLeg.setRotationPoint(1.899999976158142F, 12.0F, 0.0F);
        this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.5F);

        this.lbtrim = new ModelRenderer(this, 3, 21);
        this.lbtrim.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.lbtrim.addBox(-2.0F, 0.1F, 2.1F, 4, 1, 1, 0.0F);

        this.rarmor = new ModelRenderer(this, -1, 0);
        this.rarmor.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rarmor.addBox(1.0F, -2.0F, -3F, 4, 1, 6, 0.0F);
        this.setRotateAngle(rarmor, 0.0F, 0.0F, 1.0471975511965976F);

        this.rftrim = new ModelRenderer(this, 3, 24);
        this.rftrim.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.rftrim.addBox(-2.0F, 0.1F, -3.1F, 4, 1, 1, 0.0F);

        this.bipedRightLeg.addChild(this.lftrim);
        this.bipedLeftLeg.addChild(this.rbtrim);
        this.bipedRightLeg.addChild(this.larmor);
        this.bipedRightLeg.addChild(this.lbtrim);
        this.bipedLeftLeg.addChild(this.rarmor);
        this.bipedLeftLeg.addChild(this.rftrim);
        this.bipedHead.cubeList.clear();
        this.bipedHeadwear.cubeList.clear();
        this.bipedBody.cubeList.clear();
        this.bipedRightArm.cubeList.clear();
        this.bipedLeftArm.cubeList.clear();
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { 
        this.bipedRightLeg.render(f5);
        this.bipedLeftLeg.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;
    }
}
