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

import net.minecraft.world.entity.Entity;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.DyeColor;
import net.minecraft.client.model.geom.ModelPart;
import com.mojang.math.Quaternion;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.ShulkerRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.model.ShulkerModel;
import net.minecraft.world.entity.monster.Shulker;

public class ShulkerHeadLayer extends RenderLayer<Shulker, ShulkerModel<Shulker>> {
    public ShulkerHeadLayer(final RenderLayerParent<Shulker, ShulkerModel<Shulker>> dwv) {
        super(dwv);
    }
    
    @Override
    public void render(final PoseStack cyl, final MultiBufferSource dqt, final int integer, final Shulker axe, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        cyl.pushPose();
        cyl.translate(0.0, 1.0, 0.0);
        cyl.scale(-1.0f, -1.0f, 1.0f);
        final Quaternion c12 = axe.getAttachFace().getOpposite().getRotation();
        c12.conj();
        cyl.mulPose(c12);
        cyl.scale(-1.0f, -1.0f, 1.0f);
        cyl.translate(0.0, -1.0, 0.0);
        final ModelPart dni13 = ((RenderLayer<T, ShulkerModel>)this).getParentModel().getHead();
        dni13.yRot = float9 * 0.017453292f;
        dni13.xRot = float10 * 0.017453292f;
        final DyeColor bdj14 = axe.getColor();
        ResourceLocation sm15;
        if (bdj14 == null) {
            sm15 = ShulkerRenderer.DEFAULT_TEXTURE_LOCATION;
        }
        else {
            sm15 = ShulkerRenderer.TEXTURE_LOCATION[bdj14.getId()];
        }
        final VertexConsumer cyo16 = dqt.getBuffer(RenderType.entitySolid(sm15));
        dni13.render(cyl, cyo16, integer, LivingEntityRenderer.getOverlayCoords(axe, 0.0f));
        cyl.popPose();
    }
}
