package net.minecraft.client.renderer.entity;

import com.google.common.collect.Maps;
import net.minecraft.world.entity.Entity;
import net.minecraft.client.renderer.texture.AbstractTexture;
import net.minecraft.client.renderer.texture.LayeredTexture;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.client.renderer.entity.layers.HorseArmorLayer;
import net.minecraft.resources.ResourceLocation;
import java.util.Map;
import net.minecraft.client.model.HorseModel;
import net.minecraft.world.entity.animal.horse.Horse;

public final class HorseRenderer extends AbstractHorseRenderer<Horse, HorseModel<Horse>> {
    private static final Map<String, ResourceLocation> LAYERED_LOCATION_CACHE;
    
    public HorseRenderer(final EntityRenderDispatcher dvf) {
        super(dvf, new HorseModel(0.0f), 1.1f);
        this.addLayer(new HorseArmorLayer(this));
    }
    
    @Override
    public ResourceLocation getTextureLocation(final Horse aug) {
        final String string3 = aug.getLayeredTextureHashName();
        ResourceLocation sm4 = HorseRenderer.LAYERED_LOCATION_CACHE.get(string3);
        if (sm4 == null) {
            sm4 = new ResourceLocation(string3);
            Minecraft.getInstance().getTextureManager().register(sm4, new LayeredTexture(aug.getLayeredTextureLayers()));
            HorseRenderer.LAYERED_LOCATION_CACHE.put(string3, sm4);
        }
        return sm4;
    }
    
    static {
        LAYERED_LOCATION_CACHE = Maps.newHashMap();
    }
}
