package net.minecraft.world.entity.ai.attributes;

import net.minecraft.world.entity.monster.ZombifiedPiglin;
import net.minecraft.world.entity.animal.horse.ZombieHorse;
import net.minecraft.world.entity.monster.Zoglin;
import net.minecraft.world.entity.animal.Wolf;
import net.minecraft.world.entity.boss.wither.WitherBoss;
import net.minecraft.world.entity.monster.Witch;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.monster.Vindicator;
import net.minecraft.world.entity.npc.Villager;
import net.minecraft.world.entity.monster.Vex;
import net.minecraft.world.entity.animal.Turtle;
import net.minecraft.world.entity.monster.Strider;
import net.minecraft.world.entity.animal.Squid;
import net.minecraft.world.entity.monster.Spider;
import net.minecraft.world.entity.animal.SnowGolem;
import net.minecraft.world.entity.animal.horse.SkeletonHorse;
import net.minecraft.world.entity.monster.AbstractSkeleton;
import net.minecraft.world.entity.monster.Silverfish;
import net.minecraft.world.entity.monster.Shulker;
import net.minecraft.world.entity.animal.Sheep;
import net.minecraft.world.entity.monster.Ravager;
import net.minecraft.world.entity.animal.Rabbit;
import net.minecraft.world.entity.animal.PolarBear;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.monster.Pillager;
import net.minecraft.world.entity.monster.piglin.Piglin;
import net.minecraft.world.entity.animal.Pig;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.animal.Panda;
import net.minecraft.world.entity.animal.Ocelot;
import net.minecraft.world.entity.monster.MagmaCube;
import net.minecraft.world.entity.animal.horse.Llama;
import net.minecraft.world.entity.animal.IronGolem;
import net.minecraft.world.entity.monster.Illusioner;
import net.minecraft.world.entity.animal.horse.AbstractHorse;
import net.minecraft.world.entity.monster.hoglin.Hoglin;
import net.minecraft.world.entity.monster.Guardian;
import net.minecraft.world.entity.monster.Giant;
import net.minecraft.world.entity.monster.Ghast;
import net.minecraft.world.entity.animal.Fox;
import net.minecraft.world.entity.monster.Evoker;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.monster.Endermite;
import net.minecraft.world.entity.monster.EnderMan;
import net.minecraft.world.entity.monster.ElderGuardian;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.entity.animal.horse.AbstractChestedHorse;
import net.minecraft.world.entity.animal.Dolphin;
import net.minecraft.world.entity.monster.Creeper;
import net.minecraft.world.entity.animal.Cow;
import net.minecraft.world.entity.animal.AbstractFish;
import net.minecraft.world.entity.animal.Chicken;
import net.minecraft.world.entity.monster.CaveSpider;
import net.minecraft.world.entity.animal.Cat;
import net.minecraft.world.entity.monster.Blaze;
import net.minecraft.world.entity.animal.Bee;
import net.minecraft.world.entity.ambient.Bat;
import net.minecraft.world.entity.decoration.ArmorStand;
import com.google.common.collect.ImmutableMap;
import org.apache.logging.log4j.LogManager;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.SharedConstants;
import java.util.function.Function;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.core.Registry;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EntityType;
import java.util.Map;
import org.apache.logging.log4j.Logger;

public class DefaultAttributes {
    private static final Logger LOGGER;
    private static final Map<EntityType<? extends LivingEntity>, AttributeSupplier> SUPPLIERS;
    
    public static AttributeSupplier getSupplier(final EntityType<? extends LivingEntity> aoq) {
        return DefaultAttributes.SUPPLIERS.get(aoq);
    }
    
    public static boolean hasSupplier(final EntityType<?> aoq) {
        return DefaultAttributes.SUPPLIERS.containsKey(aoq);
    }
    
    public static void validate() {
        final IllegalStateException ex;
        Registry.ENTITY_TYPE.stream().filter(aoq -> aoq.getCategory() != MobCategory.MISC).filter(aoq -> !hasSupplier(aoq)).map(Registry.ENTITY_TYPE::getKey).forEach(uh -> {
            if (SharedConstants.IS_RUNNING_IN_IDE) {
                new IllegalStateException("Entity " + uh + " has no attributes");
                throw ex;
            }
            else {
                DefaultAttributes.LOGGER.error("Entity {} has no attributes", uh);
            }
        });
    }
    
    static {
        LOGGER = LogManager.getLogger();
        SUPPLIERS = ImmutableMap.<EntityType<ArmorStand>, AttributeSupplier>builder().put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put((EntityType<ArmorStand>)EntityType.BAT, Bat.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.BEE, Bee.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.BLAZE, Blaze.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.CAT, Cat.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.CAVE_SPIDER, CaveSpider.createCaveSpider().build()).put((EntityType<ArmorStand>)EntityType.CHICKEN, Chicken.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.COD, AbstractFish.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.COW, Cow.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.CREEPER, Creeper.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.DOLPHIN, Dolphin.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.DONKEY, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put((EntityType<ArmorStand>)EntityType.DROWNED, Zombie.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ENDERMAN, EnderMan.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ENDERMITE, Endermite.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.EVOKER, Evoker.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.FOX, Fox.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.GHAST, Ghast.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.GIANT, Giant.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.GUARDIAN, Guardian.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.HOGLIN, Hoglin.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.HORSE, AbstractHorse.createBaseHorseAttributes().build()).put((EntityType<ArmorStand>)EntityType.HUSK, Zombie.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ILLUSIONER, Illusioner.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.IRON_GOLEM, IronGolem.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.LLAMA, Llama.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.MOOSHROOM, Cow.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put((EntityType<ArmorStand>)EntityType.OCELOT, Ocelot.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PANDA, Panda.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PARROT, Parrot.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PHANTOM, Monster.createMonsterAttributes().build()).put((EntityType<ArmorStand>)EntityType.PIG, Pig.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PIGLIN, Piglin.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PILLAGER, Pillager.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PLAYER, Player.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.POLAR_BEAR, PolarBear.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.PUFFERFISH, AbstractFish.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.RABBIT, Rabbit.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.RAVAGER, Ravager.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SALMON, AbstractFish.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SHEEP, Sheep.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SHULKER, Shulker.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SILVERFISH, Silverfish.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SKELETON, AbstractSkeleton.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SLIME, Monster.createMonsterAttributes().build()).put((EntityType<ArmorStand>)EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SPIDER, Spider.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.SQUID, Squid.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.STRAY, AbstractSkeleton.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.STRIDER, Strider.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.TRADER_LLAMA, Llama.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.TROPICAL_FISH, AbstractFish.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.TURTLE, Turtle.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.VEX, Vex.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.VILLAGER, Villager.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.VINDICATOR, Vindicator.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()).put((EntityType<ArmorStand>)EntityType.WITCH, Witch.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.WITHER, WitherBoss.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.WOLF, Wolf.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ZOGLIN, Zoglin.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ZOMBIE, Zombie.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ZOMBIE_VILLAGER, Zombie.createAttributes().build()).put((EntityType<ArmorStand>)EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()).build();
    }
}
