From cf418905d0a5625aec714f50408d9832b57b917a Mon Sep 17 00:00:00 2001 From: Yannick Lamprecht Date: Sun, 10 Mar 2024 22:17:48 +0100 Subject: [PATCH] disguise api and generate maps to allow entity metadata syncher validation --- gradle.properties | 1 + paper-server-generator.settings.gradle.kts | 2 + paper-server-generator/build.gradle.kts | 35 + .../paper/entity/meta/EntityMetaWatcher.java | 3020 +++++++++++++++++ .../java/io/papermc/generator/Generators.java | 11 + .../main/java/io/papermc/generator/Main.java | 64 + .../types/EntityMetaWatcherGenerator.java | 178 + .../generator/types/SimpleGenerator.java | 37 + .../generator/types/SourceGenerator.java | 9 + .../papermc/generator/utils/Annotations.java | 59 + .../generator/utils/CollectingContext.java | 28 + .../papermc/generator/utils/Formatting.java | 15 + .../io/papermc/generator/utils/Javadocs.java | 27 + .../generator/utils/ReflectionHelper.java | 39 + paper-server-generator/wideners.at | 7 + patches/api/0477-add-disguise-api.patch | 210 ++ ...dd-paper-server-generator-dependency.patch | 33 + patches/server/1047-add-disguise-api.patch | 276 ++ settings.gradle.kts | 1 + 19 files changed, 4052 insertions(+) create mode 100644 paper-server-generator.settings.gradle.kts create mode 100644 paper-server-generator/build.gradle.kts create mode 100644 paper-server-generator/generated/io/papermc/paper/entity/meta/EntityMetaWatcher.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/Generators.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/Main.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/types/EntityMetaWatcherGenerator.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/utils/Annotations.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/utils/Formatting.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/utils/Javadocs.java create mode 100644 paper-server-generator/src/main/java/io/papermc/generator/utils/ReflectionHelper.java create mode 100644 paper-server-generator/wideners.at create mode 100644 patches/api/0477-add-disguise-api.patch create mode 100644 patches/server/1046-add-paper-server-generator-dependency.patch create mode 100644 patches/server/1047-add-disguise-api.patch diff --git a/gradle.properties b/gradle.properties index cd64968334d5f..d801782d31ac6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,3 +8,4 @@ updatingMinecraft=false org.gradle.caching=true org.gradle.parallel=true org.gradle.vfs.watch=false +org.gradle.jvmargs=-Xmx4096m diff --git a/paper-server-generator.settings.gradle.kts b/paper-server-generator.settings.gradle.kts new file mode 100644 index 0000000000000..70dc24f530d1a --- /dev/null +++ b/paper-server-generator.settings.gradle.kts @@ -0,0 +1,2 @@ +// Uncomment to enable the 'paper-server-generator' project +// include(":paper-server-generator") diff --git a/paper-server-generator/build.gradle.kts b/paper-server-generator/build.gradle.kts new file mode 100644 index 0000000000000..05d16d0b95104 --- /dev/null +++ b/paper-server-generator/build.gradle.kts @@ -0,0 +1,35 @@ +import io.papermc.paperweight.PaperweightSourceGeneratorHelper +import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt + +plugins { + java +} + +plugins.apply(PaperweightSourceGeneratorHelper::class) + +extensions.configure(PaperweightSourceGeneratorExt::class) { + atFile.set(projectDir.toPath().resolve("wideners.at").toFile()) +} + +dependencies { + implementation("com.squareup:javapoet:1.13.0") + implementation(project(":paper-api")) + implementation("io.github.classgraph:classgraph:4.8.47") + implementation("org.jetbrains:annotations:24.0.1") + testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +tasks.register("generate") { + dependsOn(tasks.check) + mainClass.set("io.papermc.generator.Main") + classpath(sourceSets.main.map { it.runtimeClasspath }) + args(projectDir.toPath().resolve("generated").toString()) +} + +tasks.test { + useJUnitPlatform() +} + +group = "io.papermc.paper" +version = "1.0-SNAPSHOT" diff --git a/paper-server-generator/generated/io/papermc/paper/entity/meta/EntityMetaWatcher.java b/paper-server-generator/generated/io/papermc/paper/entity/meta/EntityMetaWatcher.java new file mode 100644 index 0000000000000..ab46463f8ac17 --- /dev/null +++ b/paper-server-generator/generated/io/papermc/paper/entity/meta/EntityMetaWatcher.java @@ -0,0 +1,3020 @@ +package io.papermc.paper.entity.meta; + +import io.papermc.paper.generated.GeneratedFrom; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializer; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.AreaEffectCloud; +import net.minecraft.world.entity.Display; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.ExperienceOrb; +import net.minecraft.world.entity.GlowSquid; +import net.minecraft.world.entity.Interaction; +import net.minecraft.world.entity.LightningBolt; +import net.minecraft.world.entity.Marker; +import net.minecraft.world.entity.OminousItemSpawner; +import net.minecraft.world.entity.ambient.Bat; +import net.minecraft.world.entity.animal.Bee; +import net.minecraft.world.entity.animal.Cat; +import net.minecraft.world.entity.animal.Chicken; +import net.minecraft.world.entity.animal.Cod; +import net.minecraft.world.entity.animal.Cow; +import net.minecraft.world.entity.animal.Dolphin; +import net.minecraft.world.entity.animal.Fox; +import net.minecraft.world.entity.animal.IronGolem; +import net.minecraft.world.entity.animal.MushroomCow; +import net.minecraft.world.entity.animal.Ocelot; +import net.minecraft.world.entity.animal.Panda; +import net.minecraft.world.entity.animal.Parrot; +import net.minecraft.world.entity.animal.Pig; +import net.minecraft.world.entity.animal.PolarBear; +import net.minecraft.world.entity.animal.Pufferfish; +import net.minecraft.world.entity.animal.Rabbit; +import net.minecraft.world.entity.animal.Salmon; +import net.minecraft.world.entity.animal.Sheep; +import net.minecraft.world.entity.animal.SnowGolem; +import net.minecraft.world.entity.animal.Squid; +import net.minecraft.world.entity.animal.TropicalFish; +import net.minecraft.world.entity.animal.Turtle; +import net.minecraft.world.entity.animal.Wolf; +import net.minecraft.world.entity.animal.allay.Allay; +import net.minecraft.world.entity.animal.armadillo.Armadillo; +import net.minecraft.world.entity.animal.axolotl.Axolotl; +import net.minecraft.world.entity.animal.camel.Camel; +import net.minecraft.world.entity.animal.frog.Frog; +import net.minecraft.world.entity.animal.frog.Tadpole; +import net.minecraft.world.entity.animal.goat.Goat; +import net.minecraft.world.entity.animal.horse.Donkey; +import net.minecraft.world.entity.animal.horse.Horse; +import net.minecraft.world.entity.animal.horse.Llama; +import net.minecraft.world.entity.animal.horse.Mule; +import net.minecraft.world.entity.animal.horse.SkeletonHorse; +import net.minecraft.world.entity.animal.horse.TraderLlama; +import net.minecraft.world.entity.animal.horse.ZombieHorse; +import net.minecraft.world.entity.animal.sniffer.Sniffer; +import net.minecraft.world.entity.boss.EnderDragonPart; +import net.minecraft.world.entity.boss.enderdragon.EndCrystal; +import net.minecraft.world.entity.boss.enderdragon.EnderDragon; +import net.minecraft.world.entity.boss.wither.WitherBoss; +import net.minecraft.world.entity.decoration.ArmorStand; +import net.minecraft.world.entity.decoration.GlowItemFrame; +import net.minecraft.world.entity.decoration.ItemFrame; +import net.minecraft.world.entity.decoration.LeashFenceKnotEntity; +import net.minecraft.world.entity.decoration.Painting; +import net.minecraft.world.entity.item.FallingBlockEntity; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.entity.item.PrimedTnt; +import net.minecraft.world.entity.monster.Blaze; +import net.minecraft.world.entity.monster.Bogged; +import net.minecraft.world.entity.monster.CaveSpider; +import net.minecraft.world.entity.monster.Creeper; +import net.minecraft.world.entity.monster.Drowned; +import net.minecraft.world.entity.monster.ElderGuardian; +import net.minecraft.world.entity.monster.EnderMan; +import net.minecraft.world.entity.monster.Endermite; +import net.minecraft.world.entity.monster.Evoker; +import net.minecraft.world.entity.monster.Ghast; +import net.minecraft.world.entity.monster.Giant; +import net.minecraft.world.entity.monster.Guardian; +import net.minecraft.world.entity.monster.Husk; +import net.minecraft.world.entity.monster.Illusioner; +import net.minecraft.world.entity.monster.MagmaCube; +import net.minecraft.world.entity.monster.Phantom; +import net.minecraft.world.entity.monster.Pillager; +import net.minecraft.world.entity.monster.Ravager; +import net.minecraft.world.entity.monster.Shulker; +import net.minecraft.world.entity.monster.Silverfish; +import net.minecraft.world.entity.monster.Skeleton; +import net.minecraft.world.entity.monster.Slime; +import net.minecraft.world.entity.monster.Spider; +import net.minecraft.world.entity.monster.Stray; +import net.minecraft.world.entity.monster.Strider; +import net.minecraft.world.entity.monster.Vex; +import net.minecraft.world.entity.monster.Vindicator; +import net.minecraft.world.entity.monster.Witch; +import net.minecraft.world.entity.monster.WitherSkeleton; +import net.minecraft.world.entity.monster.Zoglin; +import net.minecraft.world.entity.monster.Zombie; +import net.minecraft.world.entity.monster.ZombieVillager; +import net.minecraft.world.entity.monster.ZombifiedPiglin; +import net.minecraft.world.entity.monster.breeze.Breeze; +import net.minecraft.world.entity.monster.hoglin.Hoglin; +import net.minecraft.world.entity.monster.piglin.Piglin; +import net.minecraft.world.entity.monster.piglin.PiglinBrute; +import net.minecraft.world.entity.monster.warden.Warden; +import net.minecraft.world.entity.npc.Villager; +import net.minecraft.world.entity.npc.WanderingTrader; +import net.minecraft.world.entity.projectile.Arrow; +import net.minecraft.world.entity.projectile.DragonFireball; +import net.minecraft.world.entity.projectile.EvokerFangs; +import net.minecraft.world.entity.projectile.EyeOfEnder; +import net.minecraft.world.entity.projectile.FireworkRocketEntity; +import net.minecraft.world.entity.projectile.FishingHook; +import net.minecraft.world.entity.projectile.LargeFireball; +import net.minecraft.world.entity.projectile.LlamaSpit; +import net.minecraft.world.entity.projectile.ShulkerBullet; +import net.minecraft.world.entity.projectile.SmallFireball; +import net.minecraft.world.entity.projectile.Snowball; +import net.minecraft.world.entity.projectile.SpectralArrow; +import net.minecraft.world.entity.projectile.ThrownEgg; +import net.minecraft.world.entity.projectile.ThrownEnderpearl; +import net.minecraft.world.entity.projectile.ThrownExperienceBottle; +import net.minecraft.world.entity.projectile.ThrownPotion; +import net.minecraft.world.entity.projectile.ThrownTrident; +import net.minecraft.world.entity.projectile.WitherSkull; +import net.minecraft.world.entity.projectile.windcharge.BreezeWindCharge; +import net.minecraft.world.entity.projectile.windcharge.WindCharge; +import net.minecraft.world.entity.vehicle.Boat; +import net.minecraft.world.entity.vehicle.ChestBoat; +import net.minecraft.world.entity.vehicle.Minecart; +import net.minecraft.world.entity.vehicle.MinecartChest; +import net.minecraft.world.entity.vehicle.MinecartCommandBlock; +import net.minecraft.world.entity.vehicle.MinecartFurnace; +import net.minecraft.world.entity.vehicle.MinecartHopper; +import net.minecraft.world.entity.vehicle.MinecartSpawner; +import net.minecraft.world.entity.vehicle.MinecartTNT; + +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@GeneratedFrom("1.20.6") +public final class EntityMetaWatcher { + private static final Map, Map>> VALID_ENTITY_META_MAP = initialize(); + + private static final Map> minecart() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> glowSquid() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> turtle() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BLOCK_POS); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(20L, EntityDataSerializers.BLOCK_POS); + result.put(21L, EntityDataSerializers.BOOLEAN); + result.put(22L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> donkey() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> minecartTNT() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> thrownEnderpearl() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> witch() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> breeze() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> allay() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> drowned() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> fishingHook() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> fox() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BYTE); + result.put(19L, EntityDataSerializers.OPTIONAL_UUID); + result.put(20L, EntityDataSerializers.OPTIONAL_UUID); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> dolphin() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BLOCK_POS); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> spider() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> creeper() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> bat() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> armorStand() { + Map> result = new HashMap<>(); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.ROTATIONS); + result.put(17L, EntityDataSerializers.ROTATIONS); + result.put(18L, EntityDataSerializers.ROTATIONS); + result.put(19L, EntityDataSerializers.ROTATIONS); + result.put(20L, EntityDataSerializers.ROTATIONS); + result.put(21L, EntityDataSerializers.ROTATIONS); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + return Map.copyOf(result); + } + + private static final Map> llama() { + Map> result = new HashMap<>(); + result.put(19L, EntityDataSerializers.INT); + result.put(20L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> breezeWindCharge() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> snowball() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> ghast() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> serverPlayer() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.FLOAT); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BYTE); + result.put(19L, EntityDataSerializers.COMPOUND_TAG); + result.put(20L, EntityDataSerializers.COMPOUND_TAG); + return Map.copyOf(result); + } + + private static final Map> villager() { + Map> result = new HashMap<>(); + result.put(18L, EntityDataSerializers.VILLAGER_DATA); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> experienceOrb() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> ironGolem() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> windCharge() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> wolf() { + Map> result = new HashMap<>(); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(20L, EntityDataSerializers.INT); + result.put(21L, EntityDataSerializers.INT); + result.put(22L, EntityDataSerializers.WOLF_VARIANT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.OPTIONAL_UUID); + return Map.copyOf(result); + } + + private static final Map> salmon() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> ominousItemSpawner() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> witherSkull() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> frog() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.FROG_VARIANT); + result.put(18L, EntityDataSerializers.OPTIONAL_UNSIGNED_INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> piglinBrute() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> spectralArrow() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> areaEffectCloud() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.FLOAT); + result.put(9L, EntityDataSerializers.BOOLEAN); + result.put(10L, EntityDataSerializers.PARTICLE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> piglin() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> llamaSpit() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> arrow() { + Map> result = new HashMap<>(); + result.put(10L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> blaze() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> dragonFireball() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> wanderingTrader() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> endCrystal() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(9L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> ravager() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> thrownEgg() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> zombieVillager() { + Map> result = new HashMap<>(); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(20L, EntityDataSerializers.VILLAGER_DATA); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> bee() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> goat() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> cow() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> shulker() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.DIRECTION); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> silverfish() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> pufferfish() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> guardian() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> caveSpider() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> evoker() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> evokerFangs() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> minecartFurnace() { + Map> result = new HashMap<>(); + result.put(14L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> chicken() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> itemFrame() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(9L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> ocelot() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> itemEntity() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> axolotl() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> fireworkRocketEntity() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(9L, EntityDataSerializers.OPTIONAL_UNSIGNED_INT); + result.put(10L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> sniffer() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.SNIFFER_STATE); + result.put(18L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> smallFireball() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> polarBear() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> enderDragonPart() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> itemDisplay() { + Map> result = new HashMap<>(); + result.put(23L, EntityDataSerializers.ITEM_STACK); + result.put(24L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.INT); + result.put(11L, EntityDataSerializers.VECTOR3); + result.put(12L, EntityDataSerializers.VECTOR3); + result.put(13L, EntityDataSerializers.QUATERNION); + result.put(14L, EntityDataSerializers.QUATERNION); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.FLOAT); + result.put(18L, EntityDataSerializers.FLOAT); + result.put(19L, EntityDataSerializers.FLOAT); + result.put(20L, EntityDataSerializers.FLOAT); + result.put(21L, EntityDataSerializers.FLOAT); + result.put(22L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> leashFenceKnotEntity() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> tadpole() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> textDisplay() { + Map> result = new HashMap<>(); + result.put(23L, EntityDataSerializers.COMPONENT); + result.put(24L, EntityDataSerializers.INT); + result.put(25L, EntityDataSerializers.INT); + result.put(26L, EntityDataSerializers.BYTE); + result.put(27L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.INT); + result.put(11L, EntityDataSerializers.VECTOR3); + result.put(12L, EntityDataSerializers.VECTOR3); + result.put(13L, EntityDataSerializers.QUATERNION); + result.put(14L, EntityDataSerializers.QUATERNION); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.FLOAT); + result.put(18L, EntityDataSerializers.FLOAT); + result.put(19L, EntityDataSerializers.FLOAT); + result.put(20L, EntityDataSerializers.FLOAT); + result.put(21L, EntityDataSerializers.FLOAT); + result.put(22L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> husk() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> enderDragon() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> witherBoss() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.INT); + result.put(19L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> glowItemFrame() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(9L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> fallingBlockEntity() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.BLOCK_POS); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> warden() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> painting() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.PAINTING_VARIANT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> minecartCommandBlock() { + Map> result = new HashMap<>(); + result.put(14L, EntityDataSerializers.STRING); + result.put(15L, EntityDataSerializers.COMPONENT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> thrownPotion() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> zoglin() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> giant() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> blockDisplay() { + Map> result = new HashMap<>(); + result.put(23L, EntityDataSerializers.BLOCK_STATE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.INT); + result.put(11L, EntityDataSerializers.VECTOR3); + result.put(12L, EntityDataSerializers.VECTOR3); + result.put(13L, EntityDataSerializers.QUATERNION); + result.put(14L, EntityDataSerializers.QUATERNION); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.INT); + result.put(17L, EntityDataSerializers.FLOAT); + result.put(18L, EntityDataSerializers.FLOAT); + result.put(19L, EntityDataSerializers.FLOAT); + result.put(20L, EntityDataSerializers.FLOAT); + result.put(21L, EntityDataSerializers.FLOAT); + result.put(22L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> strider() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> zombieHorse() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> lightningBolt() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> hoglin() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> shulkerBullet() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> skeleton() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> snowGolem() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> stray() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> pillager() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> skeletonHorse() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> largeFireball() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> rabbit() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> endermite() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> elderGuardian() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> phantom() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> zombifiedPiglin() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> minecartHopper() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> cod() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> panda() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.INT); + result.put(19L, EntityDataSerializers.INT); + result.put(20L, EntityDataSerializers.BYTE); + result.put(21L, EntityDataSerializers.BYTE); + result.put(22L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> zombie() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.INT); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> sheep() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> parrot() { + Map> result = new HashMap<>(); + result.put(19L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.OPTIONAL_UUID); + return Map.copyOf(result); + } + + private static final Map> tropicalFish() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> squid() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> traderLlama() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.INT); + result.put(20L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> minecartChest() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> mule() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> thrownTrident() { + Map> result = new HashMap<>(); + result.put(10L, EntityDataSerializers.BYTE); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> enderMan() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.OPTIONAL_BLOCK_STATE); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> thrownExperienceBottle() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.ITEM_STACK); + return Map.copyOf(result); + } + + private static final Map> boat() { + Map> result = new HashMap<>(); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.BOOLEAN); + result.put(13L, EntityDataSerializers.BOOLEAN); + result.put(14L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + return Map.copyOf(result); + } + + private static final Map> pig() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.BOOLEAN); + result.put(18L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> bogged() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> interaction() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.FLOAT); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.BOOLEAN); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> witherSkeleton() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> minecartSpawner() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> illusioner() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> magmaCube() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> cat() { + Map> result = new HashMap<>(); + result.put(19L, EntityDataSerializers.CAT_VARIANT); + result.put(20L, EntityDataSerializers.BOOLEAN); + result.put(21L, EntityDataSerializers.BOOLEAN); + result.put(22L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + result.put(18L, EntityDataSerializers.OPTIONAL_UUID); + return Map.copyOf(result); + } + + private static final Map> mushroomCow() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.STRING); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> horse() { + Map> result = new HashMap<>(); + result.put(18L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> eyeOfEnder() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.ITEM_STACK); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> marker() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> camel() { + Map> result = new HashMap<>(); + result.put(18L, EntityDataSerializers.BOOLEAN); + result.put(19L, EntityDataSerializers.LONG); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + result.put(17L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> armadillo() { + Map> result = new HashMap<>(); + result.put(17L, EntityDataSerializers.ARMADILLO_STATE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map> chestBoat() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.INT); + result.put(10L, EntityDataSerializers.FLOAT); + result.put(11L, EntityDataSerializers.INT); + result.put(12L, EntityDataSerializers.BOOLEAN); + result.put(13L, EntityDataSerializers.BOOLEAN); + result.put(14L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> primedTnt() { + Map> result = new HashMap<>(); + result.put(8L, EntityDataSerializers.INT); + result.put(9L, EntityDataSerializers.BLOCK_STATE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + return Map.copyOf(result); + } + + private static final Map> slime() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.INT); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> vex() { + Map> result = new HashMap<>(); + result.put(16L, EntityDataSerializers.BYTE); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + return Map.copyOf(result); + } + + private static final Map> vindicator() { + Map> result = new HashMap<>(); + result.put(0L, EntityDataSerializers.BYTE); + result.put(1L, EntityDataSerializers.INT); + result.put(2L, EntityDataSerializers.OPTIONAL_COMPONENT); + result.put(3L, EntityDataSerializers.BOOLEAN); + result.put(4L, EntityDataSerializers.BOOLEAN); + result.put(5L, EntityDataSerializers.BOOLEAN); + result.put(6L, EntityDataSerializers.POSE); + result.put(7L, EntityDataSerializers.INT); + result.put(8L, EntityDataSerializers.BYTE); + result.put(9L, EntityDataSerializers.FLOAT); + result.put(10L, EntityDataSerializers.PARTICLES); + result.put(11L, EntityDataSerializers.BOOLEAN); + result.put(12L, EntityDataSerializers.INT); + result.put(13L, EntityDataSerializers.INT); + result.put(14L, EntityDataSerializers.OPTIONAL_BLOCK_POS); + result.put(15L, EntityDataSerializers.BYTE); + result.put(16L, EntityDataSerializers.BOOLEAN); + return Map.copyOf(result); + } + + private static final Map, Map>> initialize( + ) { + Map, Map>> result = new HashMap<>(); + result.put(Minecart.class, minecart()); + result.put(GlowSquid.class, glowSquid()); + result.put(Turtle.class, turtle()); + result.put(Donkey.class, donkey()); + result.put(MinecartTNT.class, minecartTNT()); + result.put(ThrownEnderpearl.class, thrownEnderpearl()); + result.put(Witch.class, witch()); + result.put(Breeze.class, breeze()); + result.put(Allay.class, allay()); + result.put(Drowned.class, drowned()); + result.put(FishingHook.class, fishingHook()); + result.put(Fox.class, fox()); + result.put(Dolphin.class, dolphin()); + result.put(Spider.class, spider()); + result.put(Creeper.class, creeper()); + result.put(Bat.class, bat()); + result.put(ArmorStand.class, armorStand()); + result.put(Llama.class, llama()); + result.put(BreezeWindCharge.class, breezeWindCharge()); + result.put(Snowball.class, snowball()); + result.put(Ghast.class, ghast()); + result.put(ServerPlayer.class, serverPlayer()); + result.put(Villager.class, villager()); + result.put(ExperienceOrb.class, experienceOrb()); + result.put(IronGolem.class, ironGolem()); + result.put(WindCharge.class, windCharge()); + result.put(Wolf.class, wolf()); + result.put(Salmon.class, salmon()); + result.put(OminousItemSpawner.class, ominousItemSpawner()); + result.put(WitherSkull.class, witherSkull()); + result.put(Frog.class, frog()); + result.put(PiglinBrute.class, piglinBrute()); + result.put(SpectralArrow.class, spectralArrow()); + result.put(AreaEffectCloud.class, areaEffectCloud()); + result.put(Piglin.class, piglin()); + result.put(LlamaSpit.class, llamaSpit()); + result.put(Arrow.class, arrow()); + result.put(Blaze.class, blaze()); + result.put(DragonFireball.class, dragonFireball()); + result.put(WanderingTrader.class, wanderingTrader()); + result.put(EndCrystal.class, endCrystal()); + result.put(Ravager.class, ravager()); + result.put(ThrownEgg.class, thrownEgg()); + result.put(ZombieVillager.class, zombieVillager()); + result.put(Bee.class, bee()); + result.put(Goat.class, goat()); + result.put(Cow.class, cow()); + result.put(Shulker.class, shulker()); + result.put(Silverfish.class, silverfish()); + result.put(Pufferfish.class, pufferfish()); + result.put(Guardian.class, guardian()); + result.put(CaveSpider.class, caveSpider()); + result.put(Evoker.class, evoker()); + result.put(EvokerFangs.class, evokerFangs()); + result.put(MinecartFurnace.class, minecartFurnace()); + result.put(Chicken.class, chicken()); + result.put(ItemFrame.class, itemFrame()); + result.put(Ocelot.class, ocelot()); + result.put(ItemEntity.class, itemEntity()); + result.put(Axolotl.class, axolotl()); + result.put(FireworkRocketEntity.class, fireworkRocketEntity()); + result.put(Sniffer.class, sniffer()); + result.put(SmallFireball.class, smallFireball()); + result.put(PolarBear.class, polarBear()); + result.put(EnderDragonPart.class, enderDragonPart()); + result.put(Display.ItemDisplay.class, itemDisplay()); + result.put(LeashFenceKnotEntity.class, leashFenceKnotEntity()); + result.put(Tadpole.class, tadpole()); + result.put(Display.TextDisplay.class, textDisplay()); + result.put(Husk.class, husk()); + result.put(EnderDragon.class, enderDragon()); + result.put(WitherBoss.class, witherBoss()); + result.put(GlowItemFrame.class, glowItemFrame()); + result.put(FallingBlockEntity.class, fallingBlockEntity()); + result.put(Warden.class, warden()); + result.put(Painting.class, painting()); + result.put(MinecartCommandBlock.class, minecartCommandBlock()); + result.put(ThrownPotion.class, thrownPotion()); + result.put(Zoglin.class, zoglin()); + result.put(Giant.class, giant()); + result.put(Display.BlockDisplay.class, blockDisplay()); + result.put(Strider.class, strider()); + result.put(ZombieHorse.class, zombieHorse()); + result.put(LightningBolt.class, lightningBolt()); + result.put(Hoglin.class, hoglin()); + result.put(ShulkerBullet.class, shulkerBullet()); + result.put(Skeleton.class, skeleton()); + result.put(SnowGolem.class, snowGolem()); + result.put(Stray.class, stray()); + result.put(Pillager.class, pillager()); + result.put(SkeletonHorse.class, skeletonHorse()); + result.put(LargeFireball.class, largeFireball()); + result.put(Rabbit.class, rabbit()); + result.put(Endermite.class, endermite()); + result.put(ElderGuardian.class, elderGuardian()); + result.put(Phantom.class, phantom()); + result.put(ZombifiedPiglin.class, zombifiedPiglin()); + result.put(MinecartHopper.class, minecartHopper()); + result.put(Cod.class, cod()); + result.put(Panda.class, panda()); + result.put(Zombie.class, zombie()); + result.put(Sheep.class, sheep()); + result.put(Parrot.class, parrot()); + result.put(TropicalFish.class, tropicalFish()); + result.put(Squid.class, squid()); + result.put(TraderLlama.class, traderLlama()); + result.put(MinecartChest.class, minecartChest()); + result.put(Mule.class, mule()); + result.put(ThrownTrident.class, thrownTrident()); + result.put(EnderMan.class, enderMan()); + result.put(ThrownExperienceBottle.class, thrownExperienceBottle()); + result.put(Boat.class, boat()); + result.put(Pig.class, pig()); + result.put(Bogged.class, bogged()); + result.put(Interaction.class, interaction()); + result.put(WitherSkeleton.class, witherSkeleton()); + result.put(MinecartSpawner.class, minecartSpawner()); + result.put(Illusioner.class, illusioner()); + result.put(MagmaCube.class, magmaCube()); + result.put(Cat.class, cat()); + result.put(MushroomCow.class, mushroomCow()); + result.put(Horse.class, horse()); + result.put(EyeOfEnder.class, eyeOfEnder()); + result.put(Marker.class, marker()); + result.put(Camel.class, camel()); + result.put(Armadillo.class, armadillo()); + result.put(ChestBoat.class, chestBoat()); + result.put(PrimedTnt.class, primedTnt()); + result.put(Slime.class, slime()); + result.put(Vex.class, vex()); + result.put(Vindicator.class, vindicator()); + return Map.copyOf(result); + } + + public static final boolean isValidForClass(Class clazz, + EntityDataAccessor accessor) { + Map> serializerMap = VALID_ENTITY_META_MAP.get(clazz); + if(serializerMap == null) { + return false; + } + var serializer = serializerMap.get(accessor.id()); + return serializer != null && serializer == accessor.serializer(); + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/Generators.java b/paper-server-generator/src/main/java/io/papermc/generator/Generators.java new file mode 100644 index 0000000000000..dea3331e298e2 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/Generators.java @@ -0,0 +1,11 @@ +package io.papermc.generator; + +import io.papermc.generator.types.EntityMetaWatcherGenerator; +import io.papermc.generator.types.SourceGenerator; + +public interface Generators { + + SourceGenerator[] SERVER = { + new EntityMetaWatcherGenerator("EntityMetaWatcher", "io.papermc.paper.entity.meta") + }; +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/Main.java b/paper-server-generator/src/main/java/io/papermc/generator/Main.java new file mode 100644 index 0000000000000..1e73d94e8458d --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/Main.java @@ -0,0 +1,64 @@ +package io.papermc.generator; + +import com.mojang.logging.LogUtils; + +import io.papermc.generator.types.SourceGenerator; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import net.minecraft.SharedConstants; +import net.minecraft.core.LayeredRegistryAccess; +import net.minecraft.core.RegistryAccess; +import net.minecraft.resources.RegistryDataLoader; +import net.minecraft.server.Bootstrap; +import net.minecraft.server.RegistryLayer; +import net.minecraft.server.WorldLoader; +import net.minecraft.server.packs.PackType; +import net.minecraft.server.packs.repository.Pack; +import net.minecraft.server.packs.repository.PackRepository; +import net.minecraft.server.packs.repository.ServerPacksSource; +import net.minecraft.server.packs.resources.MultiPackResourceManager; +import org.apache.commons.io.file.PathUtils; +import org.slf4j.Logger; + +public final class Main { + + private static final Logger LOGGER = LogUtils.getLogger(); + public static final RegistryAccess.Frozen REGISTRY_ACCESS; + + static { + SharedConstants.tryDetectVersion(); + Bootstrap.bootStrap(); + final PackRepository resourceRepository = ServerPacksSource.createVanillaTrustedRepository(); + resourceRepository.reload(); + final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList()); + LayeredRegistryAccess layers = RegistryLayer.createRegistryAccess(); + layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES); + REGISTRY_ACCESS = layers.compositeAccess().freeze(); + } + + private Main() { + } + + public static void main(final String[] args) { + LOGGER.info("Running API generators..."); + generate(Paths.get(args[0]), Generators.SERVER); + } + + private static void generate(Path output, SourceGenerator[] generators) { + try { + if (Files.exists(output)) { + PathUtils.deleteDirectory(output); + } + Files.createDirectories(output); + + for (final SourceGenerator generator : generators) { + generator.writeToFile(output); + } + + LOGGER.info("Files written to {}", output.toAbsolutePath()); + } catch (final Exception ex) { + throw new RuntimeException(ex); + } + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/types/EntityMetaWatcherGenerator.java b/paper-server-generator/src/main/java/io/papermc/generator/types/EntityMetaWatcherGenerator.java new file mode 100644 index 0000000000000..955aecf7275f4 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/types/EntityMetaWatcherGenerator.java @@ -0,0 +1,178 @@ +package io.papermc.generator.types; + +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeSpec; +import com.squareup.javapoet.WildcardTypeName; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ScanResult; +import io.papermc.generator.utils.Annotations; +import io.papermc.generator.utils.ReflectionHelper; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import javax.lang.model.element.Modifier; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializer; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.world.entity.Entity; +import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; + +@DefaultQualifier(NonNull.class) +public class EntityMetaWatcherGenerator extends SimpleGenerator { + + private static final ParameterizedTypeName GENERIC_ENTITY_DATA_SERIALIZER = ParameterizedTypeName.get(ClassName.get(Map.class), ClassName.get(Long.class), ParameterizedTypeName.get(ClassName.get(EntityDataSerializer.class), WildcardTypeName.subtypeOf(Object.class))); + private static final ParameterizedTypeName ENTITY_CLASS = ParameterizedTypeName.get(ClassName.get(Class.class), WildcardTypeName.subtypeOf(Entity.class)); + private static final ParameterizedTypeName OUTER_MAP_TYPE = ParameterizedTypeName.get(ClassName.get(Map.class), ENTITY_CLASS, GENERIC_ENTITY_DATA_SERIALIZER); + + public EntityMetaWatcherGenerator(String className, String packageName) { + super(className, packageName); + } + + @Override + protected TypeSpec getTypeSpec() { + Map, String> dataAccessorStringMap = serializerMap(); + + List> classes; + try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages("net.minecraft").scan()) { + classes = scanResult.getSubclasses(net.minecraft.world.entity.Entity.class.getName()).loadClasses(); + } + + classes = classes.stream() + .filter(clazz -> !java.lang.reflect.Modifier.isAbstract(clazz.getModifiers())) + .toList(); + + record Pair(Class clazz, List> metaResults) {} + + final List list = classes.stream() + .map(clazz -> new Pair( + clazz, + ReflectionHelper.getAllForAllParents(clazz, EntityMetaWatcherGenerator::doFilter) + .stream() + .map(this::createData) + .filter(Objects::nonNull) + .toList() + ) + ) + .toList(); + + Map, List>> vanillaNames = list.stream() + .collect(Collectors.toMap(pair -> pair.clazz, pair -> pair.metaResults)); + + TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(this.className) + .addModifiers(Modifier.PUBLIC, Modifier.FINAL) + .addAnnotations(Annotations.CLASS_HEADER); + + generateIdAccessorMethods(vanillaNames, dataAccessorStringMap, typeBuilder); + generateClassToTypeMap(typeBuilder, vanillaNames.keySet()); + generateIsValidAccessorForEntity(typeBuilder); + + return typeBuilder.build(); + } + + private void generateIsValidAccessorForEntity(TypeSpec.Builder builder) { + var methodBuilder = MethodSpec.methodBuilder("isValidForClass") + .addModifiers(Modifier.PUBLIC, Modifier.FINAL, Modifier.STATIC) + .returns(boolean.class) + .addParameter(ParameterizedTypeName.get(ClassName.get(Class.class), WildcardTypeName.subtypeOf(Entity.class)), "clazz") + .addParameter(EntityDataAccessor.class, "accessor") + .addStatement("Map> serializerMap = VALID_ENTITY_META_MAP.get(clazz)") + .beginControlFlow("if(serializerMap == null)") + .addStatement("return false") + .endControlFlow() + .addStatement("var serializer = serializerMap.get(accessor.id())") + .addStatement("return serializer != null && serializer == accessor.serializer()"); + + builder.addMethod(methodBuilder.build()); + } + + private void generateClassToTypeMap(TypeSpec.Builder typeBuilder, Set> classes){ + typeBuilder.addField( + FieldSpec.builder(OUTER_MAP_TYPE, "VALID_ENTITY_META_MAP", Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) + .initializer("initialize()") + .build() + ); + + MethodSpec.Builder builder = MethodSpec.methodBuilder("initialize") + .addModifiers(Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) + .returns(OUTER_MAP_TYPE) + .addStatement("$T result = new $T<>()", OUTER_MAP_TYPE, ClassName.get(HashMap.class)); + + classes.forEach(aClass -> { + String name = StringUtils.uncapitalize(aClass.getSimpleName()); + if(!name.isBlank()) { + builder.addStatement("result.put($T.class, $L())", aClass, name); + } + }); + + typeBuilder.addMethod(builder.addStatement("return $T.copyOf(result)", Map.class).build()); + } + + private static void generateIdAccessorMethods(Map, List>> vanillaNames, Map, String> dataAccessorStringMap, TypeSpec.Builder typeBuilder) { + for (final Map.Entry, List>> perClassResults : vanillaNames.entrySet()) { + if (perClassResults.getKey().getSimpleName().isBlank()) { + continue; + } + var simpleName = perClassResults.getKey().getSimpleName(); + + ClassName hashMap = ClassName.get(HashMap.class); + + MethodSpec.Builder builder = MethodSpec.methodBuilder(StringUtils.uncapitalize(simpleName)) + .addModifiers(Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) + .returns(GENERIC_ENTITY_DATA_SERIALIZER) + .addStatement("$T result = new $T<>()", GENERIC_ENTITY_DATA_SERIALIZER, hashMap); + + perClassResults.getValue().forEach(result -> { + builder.addStatement("result.put($LL, $T.$L)", result.id(), EntityDataSerializers.class, dataAccessorStringMap.get(result.serializer())); + }); + + var method = builder.addStatement("return $T.copyOf(result)", Map.class) + .build(); + + typeBuilder.addMethod(method); + } + } + + private @Nullable EntityDataAccessor createData(Field field) { + try { + field.setAccessible(true); + return (EntityDataAccessor) field.get(null); + } catch (IllegalAccessException e) { + return null; + } + } + + private static boolean doFilter(Field field) { + return java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.getType().isAssignableFrom(EntityDataAccessor.class); + } + + @Override + protected JavaFile.Builder file(JavaFile.Builder builder) { + return builder.skipJavaLangImports(true); + } + + private Map, String> serializerMap(){ + return Arrays.stream(EntityDataSerializers.class.getDeclaredFields()) + .filter(field -> field.getType() == EntityDataSerializer.class) + .map(field -> { + try { + return Map.entry((EntityDataSerializer)field.get(0), field.getName()); + } catch (IllegalAccessException e) { + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java b/paper-server-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java new file mode 100644 index 0000000000000..76edecd9ff706 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java @@ -0,0 +1,37 @@ +package io.papermc.generator.types; + +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.TypeSpec; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + +public abstract class SimpleGenerator implements SourceGenerator { + + protected final String className; + protected final String packageName; + + protected SimpleGenerator(String className, String packageName) { + this.className = className; + this.packageName = packageName; + } + + protected abstract TypeSpec getTypeSpec(); + + protected abstract JavaFile.Builder file(JavaFile.Builder builder); + + @Override + public void writeToFile(Path parent) throws IOException { + Path packagePath = parent.resolve(this.packageName.replace('.', '/')); + Files.createDirectories(packagePath); + + JavaFile.Builder builder = JavaFile.builder(this.packageName, this.getTypeSpec()) + .indent(" "); + this.file(builder); + + Files.writeString(packagePath.resolve(this.className + ".java"), this.file(builder).build().toString(), StandardCharsets.UTF_8); + } + +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java b/paper-server-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java new file mode 100644 index 0000000000000..2d550fa4218c5 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java @@ -0,0 +1,9 @@ +package io.papermc.generator.types; + +import java.io.IOException; +import java.nio.file.Path; + +public interface SourceGenerator { + + void writeToFile(Path parent) throws IOException; +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/utils/Annotations.java b/paper-server-generator/src/main/java/io/papermc/generator/utils/Annotations.java new file mode 100644 index 0000000000000..0d897ecfb4803 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/utils/Annotations.java @@ -0,0 +1,59 @@ +package io.papermc.generator.utils; + +import com.squareup.javapoet.AnnotationSpec; +import java.util.List; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.SharedConstants; +import org.bukkit.MinecraftExperimental; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class Annotations { + + public static List experimentalAnnotations(final String version) { + return List.of( + AnnotationSpec.builder(ApiStatus.Experimental.class).build(), + AnnotationSpec.builder(MinecraftExperimental.class) + .addMember("value", "$S", version) + .build() + ); + } + + public static AnnotationSpec deprecatedVersioned(final @Nullable String version, boolean forRemoval) { + AnnotationSpec.Builder annotationSpec = AnnotationSpec.builder(Deprecated.class); + if (forRemoval) { + annotationSpec.addMember("forRemoval", "$L", forRemoval); + } + if (version != null) { + annotationSpec.addMember("since", "$S", version); + } + + return annotationSpec.build(); + } + + public static AnnotationSpec scheduledRemoval(final @Nullable String version) { + return AnnotationSpec.builder(ApiStatus.ScheduledForRemoval.class) + .addMember("inVersion", "$S", version) + .build(); + } + + @ApiStatus.Experimental + public static final AnnotationSpec EXPERIMENTAL_API_ANNOTATION = AnnotationSpec.builder(ApiStatus.Experimental.class).build(); + public static final AnnotationSpec NOT_NULL = AnnotationSpec.builder(NotNull.class).build(); + private static final AnnotationSpec SUPPRESS_WARNINGS = AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unused") + .addMember("value", "$S", "SpellCheckingInspection") + .build(); + private static final AnnotationSpec GENERATED_FROM = AnnotationSpec.builder(GeneratedFrom.class) + .addMember("value", "$S", SharedConstants.getCurrentVersion().getName()) + .build(); + public static final Iterable CLASS_HEADER = List.of( + SUPPRESS_WARNINGS, + GENERATED_FROM + ); + + private Annotations() { + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java b/paper-server-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java new file mode 100644 index 0000000000000..614babf9e0a4c --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java @@ -0,0 +1,28 @@ +package io.papermc.generator.utils; + +import com.mojang.serialization.Lifecycle; +import io.papermc.generator.Main; +import java.util.List; +import net.minecraft.core.Holder; +import net.minecraft.core.HolderGetter; +import net.minecraft.core.Registry; +import net.minecraft.data.worldgen.BootstrapContext; +import net.minecraft.resources.ResourceKey; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.framework.qual.DefaultQualifier; + +@DefaultQualifier(NonNull.class) +public record CollectingContext(List> registered, + Registry registry) implements BootstrapContext { + + @Override + public Holder.Reference register(final ResourceKey resourceKey, final @NonNull T t, final Lifecycle lifecycle) { + this.registered.add(resourceKey); + return Holder.Reference.createStandAlone(this.registry.holderOwner(), resourceKey); + } + + @Override + public HolderGetter lookup(final ResourceKey> resourceKey) { + return Main.REGISTRY_ACCESS.registryOrThrow(resourceKey).asLookup(); + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/utils/Formatting.java b/paper-server-generator/src/main/java/io/papermc/generator/utils/Formatting.java new file mode 100644 index 0000000000000..f4b07411a441d --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/utils/Formatting.java @@ -0,0 +1,15 @@ +package io.papermc.generator.utils; + +import net.kyori.adventure.key.Key; + +import java.util.Locale; + +public final class Formatting { + + public static String formatKeyAsField(Key key) { + return key.value().toUpperCase(Locale.ENGLISH).replaceAll("[.-/]", "_"); // replace invalid field name chars + } + + private Formatting() { + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/utils/Javadocs.java b/paper-server-generator/src/main/java/io/papermc/generator/utils/Javadocs.java new file mode 100644 index 0000000000000..33536c8311d60 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/utils/Javadocs.java @@ -0,0 +1,27 @@ +package io.papermc.generator.utils; + +public final class Javadocs { + + public static String getVersionDependentClassHeader(String headerIdentifier) { + return """ + Vanilla keys for %s. + + @apiNote The fields provided here are a direct representation of + what is available from the vanilla game source. They may be + changed (including removals) on any Minecraft version + bump, so cross-version compatibility is not provided on the + same level as it is on most of the other API. + """.formatted(headerIdentifier); + } + + public static String getVersionDependentField(String headerIdentifier) { + return """ + %s + + @apiNote This field is version-dependant and may be removed in future Minecraft versions + """.formatted(headerIdentifier); + } + + private Javadocs() { + } +} diff --git a/paper-server-generator/src/main/java/io/papermc/generator/utils/ReflectionHelper.java b/paper-server-generator/src/main/java/io/papermc/generator/utils/ReflectionHelper.java new file mode 100644 index 0000000000000..d76f3c7299871 --- /dev/null +++ b/paper-server-generator/src/main/java/io/papermc/generator/utils/ReflectionHelper.java @@ -0,0 +1,39 @@ +package io.papermc.generator.utils; + +import io.papermc.generator.types.EntityMetaWatcherGenerator; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; + +public final class ReflectionHelper { + private ReflectionHelper(){} + + public static List getAllForAllParents(Class clazz, Predicate filter) { + List allClasses = new ArrayList<>(forClass(clazz, filter)); + for (final Class aClass : allParents(clazz)) { + allClasses.addAll(forClass(aClass, filter)); + } + return allClasses; + } + + public static List> allParents(Class clazz){ + List> allClasses = new ArrayList<>(); + Class current = clazz; + while (current.getSuperclass() != null) { + var toAdd = current.getSuperclass(); + if (net.minecraft.world.entity.Entity.class.isAssignableFrom(toAdd)) { + allClasses.add(toAdd); + } + current = toAdd; + } + Collections.reverse(allClasses); + return allClasses; + } + + public static List forClass(Class clazz, Predicate filter) { + return Arrays.stream(clazz.getDeclaredFields()).filter(filter).toList(); + } +} diff --git a/paper-server-generator/wideners.at b/paper-server-generator/wideners.at new file mode 100644 index 0000000000000..6928316973df7 --- /dev/null +++ b/paper-server-generator/wideners.at @@ -0,0 +1,7 @@ +public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess; + +# for auto-marking experimental stuff +public net/minecraft/core/RegistrySetBuilder entries +public net/minecraft/core/RegistrySetBuilder$RegistryStub +public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER +public net/minecraft/data/registries/VanillaRegistries BUILDER diff --git a/patches/api/0477-add-disguise-api.patch b/patches/api/0477-add-disguise-api.patch new file mode 100644 index 0000000000000..f831162465a91 --- /dev/null +++ b/patches/api/0477-add-disguise-api.patch @@ -0,0 +1,210 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yannick Lamprecht +Date: Wed, 27 Dec 2023 14:51:59 +0100 +Subject: [PATCH] add disguise api + + +diff --git a/src/main/java/com/destroystokyo/paper/SkinParts.java b/src/main/java/com/destroystokyo/paper/SkinParts.java +index 4a0c39405d4fbed457787e3c6ded4cc6591bc8c2..c4cc74b95bd1a8378c53a6dee68875991a68bec6 100644 +--- a/src/main/java/com/destroystokyo/paper/SkinParts.java ++++ b/src/main/java/com/destroystokyo/paper/SkinParts.java +@@ -17,4 +17,15 @@ public interface SkinParts { + boolean hasHatsEnabled(); + + int getRaw(); ++ ++ interface Builder { ++ @org.jetbrains.annotations.NotNull Builder withCape(boolean cape); ++ @org.jetbrains.annotations.NotNull Builder withJacket(boolean jacket); ++ @org.jetbrains.annotations.NotNull Builder withLeftSleeve(boolean leftSleeve); ++ @org.jetbrains.annotations.NotNull Builder withRightSleeve(boolean rightSleeve); ++ @org.jetbrains.annotations.NotNull Builder withLeftPants(boolean leftPants); ++ @org.jetbrains.annotations.NotNull Builder withRightPants(boolean rightPants); ++ @org.jetbrains.annotations.NotNull Builder withHat(boolean hat); ++ @org.jetbrains.annotations.NotNull SkinParts build(); ++ } + } +diff --git a/src/main/java/io/papermc/paper/disguise/DisguiseData.java b/src/main/java/io/papermc/paper/disguise/DisguiseData.java +new file mode 100644 +index 0000000000000000000000000000000000000000..3bcc252eac8b47eae54d2dff976eec95670a90d3 +--- /dev/null ++++ b/src/main/java/io/papermc/paper/disguise/DisguiseData.java +@@ -0,0 +1,61 @@ ++package io.papermc.paper.disguise; ++ ++import com.destroystokyo.paper.profile.PlayerProfile; ++import org.bukkit.entity.EntityType; ++import org.jetbrains.annotations.NotNull; ++ ++/** ++ * Represents the data used to disguise an entity as another. ++ * Also supports disguising an entity as a player commonly known as `FakePlayer`. ++ */ ++public sealed interface DisguiseData permits DisguiseData.OriginalDisguise, EntityTypeDisguise, PlayerDisguise { ++ ++ /** ++ * Creates an original disguise data that can be used to reset disguising. ++ *

++ * The original instance is set by default when a new entity is spawned ++ * and represents the state of no disguise should be made. ++ *

++ * Same as {@link #reset()} ++ * ++ * @return an original disguise data ++ */ ++ static @NotNull DisguiseData original() { ++ return reset(); ++ } ++ ++ /** ++ * Creates a {@link PlayerDisguise.Builder} where you can configure certain properties of the fake player appearance. ++ * ++ * ++ * @param playerProfile a already completed player profile that will be the fake players skin ++ * @return a builder to configure certain attributes ++ */ ++ static @NotNull PlayerDisguise.Builder player(@NotNull PlayerProfile playerProfile) { ++ return new PlayerDisguise.Builder(playerProfile); ++ } ++ ++ /** ++ * Creates a {@link EntityTypeDisguise} to allow disguising your entity as the given {@link EntityType}. ++ * ++ * ++ * @param entityType the entity type as which the entity should appear as. ++ * @return an entity disguise ++ */ ++ static @NotNull EntityTypeDisguise entity(@NotNull EntityType entityType) { ++ return new EntityTypeDisguise(entityType); ++ } ++ ++ /** ++ * An alias for {@link #original()} to cover certain views on it. ++ * ++ * @see #original() ++ * ++ * @return an original disguise data ++ */ ++ static @NotNull OriginalDisguise reset() { ++ return new OriginalDisguise(); ++ } ++ ++ record OriginalDisguise() implements DisguiseData{} ++} +diff --git a/src/main/java/io/papermc/paper/disguise/EntityTypeDisguise.java b/src/main/java/io/papermc/paper/disguise/EntityTypeDisguise.java +new file mode 100644 +index 0000000000000000000000000000000000000000..7f63227b1b8bf1e8c98e71979feeeb47bcda0d8b +--- /dev/null ++++ b/src/main/java/io/papermc/paper/disguise/EntityTypeDisguise.java +@@ -0,0 +1,13 @@ ++package io.papermc.paper.disguise; ++ ++import java.util.Objects; ++import org.bukkit.entity.EntityType; ++import org.jetbrains.annotations.ApiStatus; ++import org.jetbrains.annotations.NotNull; ++ ++@ApiStatus.Internal ++public record EntityTypeDisguise(@NotNull EntityType entityType) implements DisguiseData { ++ public EntityTypeDisguise { ++ Objects.requireNonNull(entityType, "type cannot be null"); ++ } ++} +diff --git a/src/main/java/io/papermc/paper/disguise/PlayerDisguise.java b/src/main/java/io/papermc/paper/disguise/PlayerDisguise.java +new file mode 100644 +index 0000000000000000000000000000000000000000..24afc6a26d9b19c647a55d80e845fa9adcf07a63 +--- /dev/null ++++ b/src/main/java/io/papermc/paper/disguise/PlayerDisguise.java +@@ -0,0 +1,63 @@ ++package io.papermc.paper.disguise; ++ ++import com.destroystokyo.paper.SkinParts; ++import com.destroystokyo.paper.profile.PlayerProfile; ++import java.util.Objects; ++import org.bukkit.Server; ++import org.jetbrains.annotations.ApiStatus; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ ++@ApiStatus.Internal ++public record PlayerDisguise(@NotNull PlayerProfile playerProfile, boolean listed, @Nullable SkinParts skinParts) implements DisguiseData { ++ ++ public PlayerDisguise { ++ Objects.requireNonNull(playerProfile, "profile cannot be null"); ++ } ++ public static @NotNull Builder builder(@NotNull PlayerProfile playerProfile) { ++ return new Builder(playerProfile); ++ } ++ ++ /** ++ * Represents the builder to configure certain appearance settings. ++ */ ++ public static class Builder { ++ private final PlayerProfile playerProfile; ++ private boolean listed; ++ private SkinParts skinParts; ++ ++ @ApiStatus.Internal ++ public Builder(@NotNull PlayerProfile playerProfile) { ++ this.playerProfile = playerProfile; ++ } ++ ++ /** ++ * Defines if the fake player will be shown in player list. ++ * ++ * @param listed true, if the player should be listed else false ++ * @return the builder instance ++ */ ++ public @NotNull Builder listed(boolean listed) { ++ this.listed = listed; ++ return this; ++ } ++ ++ /** ++ * Defines which skin parts should be enabled for the fake player. ++ *

++ * Use {@link Server#newSkinPartsBuilder()} to get a fresh builder instance for configuration. ++ * ++ * @param skinParts the skin parts that should be shown. ++ * @return the builder instance ++ */ ++ public @NotNull Builder skinParts(@NotNull SkinParts skinParts) { ++ this.skinParts = skinParts; ++ return this; ++ } ++ ++ @ApiStatus.Internal ++ public @NotNull PlayerDisguise build() { ++ return new PlayerDisguise(playerProfile, listed, skinParts); ++ } ++ } ++} +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index 27084402cf0e46dcd171074629b7c4156e48aa44..6fc54f9f8414808a9250235f179bd068802d2a1c 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -2537,4 +2537,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + */ + boolean isOwnedByCurrentRegion(@NotNull Entity entity); + // Paper end - Folia region threading API ++ // Paper start - add disguise api ++ /** ++ * Creates a new skinparts builder used for overriding skin settings ++ * @return a new builder for skin parts ++ */ ++ com.destroystokyo.paper.SkinParts.@NotNull Builder newSkinPartsBuilder(); ++ // Paper end - add disguise api + } +diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java +index 62e3793903905b94eb1a120345015149abb33713..fd73fa94b1bd7418c5f87254bab093c27d68b8e0 100644 +--- a/src/main/java/org/bukkit/entity/Entity.java ++++ b/src/main/java/org/bukkit/entity/Entity.java +@@ -1155,4 +1155,8 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent + */ + @NotNull String getScoreboardEntryName(); + // Paper end - entity scoreboard name ++ // Paper start - disguise api ++ @NotNull io.papermc.paper.disguise.DisguiseData getDisguiseData(); ++ void setDisguiseData(@NotNull io.papermc.paper.disguise.DisguiseData disguiseData); ++ // Paper end - disguise api + } diff --git a/patches/server/1046-add-paper-server-generator-dependency.patch b/patches/server/1046-add-paper-server-generator-dependency.patch new file mode 100644 index 0000000000000..03325fff3ffb7 --- /dev/null +++ b/patches/server/1046-add-paper-server-generator-dependency.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yannick Lamprecht +Date: Mon, 11 Mar 2024 00:52:56 +0100 +Subject: [PATCH] add paper server generator dependency + + +diff --git a/build.gradle.kts b/build.gradle.kts +index 5d448d8a7cf6626a11791f30ad52baf41a099272..32392d95d34ac62a78c0eb1d6c1dd701dd76e9ad 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -63,6 +63,22 @@ dependencies { + // Paper end - Remap reflection + } + ++// Paper start ++val generatedServerPath: java.nio.file.Path = rootProject.projectDir.toPath().resolve("paper-server-generator/generated") ++idea { ++ module { ++ generatedSourceDirs.add(generatedServerPath.toFile()) ++ } ++} ++sourceSets { ++ main { ++ java { ++ srcDir(generatedServerPath) ++ } ++ } ++} ++// Paper end ++ + paperweight { + craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment + } diff --git a/patches/server/1047-add-disguise-api.patch b/patches/server/1047-add-disguise-api.patch new file mode 100644 index 0000000000000..e3de36074af9d --- /dev/null +++ b/patches/server/1047-add-disguise-api.patch @@ -0,0 +1,276 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yannick Lamprecht +Date: Sat, 16 Mar 2024 22:58:19 +0100 +Subject: [PATCH] add disguise api + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperSkinParts.java b/src/main/java/com/destroystokyo/paper/PaperSkinParts.java +index b6f4400df3d8ec7e06a996de54f8cabba57885e1..23a6026dda4ce5befa1d5e78b0434c2738555ff9 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperSkinParts.java ++++ b/src/main/java/com/destroystokyo/paper/PaperSkinParts.java +@@ -71,4 +71,81 @@ public class PaperSkinParts implements SkinParts { + .add("hats=" + hasHatsEnabled()) + .toString(); + } ++ ++ public static SkinParts.Builder builder(){ ++ return new Builder(); ++ } ++ ++ public static class Builder implements SkinParts.Builder { ++ ++ private boolean cape; ++ private boolean jacket; ++ private boolean leftSleeve; ++ private boolean rightSleeve; ++ private boolean leftPants; ++ private boolean rightPants; ++ private boolean hats; ++ ++ private static final int CAPE = 0x01; ++ private static final int JACKET = 0x02; ++ private static final int LEFT_SLEEVE = 0x04; ++ private static final int RIGHT_SLEEVE = 0x08; ++ private static final int LEFT_PANTS = 0x10; ++ private static final int RIGHT_PANTS = 0x20; ++ private static final int HAT = 0x40; ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withCape(boolean cape) { ++ this.cape = cape; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withJacket(boolean jacket) { ++ this.jacket = jacket; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withLeftSleeve(boolean leftSleeve) { ++ this.leftSleeve = leftSleeve; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withRightSleeve(boolean rightSleeve) { ++ this.rightSleeve = rightSleeve; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withLeftPants(boolean leftPants) { ++ this.leftPants = leftPants; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withRightPants(boolean rightPants) { ++ this.rightPants = rightPants; ++ return this; ++ } ++ ++ @Override ++ public @org.jetbrains.annotations.NotNull Builder withHat(boolean hat) { ++ this.hats = hat; ++ return this; ++ } ++ ++ public @org.jetbrains.annotations.NotNull SkinParts build() { ++ int raw = 0; ++ if (cape) raw |= CAPE; ++ if (jacket) raw |= JACKET; ++ if (leftSleeve) raw |= LEFT_SLEEVE; ++ if (rightSleeve) raw |= RIGHT_SLEEVE; ++ if (leftPants) raw |= LEFT_PANTS; ++ if (rightPants) raw |= RIGHT_PANTS; ++ if (hats) raw |= HAT; ++ return new PaperSkinParts(raw); ++ } ++ } + } +diff --git a/src/main/java/io/papermc/paper/disguise/DisguiseUtil.java b/src/main/java/io/papermc/paper/disguise/DisguiseUtil.java +new file mode 100644 +index 0000000000000000000000000000000000000000..7946de1c8b5bd2927d65d0376ccc65c3adffb79c +--- /dev/null ++++ b/src/main/java/io/papermc/paper/disguise/DisguiseUtil.java +@@ -0,0 +1,88 @@ ++package io.papermc.paper.disguise; ++ ++import com.destroystokyo.paper.profile.CraftPlayerProfile; ++import com.destroystokyo.paper.profile.PlayerProfile; ++import java.util.EnumSet; ++import java.util.List; ++import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; ++import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket; ++import net.minecraft.network.syncher.EntityDataAccessor; ++import net.minecraft.network.syncher.SynchedEntityData; ++import net.minecraft.server.level.ServerPlayer; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityType; ++import net.minecraft.world.entity.player.Player; ++import net.minecraft.world.phys.Vec3; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.entity.CraftEntityType; ++ ++import static net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.Action; ++import static net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.Entry; ++ ++public final class DisguiseUtil { ++ private DisguiseUtil(){} ++ ++ public static boolean tryDisguise(ServerPlayer player, Entity entity, ClientboundAddEntityPacket clientboundAddEntityPacket) { ++ return switch (entity.getBukkitEntity().getDisguiseData()) { ++ case DisguiseData.OriginalDisguise disguise -> false; ++ case io.papermc.paper.disguise.EntityTypeDisguise(var type) -> { ++ player.connection.send(create(clientboundAddEntityPacket, CraftEntityType.bukkitToMinecraft(type))); ++ yield true; ++ } ++ case PlayerDisguise(var playerProfile, var listed, var skinParts) -> { ++ PlayerProfile adapted = Bukkit.createProfile(entity.getUUID(), entity.hasCustomName() ? entity.getBukkitEntity().getCustomName() : playerProfile.getName()); ++ adapted.setProperties(playerProfile.getProperties()); ++ Entry playerUpdate = new Entry( ++ entity.getUUID(), ++ CraftPlayerProfile.asAuthlibCopy(adapted), ++ listed, ++ 0, ++ net.minecraft.world.level.GameType.DEFAULT_MODE, ++ entity.getCustomName(), ++ null ++ ); ++ player.connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(Action.ADD_PLAYER), playerUpdate)); ++ player.connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(Action.UPDATE_LISTED), playerUpdate)); ++ player.connection.send(create(clientboundAddEntityPacket, net.minecraft.world.entity.EntityType.PLAYER)); ++ if(skinParts != null) { ++ player.connection.send(new net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket( ++ clientboundAddEntityPacket.getId(), ++ List.of(new SynchedEntityData.DataItem<>(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) skinParts.getRaw()).value()) ++ )); ++ } ++ yield true; ++ } ++ }; ++ } ++ ++ private static ClientboundAddEntityPacket create(ClientboundAddEntityPacket packet, EntityType entityType) { ++ return new net.minecraft.network.protocol.game.ClientboundAddEntityPacket( ++ packet.getId(), ++ packet.getUUID(), ++ packet.getX(), ++ packet.getY(), ++ packet.getZ(), ++ packet.getXRot(), ++ packet.getYRot(), ++ entityType, ++ 0, ++ Vec3.ZERO.add(packet.getX(), packet.getY(), packet.getZ()).scale(1/8000.0D), ++ packet.getYHeadRot() ++ ); ++ } ++ ++ ++ public static boolean shouldSkip(Entity entity, EntityDataAccessor dataAccessor) { ++ return switch (entity.getBukkitEntity().getDisguiseData()) { ++ case DisguiseData.OriginalDisguise original -> false; ++ case EntityTypeDisguise entityTypeDisguise -> !io.papermc.paper.entity.meta.EntityMetaWatcher.isValidForClass( ++ CraftEntityType.bukkitToMinecraft(entityTypeDisguise.entityType()).getBaseClass(), ++ dataAccessor ++ ); ++ case PlayerDisguise playerDisguise -> !io.papermc.paper.entity.meta.EntityMetaWatcher.isValidForClass( ++ ServerPlayer.class, ++ dataAccessor ++ ); ++ }; ++ } ++} +diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java +index 0f99733660f91280e4c6262cf75b3c9cae86f65a..c49606b5f8e459a1574c3111c10f2c66c0888f87 100644 +--- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java ++++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java +@@ -100,6 +100,7 @@ public class SynchedEntityData { + + if (datawatcher_item.isDirty()) { + datawatcher_item.setDirty(false); ++ if (io.papermc.paper.disguise.DisguiseUtil.shouldSkip((net.minecraft.world.entity.Entity) entity, datawatcher_item.getAccessor())) continue; // Paper - disguise api + list.add(datawatcher_item.value()); + } + } +@@ -117,6 +118,7 @@ public class SynchedEntityData { + for (int j = 0; j < i; ++j) { + SynchedEntityData.DataItem datawatcher_item = adatawatcher_item[j]; + ++ if (io.papermc.paper.disguise.DisguiseUtil.shouldSkip((net.minecraft.world.entity.Entity) entity, datawatcher_item.getAccessor())) continue; // Paper - disguise api + if (!datawatcher_item.isSetToDefault()) { + if (list == null) { + list = new ArrayList(); +@@ -136,6 +138,7 @@ public class SynchedEntityData { + SynchedEntityData.DataValue datawatcher_c = (SynchedEntityData.DataValue) iterator.next(); + SynchedEntityData.DataItem datawatcher_item = this.itemsById[datawatcher_c.id]; + ++ if (io.papermc.paper.disguise.DisguiseUtil.shouldSkip((net.minecraft.world.entity.Entity) entity, datawatcher_item.getAccessor())) continue; // Paper - disguise api + this.assignValue(datawatcher_item, datawatcher_c); + this.entity.onSyncedDataUpdated(datawatcher_item.getAccessor()); + } +@@ -158,6 +161,7 @@ public class SynchedEntityData { + public List> packAll() { + final List> list = new ArrayList<>(); + for (final DataItem dataItem : this.itemsById) { ++ if (io.papermc.paper.disguise.DisguiseUtil.shouldSkip((net.minecraft.world.entity.Entity) entity, dataItem.getAccessor())) continue; // Paper - disguise api + list.add(dataItem.value()); + } + +diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java +index 4f103f731623a8570238a6867fda1c5f83fca4e4..eb2b634da88ad5fba0e19fa5c3ff021263fb72ed 100644 +--- a/src/main/java/net/minecraft/server/level/ServerEntity.java ++++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +@@ -308,7 +308,11 @@ public class ServerEntity { + Packet packet = this.entity.getAddEntityPacket(); + + this.yHeadRotp = Mth.floor(this.entity.getYHeadRot() * 256.0F / 360.0F); ++ // Paper start - disguise api ++ if(!io.papermc.paper.disguise.DisguiseUtil.tryDisguise(player, entity, (net.minecraft.network.protocol.game.ClientboundAddEntityPacket) packet)){ + sender.accept(packet); ++ } ++ // Paper end - disguise api + if (this.trackedDataValues != null) { + sender.accept(new ClientboundSetEntityDataPacket(this.entity.getId(), this.trackedDataValues)); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 05e304f9fc8d0291fa779da589bd060ef4165b49..9165271e974103b9c53a3319959c11b164f38a20 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -379,6 +379,12 @@ public final class CraftServer implements Server { + return io.papermc.paper.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw()); + } + // Paper end - Folia reagion threading API ++ // Paper start - add disguise api ++ @Override ++ public com.destroystokyo.paper.SkinParts.@org.jetbrains.annotations.NotNull Builder newSkinPartsBuilder() { ++ return com.destroystokyo.paper.PaperSkinParts.builder(); ++ } ++ // Paper end - add disguise api + + static { + ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index a2d336ceb52b63db5c03432ee7bc94dc6a742b82..ba8a0c525505d0211666304c698e19312ae07470 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -1280,4 +1280,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + return this.getHandle().getScoreboardName(); + } + // Paper end - entity scoreboard name ++ // Paper start - disguise api ++ private io.papermc.paper.disguise.DisguiseData disguiseData = io.papermc.paper.disguise.DisguiseData.original(); ++ @Override ++ public @org.jetbrains.annotations.NotNull io.papermc.paper.disguise.DisguiseData getDisguiseData() { ++ return disguiseData; ++ } ++ ++ @Override ++ public void setDisguiseData(@org.jetbrains.annotations.NotNull io.papermc.paper.disguise.DisguiseData disguiseData) { ++ this.disguiseData = disguiseData; ++ } ++ // Paper end - disguise api + } diff --git a/settings.gradle.kts b/settings.gradle.kts index 706a83d5dd660..ef56e500679c2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,6 +41,7 @@ for (name in listOf("Paper-API", "Paper-Server", "Paper-MojangAPI")) { optionalInclude("test-plugin") optionalInclude("paper-api-generator") +optionalInclude("paper-server-generator") fun optionalInclude(name: String, op: (ProjectDescriptor.() -> Unit)? = null) { val settingsFile = file("$name.settings.gradle.kts")