package net.minecraft.client.renderer.entity;

import net.minecraft.world.entity.Entity;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.model.LeashKnotModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.decoration.LeashFenceKnotEntity;

public class LeashKnotRenderer extends EntityRenderer<LeashFenceKnotEntity> {
    private static final ResourceLocation KNOT_LOCATION;
    private final LeashKnotModel<LeashFenceKnotEntity> model;
    
    public LeashKnotRenderer(final EntityRenderDispatcher egm) {
        super(egm);
        this.model = new LeashKnotModel<LeashFenceKnotEntity>();
    }
    
    @Override
    public void render(final LeashFenceKnotEntity bbb, final float float2, final float float3, final PoseStack dhl, final MultiBufferSource ebz, final int integer) {
        dhl.pushPose();
        dhl.scale(-1.0f, -1.0f, 1.0f);
        this.model.setupAnim(bbb, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
        final VertexConsumer dhp8 = ebz.getBuffer(this.model.renderType(LeashKnotRenderer.KNOT_LOCATION));
        this.model.renderToBuffer(dhl, dhp8, integer, OverlayTexture.NO_OVERLAY, 1.0f, 1.0f, 1.0f, 1.0f);
        dhl.popPose();
        super.render(bbb, float2, float3, dhl, ebz, integer);
    }
    
    @Override
    public ResourceLocation getTextureLocation(final LeashFenceKnotEntity bbb) {
        return LeashKnotRenderer.KNOT_LOCATION;
    }
    
    static {
        KNOT_LOCATION = new ResourceLocation("textures/entity/lead_knot.png");
    }
}
