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 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>> eid) {
        super(eid);
    }
    
    @Override
    public void render(final PoseStack dhl, final MultiBufferSource ebz, final int integer, final Shulker bch, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        dhl.pushPose();
        dhl.translate(0.0, 1.0, 0.0);
        dhl.scale(-1.0f, -1.0f, 1.0f);
        final Quaternion d12 = bch.getAttachFace().getOpposite().getRotation();
        d12.conj();
        dhl.mulPose(d12);
        dhl.scale(-1.0f, -1.0f, 1.0f);
        dhl.translate(0.0, -1.0, 0.0);
        final DyeColor bje13 = bch.getColor();
        final ResourceLocation uh14 = (bje13 == null) ? ShulkerRenderer.DEFAULT_TEXTURE_LOCATION : ShulkerRenderer.TEXTURE_LOCATION[bje13.getId()];
        final VertexConsumer dhp15 = ebz.getBuffer(RenderType.entitySolid(uh14));
        ((RenderLayer<T, ShulkerModel>)this).getParentModel().getHead().render(dhl, dhp15, integer, LivingEntityRenderer.getOverlayCoords(bch, 0.0f));
        dhl.popPose();
    }
}
