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

import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.Minecraft;
import net.minecraft.world.entity.EquipmentSlot;
import com.mojang.math.Vector3f;
import net.minecraft.client.renderer.MultiBufferSource;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.model.FoxModel;
import net.minecraft.world.entity.animal.Fox;

public class FoxHeldItemLayer extends RenderLayer<Fox, FoxModel<Fox>> {
    public FoxHeldItemLayer(final RenderLayerParent<Fox, FoxModel<Fox>> dwv) {
        super(dwv);
    }
    
    @Override
    public void render(final PoseStack cyl, final MultiBufferSource dqt, final int integer, final Fox atk, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        final boolean boolean12 = atk.isSleeping();
        final boolean boolean13 = atk.isBaby();
        cyl.pushPose();
        if (boolean13) {
            final float float11 = 0.75f;
            cyl.scale(0.75f, 0.75f, 0.75f);
            cyl.translate(0.0, 0.5, 0.20937499403953552);
        }
        cyl.translate(((RenderLayer<T, FoxModel>)this).getParentModel().head.x / 16.0f, ((RenderLayer<T, FoxModel>)this).getParentModel().head.y / 16.0f, ((RenderLayer<T, FoxModel>)this).getParentModel().head.z / 16.0f);
        final float float11 = atk.getHeadRollAngle(float7);
        cyl.mulPose(Vector3f.ZP.rotation(float11));
        cyl.mulPose(Vector3f.YP.rotationDegrees(float9));
        cyl.mulPose(Vector3f.XP.rotationDegrees(float10));
        if (atk.isBaby()) {
            if (boolean12) {
                cyl.translate(0.4000000059604645, 0.25999999046325684, 0.15000000596046448);
            }
            else {
                cyl.translate(0.05999999865889549, 0.25999999046325684, -0.5);
            }
        }
        else if (boolean12) {
            cyl.translate(0.46000000834465027, 0.25999999046325684, 0.2199999988079071);
        }
        else {
            cyl.translate(0.05999999865889549, 0.27000001072883606, -0.5);
        }
        cyl.mulPose(Vector3f.XP.rotationDegrees(90.0f));
        if (boolean12) {
            cyl.mulPose(Vector3f.ZP.rotationDegrees(90.0f));
        }
        final ItemStack ben15 = atk.getItemBySlot(EquipmentSlot.MAINHAND);
        Minecraft.getInstance().getItemInHandRenderer().renderItem(atk, ben15, ItemTransforms.TransformType.GROUND, false, cyl, dqt, integer);
        cyl.popPose();
    }
}
