package net.minecraft.client.renderer.entity.layers;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import com.mojang.math.Vector3f;
import net.minecraft.world.item.Items;
import net.minecraft.client.renderer.MultiBufferSource;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.model.WitchModel;
import net.minecraft.world.entity.LivingEntity;

public class WitchItemLayer<T extends LivingEntity> extends CrossedArmsItemLayer<T, WitchModel<T>> {
    public WitchItemLayer(final RenderLayerParent<T, WitchModel<T>> eid) {
        super(eid);
    }
    
    @Override
    public void render(final PoseStack dhl, final MultiBufferSource ebz, final int integer, final T aoy, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        final ItemStack bki12 = aoy.getMainHandItem();
        dhl.pushPose();
        if (bki12.getItem() == Items.POTION) {
            this.getParentModel().getHead().translateAndRotate(dhl);
            this.getParentModel().getNose().translateAndRotate(dhl);
            dhl.translate(0.0625, 0.25, 0.0);
            dhl.mulPose(Vector3f.ZP.rotationDegrees(180.0f));
            dhl.mulPose(Vector3f.XP.rotationDegrees(140.0f));
            dhl.mulPose(Vector3f.ZP.rotationDegrees(10.0f));
            dhl.translate(0.0, -0.4000000059604645, 0.4000000059604645);
        }
        super.render(dhl, ebz, integer, aoy, float5, float6, float7, float8, float9, float10);
        dhl.popPose();
    }
}
