package net.minecraft.client.model;

import net.minecraft.util.Mth;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.world.entity.Entity;

public class WitchModel<T extends Entity> extends VillagerModel<T> {
    private boolean holdingItem;
    private final ModelPart mole;
    
    public WitchModel(final float float1) {
        super(float1, 64, 128);
        (this.mole = new ModelPart(this).setTexSize(64, 128)).setPos(0.0f, -2.0f, 0.0f);
        this.mole.texOffs(0, 0).addBox(0.0f, 3.0f, -6.75f, 1.0f, 1.0f, 1.0f, -0.25f);
        this.nose.addChild(this.mole);
        (this.head = new ModelPart(this).setTexSize(64, 128)).setPos(0.0f, 0.0f, 0.0f);
        this.head.texOffs(0, 0).addBox(-4.0f, -10.0f, -4.0f, 8.0f, 10.0f, 8.0f, float1);
        (this.hat = new ModelPart(this).setTexSize(64, 128)).setPos(-5.0f, -10.03125f, -5.0f);
        this.hat.texOffs(0, 64).addBox(0.0f, 0.0f, 0.0f, 10.0f, 2.0f, 10.0f);
        this.head.addChild(this.hat);
        this.head.addChild(this.nose);
        final ModelPart dyg3 = new ModelPart(this).setTexSize(64, 128);
        dyg3.setPos(1.75f, -4.0f, 2.0f);
        dyg3.texOffs(0, 76).addBox(0.0f, 0.0f, 0.0f, 7.0f, 4.0f, 7.0f);
        dyg3.xRot = -0.05235988f;
        dyg3.zRot = 0.02617994f;
        this.hat.addChild(dyg3);
        final ModelPart dyg4 = new ModelPart(this).setTexSize(64, 128);
        dyg4.setPos(1.75f, -4.0f, 2.0f);
        dyg4.texOffs(0, 87).addBox(0.0f, 0.0f, 0.0f, 4.0f, 4.0f, 4.0f);
        dyg4.xRot = -0.10471976f;
        dyg4.zRot = 0.05235988f;
        dyg3.addChild(dyg4);
        final ModelPart dyg5 = new ModelPart(this).setTexSize(64, 128);
        dyg5.setPos(1.75f, -2.0f, 2.0f);
        dyg5.texOffs(0, 95).addBox(0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 1.0f, 0.25f);
        dyg5.xRot = -0.20943952f;
        dyg5.zRot = 0.10471976f;
        dyg4.addChild(dyg5);
    }
    
    @Override
    public void setupAnim(final T aom, final float float2, final float float3, final float float4, final float float5, final float float6) {
        super.setupAnim(aom, float2, float3, float4, float5, float6);
        this.nose.setPos(0.0f, -2.0f, 0.0f);
        final float float7 = 0.01f * (aom.getId() % 10);
        this.nose.xRot = Mth.sin(aom.tickCount * float7) * 4.5f * 0.017453292f;
        this.nose.yRot = 0.0f;
        this.nose.zRot = Mth.cos(aom.tickCount * float7) * 2.5f * 0.017453292f;
        if (this.holdingItem) {
            this.nose.setPos(0.0f, 1.0f, -1.5f);
            this.nose.xRot = -0.9f;
        }
    }
    
    public ModelPart getNose() {
        return this.nose;
    }
    
    public void setHoldingItem(final boolean boolean1) {
        this.holdingItem = boolean1;
    }
}
