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

import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
import com.mojang.math.Vector3f;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.model.CowModel;
import net.minecraft.world.entity.animal.MushroomCow;

public class MushroomCowMushroomLayer<T extends MushroomCow> extends RenderLayer<T, CowModel<T>> {
    public MushroomCowMushroomLayer(final RenderLayerParent<T, CowModel<T>> eid) {
        super(eid);
    }
    
    @Override
    public void render(final PoseStack dhl, final MultiBufferSource ebz, final int integer, final T ayu, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        if (ayu.isBaby() || ayu.isInvisible()) {
            return;
        }
        final BlockRenderDispatcher ecq12 = Minecraft.getInstance().getBlockRenderer();
        final BlockState cfj13 = ayu.getMushroomType().getBlockState();
        final int integer2 = LivingEntityRenderer.getOverlayCoords(ayu, 0.0f);
        dhl.pushPose();
        dhl.translate(0.20000000298023224, -0.3499999940395355, 0.5);
        dhl.mulPose(Vector3f.YP.rotationDegrees(-48.0f));
        dhl.scale(-1.0f, -1.0f, 1.0f);
        dhl.translate(-0.5, -0.5, -0.5);
        ecq12.renderSingleBlock(cfj13, dhl, ebz, integer, integer2);
        dhl.popPose();
        dhl.pushPose();
        dhl.translate(0.20000000298023224, -0.3499999940395355, 0.5);
        dhl.mulPose(Vector3f.YP.rotationDegrees(42.0f));
        dhl.translate(0.10000000149011612, 0.0, -0.6000000238418579);
        dhl.mulPose(Vector3f.YP.rotationDegrees(-48.0f));
        dhl.scale(-1.0f, -1.0f, 1.0f);
        dhl.translate(-0.5, -0.5, -0.5);
        ecq12.renderSingleBlock(cfj13, dhl, ebz, integer, integer2);
        dhl.popPose();
        dhl.pushPose();
        this.getParentModel().getHead().translateAndRotate(dhl);
        dhl.translate(0.0, -0.699999988079071, -0.20000000298023224);
        dhl.mulPose(Vector3f.YP.rotationDegrees(-78.0f));
        dhl.scale(-1.0f, -1.0f, 1.0f);
        dhl.translate(-0.5, -0.5, -0.5);
        ecq12.renderSingleBlock(cfj13, dhl, ebz, integer, integer2);
        dhl.popPose();
    }
}
