package net.minecraft.client.renderer.entity; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import java.util.Map; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.HorseModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.animal.horse.AbstractHorse; @Environment(EnvType.CLIENT) public class UndeadHorseRenderer extends AbstractHorseRenderer> { private static final Map, ResourceLocation> MAP = Maps., ResourceLocation>newHashMap( ImmutableMap.of( EntityType.ZOMBIE_HORSE, ResourceLocation.withDefaultNamespace("textures/entity/horse/horse_zombie.png"), EntityType.SKELETON_HORSE, ResourceLocation.withDefaultNamespace("textures/entity/horse/horse_skeleton.png") ) ); public UndeadHorseRenderer(EntityRendererProvider.Context context, ModelLayerLocation layer) { super(context, new HorseModel<>(context.bakeLayer(layer)), 1.0F); } /** * Returns the location of an entity's texture. */ public ResourceLocation getTextureLocation(AbstractHorse entity) { return (ResourceLocation)MAP.get(entity.getType()); } }