Implement entity types (#1001)

Implement palette generation and investigate palette changes between
versions. Turns out 1.13- has legacy IDs, 1.14 switches to entity
palette and 1.15 refreshes the whole palette just to insert Bee.

Also refactor entity handling code here and there.
This commit is contained in:
ORelio 2020-05-24 18:21:22 +02:00
parent 5b0b0c9cc3
commit bd85c46663
27 changed files with 1113 additions and 259 deletions

View file

@ -1,14 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Mapping
{
/// <summary>
/// Represents Minecraft Entity Types
/// </summary>
/// <remarks>
/// Generated from registries.json using EntityPaletteGenerator.cs.
/// Typical steps to handle new entity IDs for newer Minecraft versions:
/// 1. Generate registries.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators)
/// 2. Generate temporary EntityTypeXXX.cs and EntityPaletteXXX.cs using EntityPaletteGenerator.cs
/// 3. Perform a diff with existing versions, add missing entries in EntityType.cs and EntityTypeExtensions.cs
/// 4. If existing entity IDs were not randomized by Mojang, simply add missing state entries to the latest existing PaletteXXX.cs
/// 5. If existing entity IDs were randomized, add a new palette as PaletteXXX.cs into the codebase (worst case)
/// </remarks>
public enum EntityType
{
MobAndAnimal,
AreaEffectCloud,
ArmorStand,
Arrow,
Bat,
Bee,
Blaze,
Boat,
Cat,
CaveSpider,
Chicken,
Cod,
Cow,
Creeper,
Donkey,
Dolphin,
DragonFireball,
Drowned,
ElderGuardian,
EndCrystal,
EnderDragon,
Enderman,
Endermite,
EvokerFangs,
Evoker,
ExperienceOrb,
EyeOfEnder,
FallingBlock,
FireworkRocket,
Fox,
Ghast,
Giant,
Guardian,
Horse,
Husk,
Illusioner,
Item,
ItemFrame,
Fireball,
LeashKnot,
Llama,
LlamaSpit,
MagmaCube,
Minecart,
ChestMinecart,
CommandBlockMinecart,
FurnaceMinecart,
HopperMinecart,
SpawnerMinecart,
TntMinecart,
Mule,
Mooshroom,
Ocelot,
Painting,
Panda,
Parrot,
Pig,
Pufferfish,
ZombiePigman,
PolarBear,
Tnt,
Rabbit,
Salmon,
Sheep,
Shulker,
ShulkerBullet,
Silverfish,
Skeleton,
SkeletonHorse,
Slime,
SmallFireball,
SnowGolem,
Snowball,
SpectralArrow,
Spider,
Squid,
Stray,
TraderLlama,
TropicalFish,
Turtle,
Egg,
EnderPearl,
ExperienceBottle,
Potion,
Trident,
Vex,
Villager,
IronGolem,
Vindicator,
Pillager,
WanderingTrader,
Witch,
Wither,
WitherSkeleton,
WitherSkull,
Wolf,
Zombie,
ZombieHorse,
ZombieVillager,
Phantom,
Ravager,
LightningBolt,
Player,
NonLivingThings,
FishingBobber,
}
}