package net.minecraft.client.renderer.entity;

import net.minecraft.Util;
import com.google.common.collect.Maps;
import java.util.EnumMap;
import net.minecraft.world.entity.Entity;
import net.minecraft.client.renderer.entity.layers.HorseArmorLayer;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.client.renderer.entity.layers.HorseMarkingLayer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.animal.horse.Variant;
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<Variant, ResourceLocation> LOCATION_BY_VARIANT;
    
    public HorseRenderer(final EntityRenderDispatcher egm) {
        super(egm, new HorseModel(0.0f), 1.1f);
        this.addLayer(new HorseMarkingLayer(this));
        this.addLayer(new HorseArmorLayer(this));
    }
    
    @Override
    public ResourceLocation getTextureLocation(final Horse azo) {
        return HorseRenderer.LOCATION_BY_VARIANT.get(azo.getVariant());
    }
    
    static {
        LOCATION_BY_VARIANT = Util.<Map<Variant, ResourceLocation>>make(Maps.newEnumMap(Variant.class), enumMap -> {
            enumMap.put(Variant.WHITE, new ResourceLocation("textures/entity/horse/horse_white.png"));
            enumMap.put(Variant.CREAMY, new ResourceLocation("textures/entity/horse/horse_creamy.png"));
            enumMap.put(Variant.CHESTNUT, new ResourceLocation("textures/entity/horse/horse_chestnut.png"));
            enumMap.put(Variant.BROWN, new ResourceLocation("textures/entity/horse/horse_brown.png"));
            enumMap.put(Variant.BLACK, new ResourceLocation("textures/entity/horse/horse_black.png"));
            enumMap.put(Variant.GRAY, new ResourceLocation("textures/entity/horse/horse_gray.png"));
            enumMap.put(Variant.DARKBROWN, new ResourceLocation("textures/entity/horse/horse_darkbrown.png"));
        });
    }
}
