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

import net.minecraft.world.entity.Entity;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.client.Minecraft;
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.IronGolemModel;
import net.minecraft.world.entity.animal.IronGolem;

public class IronGolemFlowerLayer extends RenderLayer<IronGolem, IronGolemModel<IronGolem>> {
    public IronGolemFlowerLayer(final RenderLayerParent<IronGolem, IronGolemModel<IronGolem>> eid) {
        super(eid);
    }
    
    @Override
    public void render(final PoseStack dhl, final MultiBufferSource ebz, final int integer, final IronGolem ayt, final float float5, final float float6, final float float7, final float float8, final float float9, final float float10) {
        if (ayt.getOfferFlowerTick() == 0) {
            return;
        }
        dhl.pushPose();
        final ModelPart dyg12 = ((RenderLayer<T, IronGolemModel>)this).getParentModel().getFlowerHoldingArm();
        dyg12.translateAndRotate(dhl);
        dhl.translate(-1.1875, 1.0625, -0.9375);
        dhl.translate(0.5, 0.5, 0.5);
        final float float11 = 0.5f;
        dhl.scale(0.5f, 0.5f, 0.5f);
        dhl.mulPose(Vector3f.XP.rotationDegrees(-90.0f));
        dhl.translate(-0.5, -0.5, -0.5);
        Minecraft.getInstance().getBlockRenderer().renderSingleBlock(Blocks.POPPY.defaultBlockState(), dhl, ebz, integer, OverlayTexture.NO_OVERLAY);
        dhl.popPose();
    }
}
