package com.zivilon.cinder_loe.client.model;

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

/**
 * Black serpent Chestpiece - cleric_red
 * Created using Tabula 4.1.1
 */
public class ModelBodySerpent extends LOTRModelBiped {
    public ModelRenderer sash;
    public ModelRenderer Quiver;
    public ModelRenderer Arrows1;
    public ModelRenderer Arrows1_1;
    public ModelRenderer Arrows1_2;
    public ModelRenderer Arrows1_3;

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

        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.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.Arrows1_1 = new ModelRenderer(this, 6, 20);
        this.Arrows1_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arrows1_1.addBox(-6.0F, -7.0F, 3.7F, 4, 3, 0, 0.0F);
        this.Arrows1_3 = new ModelRenderer(this, 8, 23);
        this.Arrows1_3.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arrows1_3.addBox(-2.5F, -7.0F, 1.2F, 0, 3, 3, 0.0F);
        this.Quiver = new ModelRenderer(this, 33, 0);
        this.Quiver.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Quiver.addBox(-6.0F, -4.0F, 2.0F, 4, 12, 3, 0.0F);
        this.setRotateAngle(Quiver, 0.0F, 0.0F, -0.5138249317871306F);
        this.Arrows1_2 = new ModelRenderer(this, 8, 23);
        this.Arrows1_2.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arrows1_2.addBox(-4.5F, -7.0F, 2.0F, 0, 3, 3, 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.sash = new ModelRenderer(this, 16, 3);
        this.sash.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.sash.addBox(-4.0F, 0.0F, -2.7F, 8, 12, 0, 0.0F);
        this.Arrows1 = new ModelRenderer(this, 6, 20);
        this.Arrows1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arrows1.addBox(-4.0F, -7.0F, 2.8F, 4, 3, 0, 0.0F);
        this.Arrows1.addChild(this.Arrows1_1);
        this.Arrows1_2.addChild(this.Arrows1_3);
        this.sash.addChild(this.Quiver);
        this.Arrows1_1.addChild(this.Arrows1_2);
        this.bipedBody.addChild(this.sash);
        this.Quiver.addChild(this.Arrows1);

        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;
    }
}
