package protocolsupport.protocol.typeremapper.legacy;

import java.util.HashMap;

public class LegacyEntityType {

	private static final HashMap<String, String> legacyNames = new HashMap<>();
	static {
		register("fireworks_rocket", "FireworksRocketEntity");
		register("skeleton_horse", "SkeletonHorse");
		register("item", "Item");
		register("vindication_illager", "VindicationIllager");
		register("xp_bottle", "ThrownExpBottle");
		register("elder_guardian", "ElderGuardian");
		register("villager_golem", "VillagerGolem");
		register("item_frame", "ItemFrame");
		register("zombie_pigman", "PigZombie");
		register("wither_skeleton", "WitherSkeleton");
		register("mule", "Mule");
		register("area_effect_cloud", "AreaEffectCloud");
		register("ender_crystal", "EnderCrystal");
		register("evocation_fangs", "EvocationFangs");
		register("evocation_illager", "EvocationIllager");
		register("fireball", "Fireball");
		register("zombie_villager", "ZombieVillager");
		register("giant", "Giant");
		register("silverfish", "Silverfish");
		register("sheep", "Sheep");
		register("husk", "Husk");
		register("guardian", "Guardian");
		register("endermite", "Endermite");
		register("arrow", "Arrow");
		register("zombie_horse", "ZombieHorse");
		register("dragon_fireball", "DragonFireball");
		register("egg", "ThrownEgg");
		register("ender_pearl", "ThrownEnderpearl");
		register("cow", "Cow");
		register("snowman", "SnowMan");
		register("hopper_minecart", "MinecartHopper");
		register("spider", "Spider");
		register("small_fireball", "SmallFireball");
		register("painting", "Painting");
		register("witch", "Witch");
		register("wither", "WitherBoss");
		register("falling_block", "FallingSand");
		register("stray", "Stray");
		register("creeper", "Creeper");
		register("wither_skull", "WitherSkull");
		register("polar_bear", "PolarBear");
		register("potion", "ThrownPotion");
		register("furnace_minecart", "MinecartFurnace");
		register("shulker", "Shulker");
		register("spectral_arrow", "SpectralArrow");
		register("tnt_minecart", "MinecartTNT");
		register("cave_spider", "CaveSpider");
		register("boat", "Boat");
		register("wolf", "Wolf");
		register("villager", "Villager");
		register("ocelot", "Ozelot");
		register("vex", "Vex");
		register("pig", "Pig");
		register("rabbit", "Rabbit");
		register("magma_cube", "LavaSlime");
		register("zombie", "Zombie");
		register("ghast", "Ghast");
		register("bat", "Bat");
		register("blaze", "Blaze");
		register("llama", "Llama");
		register("chicken", "Chicken");
		register("slime", "Slime");
		register("xp_orb", "XPOrb");
		register("mooshroom", "MushroomCow");
		register("commandblock_minecart", "MinecartCommandBlock");
		register("armor_stand", "ArmorStand");
		register("donkey", "Donkey");
		register("leash_knot", "LeashKnot");
		register("skeleton", "Skeleton");
		register("horse", "Horse");
		register("spawner_minecart", "MinecartSpawner");
		register("minecart", "MinecartRideable");
		register("chest_minecart", "MinecartChest");
		register("eye_of_ender_signal", "EyeOfEnderSignal");
		register("shulker_bullet", "ShulkerBullet");
		register("ender_dragon", "EnderDragon");
		register("enderman", "Enderman");
		register("lightning_bolt", "null");
		register("llama_spit", "LlamaSpit");
		register("snowball", "Snowball");
		register("tnt", "PrimedTnt");
		register("squid", "Squid");
	}

	private static void register(String name, String legacy) {
		legacyNames.put(name, legacy);
		legacyNames.put("minecraft:"+name, legacy);
	}

	public static String getLegacyName(String name) {
		return legacyNames.getOrDefault(name, "Unknown");
	}

}

@@ -303,36 +303,8 @@
 %22);%0A
-%09%09register(%22item%22, %22Item%22);%0A
 %09%09re
@@ -498,47 +498,8 @@
 %22);%0A
-%09%09register(%22item_frame%22, %22ItemFrame%22);%0A
 %09%09re
@@ -1225,40 +1225,8 @@
 %22);%0A
-%09%09register(%22egg%22, %22ThrownEgg%22);%0A
 %09%09re
@@ -1460,44 +1460,8 @@
 %22);%0A
-%09%09register(%22painting%22, %22Painting%22);%0A
 %09%09re
@@ -1526,52 +1526,8 @@
 %22);%0A
-%09%09register(%22falling_block%22, %22FallingSand%22);%0A
 %09%09re
@@ -3018,46 +3018,8 @@
 %22);%0A
-%09%09register(%22lightning_bolt%22, %22null%22);%0A
 %09%09re

Remove legacy entity types that crash clients while in spawner from remapping table