package net.minecraft.client.renderer.entity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.AbstractEquineModel; import net.minecraft.client.model.HorseModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.renderer.entity.state.EquineRenderState; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.animal.horse.AbstractHorse; @Environment(EnvType.CLIENT) public class UndeadHorseRenderer extends AbstractHorseRenderer> { private static final ResourceLocation ZOMBIE_TEXTURE = ResourceLocation.withDefaultNamespace("textures/entity/horse/horse_zombie.png"); private static final ResourceLocation SKELETON_TEXTURE = ResourceLocation.withDefaultNamespace("textures/entity/horse/horse_skeleton.png"); private final ResourceLocation texture; public UndeadHorseRenderer( EntityRendererProvider.Context context, ModelLayerLocation adultModelLayer, ModelLayerLocation babyModelLayer, boolean skeletonHorse ) { super(context, new HorseModel(context.bakeLayer(adultModelLayer)), new HorseModel(context.bakeLayer(babyModelLayer))); this.texture = skeletonHorse ? SKELETON_TEXTURE : ZOMBIE_TEXTURE; } public ResourceLocation getTextureLocation(EquineRenderState equineRenderState) { return this.texture; } public EquineRenderState createRenderState() { return new EquineRenderState(); } }