package net.minecraft.client.renderer.entity;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.monster.piglin.Piglin;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.model.PiglinModel;
import net.minecraft.world.entity.Mob;

public class PiglinRenderer extends HumanoidMobRenderer<Mob, PiglinModel<Mob>> {
    private static final ResourceLocation PIGLIN_LOCATION;
    private static final ResourceLocation ZOMBIFIED_PIGLIN_LOCATION;
    
    public PiglinRenderer(final EntityRenderDispatcher egm, final boolean boolean2) {
        super(egm, createModel(boolean2), 0.5f, 1.0019531f, 1.0f, 1.0019531f);
        this.addLayer((RenderLayer<Mob, PiglinModel<Mob>>)new HumanoidArmorLayer((RenderLayerParent<LivingEntity, HumanoidModel>)this, new HumanoidModel(0.5f), new HumanoidModel(1.02f)));
    }
    
    private static PiglinModel<Mob> createModel(final boolean boolean1) {
        final PiglinModel<Mob> dwv2 = new PiglinModel<Mob>(0.0f, 64, 64);
        if (boolean1) {
            dwv2.earLeft.visible = false;
        }
        return dwv2;
    }
    
    @Override
    public ResourceLocation getTextureLocation(final Mob aoz) {
        return (aoz instanceof Piglin) ? PiglinRenderer.PIGLIN_LOCATION : PiglinRenderer.ZOMBIFIED_PIGLIN_LOCATION;
    }
    
    @Override
    protected boolean isShaking(final Mob aoz) {
        return aoz instanceof Piglin && ((Piglin)aoz).isConverting();
    }
    
    static {
        PIGLIN_LOCATION = new ResourceLocation("textures/entity/piglin/piglin.png");
        ZOMBIFIED_PIGLIN_LOCATION = new ResourceLocation("textures/entity/piglin/zombified_piglin.png");
    }
}
