From 501f65e2165ab383a893a0f01bb00c091131c62f Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 11 May 2024 16:08:02 +0200 Subject: [PATCH] Packet and entity type renames Use Mojang mapped names for packet types to be consistent with functionality and easy to look up --- .../minecraft/entities/EntityTypes1_14.java | 124 +++++++------- .../minecraft/entities/EntityTypes1_15.java | 124 +++++++------- .../minecraft/entities/EntityTypes1_16.java | 124 +++++++------- .../minecraft/entities/EntityTypes1_16_2.java | 124 +++++++------- .../minecraft/entities/EntityTypes1_17.java | 124 +++++++------- .../minecraft/entities/EntityTypes1_19.java | 128 +++++++------- .../minecraft/entities/EntityTypes1_19_3.java | 128 +++++++------- .../minecraft/entities/EntityTypes1_19_4.java | 128 +++++++------- .../minecraft/entities/EntityTypes1_20_3.java | 130 +++++++------- .../minecraft/entities/EntityTypes1_20_5.java | 130 +++++++------- .../protocol1_9to1_8/ArmorListener.java | 2 +- .../protocol1_9to1_8/DeathListener.java | 2 +- .../EntityToggleGlideListener.java | 2 +- .../bungee/handlers/BungeeServerHandler.java | 2 +- .../bungee/listeners/ElytraPatch.java | 2 +- .../viaversion/legacy/bossbar/CommonBoss.java | 2 +- .../v1_10to1_11/Protocol1_10To1_11.java | 26 +-- .../metadata/MetadataRewriter1_11To1_10.java | 2 +- .../rewriter/ItemPacketRewriter1_11.java | 12 +- .../v1_11_1to1_12/Protocol1_11_1To1_12.java | 24 +-- .../packet/ClientboundPackets1_12.java | 126 +++++++------- .../packet/ServerboundPackets1_12.java | 60 +++---- .../rewriter/ItemPacketRewriter1_12.java | 12 +- .../rewriter/ItemPacketRewriter1_11_1.java | 2 +- .../v1_12_2to1_13/Protocol1_12_2To1_13.java | 62 +++---- .../blockconnections/ConnectionData.java | 4 +- .../packet/ClientboundPackets1_13.java | 138 +++++++-------- .../packet/ServerboundPackets1_13.java | 72 ++++---- .../providers/BlockEntityProvider.java | 2 +- .../rewriter/EntityPacketRewriter1_13.java | 14 +- .../rewriter/ItemPacketRewriter1_13.java | 16 +- .../rewriter/WorldPacketRewriter1_13.java | 24 +-- .../storage/TabCompleteTracker.java | 2 +- .../v1_12to1_12_1/Protocol1_12To1_12_1.java | 2 +- .../packet/ClientboundPackets1_12_1.java | 128 +++++++------- .../packet/ServerboundPackets1_12_1.java | 60 +++---- .../Protocol1_13_1To1_13_2.java | 2 +- .../rewriter/EntityPacketRewriter1_13_2.java | 6 +- .../rewriter/ItemPacketRewriter1_13_2.java | 14 +- .../rewriter/WorldPacketRewriter1_13_2.java | 2 +- .../v1_13_2to1_14/Protocol1_13_2To1_14.java | 12 +- .../MetadataRewriter1_14To1_13_2.java | 12 +- .../packet/ClientboundPackets1_14.java | 148 ++++++++-------- .../packet/ServerboundPackets1_14.java | 76 ++++---- .../rewriter/EntityPacketRewriter1_14.java | 26 +-- .../rewriter/ItemPacketRewriter1_14.java | 28 +-- .../rewriter/PlayerPackets1_14.java | 14 +- .../rewriter/WorldPacketRewriter1_14.java | 28 +-- .../v1_13to1_13_1/Protocol1_13To1_13_1.java | 10 +- .../rewriter/EntityPacketRewriter1_13_1.java | 10 +- .../rewriter/ItemPacketRewriter1_13_1.java | 18 +- .../rewriter/WorldPacketRewriter1_13_1.java | 12 +- .../Protocol1_14_2To1_14_3.java | 2 +- .../Protocol1_14_3To1_14_4.java | 2 +- .../packet/ClientboundPackets1_14_4.java | 150 ++++++++-------- .../v1_14_4to1_15/Protocol1_14_4To1_15.java | 6 +- .../MetadataRewriter1_15To1_14_4.java | 4 +- .../packet/ClientboundPackets1_15.java | 150 ++++++++-------- .../rewriter/EntityPacketRewriter1_15.java | 14 +- .../rewriter/ItemPacketRewriter1_15.java | 16 +- .../rewriter/WorldPacketRewriter1_15.java | 14 +- .../rewriter/EntityPacketRewriter1_14_1.java | 8 +- .../v1_15_2to1_16/Protocol1_15_2To1_16.java | 22 +-- .../MetadataRewriter1_16To1_15_2.java | 2 +- .../packet/ClientboundPackets1_16.java | 148 ++++++++-------- .../packet/ServerboundPackets1_16.java | 78 ++++----- .../rewriter/EntityPacketRewriter1_16.java | 18 +- .../rewriter/ItemPacketRewriter1_16.java | 28 +-- .../rewriter/WorldPacketRewriter1_16.java | 14 +- .../Protocol1_16_1To1_16_2.java | 10 +- .../MetadataRewriter1_16_2To1_16_1.java | 2 +- .../packet/ClientboundPackets1_16_2.java | 148 ++++++++-------- .../packet/ServerboundPackets1_16_2.java | 80 ++++----- .../rewriter/EntityPacketRewriter1_16_2.java | 12 +- .../rewriter/ItemPacketRewriter1_16_2.java | 20 +-- .../rewriter/WorldPacketRewriter1_16_2.java | 14 +- .../v1_16_4to1_17/Protocol1_16_4To1_17.java | 24 +-- .../packet/ClientboundPackets1_17.java | 162 +++++++++--------- .../packet/ServerboundPackets1_17.java | 78 ++++----- .../rewriter/EntityPacketRewriter1_17.java | 26 +-- .../rewriter/ItemPacketRewriter1_17.java | 22 +-- .../rewriter/WorldPacketRewriter1_17.java | 30 ++-- .../v1_17_1to1_18/Protocol1_17_1To1_18.java | 8 +- .../packet/ClientboundPackets1_18.java | 162 +++++++++--------- .../rewriter/EntityPacketRewriter1_18.java | 4 +- .../rewriter/ItemPacketRewriter1_18.java | 20 +-- .../rewriter/WorldPacketRewriter1_18.java | 7 +- .../v1_17to1_17_1/Protocol1_17To1_17_1.java | 6 +- .../packet/ClientboundPackets1_17_1.java | 162 +++++++++--------- .../v1_18_2to1_19/Protocol1_18_2To1_19.java | 26 +-- .../packet/ClientboundPackets1_19.java | 154 ++++++++--------- .../packet/ServerboundPackets1_19.java | 78 ++++----- .../rewriter/EntityPacketRewriter1_19.java | 18 +- .../rewriter/ItemPacketRewriter1_19.java | 24 +-- .../rewriter/WorldPacketRewriter1_19.java | 14 +- .../v1_18to1_18_2/Protocol1_18To1_18_2.java | 8 +- .../Protocol1_19_1To1_19_3.java | 14 +- .../packet/ClientboundPackets1_19_3.java | 154 ++++++++--------- .../packet/ServerboundPackets1_19_3.java | 78 ++++----- .../rewriter/EntityPacketRewriter1_19_3.java | 12 +- .../rewriter/ItemPacketRewriter1_19_3.java | 32 ++-- .../Protocol1_19_3To1_19_4.java | 8 +- .../packet/ClientboundPackets1_19_4.java | 160 ++++++++--------- .../packet/ServerboundPackets1_19_4.java | 78 ++++----- .../rewriter/EntityPacketRewriter1_19_4.java | 20 +-- .../rewriter/ItemPacketRewriter1_19_4.java | 32 ++-- .../v1_19_4to1_20/Protocol1_19_4To1_20.java | 10 +- .../rewriter/EntityPacketRewriter1_20.java | 8 +- .../rewriter/ItemPacketRewriter1_20.java | 36 ++-- .../v1_19to1_19_1/Protocol1_19To1_19_1.java | 4 +- .../packet/ClientboundPackets1_19_1.java | 156 ++++++++--------- .../packet/ServerboundPackets1_19_1.java | 78 ++++----- .../Protocol1_20_2To1_20_3.java | 36 ++-- .../packet/ClientboundPackets1_20_3.java | 158 ++++++++--------- .../packet/ServerboundPackets1_20_3.java | 78 ++++----- .../BlockItemPacketRewriter1_20_3.java | 30 ++-- .../rewriter/EntityPacketRewriter1_20_3.java | 10 +- .../Protocol1_20_3To1_20_5.java | 12 +- .../packet/ClientboundPackets1_20_5.java | 158 ++++++++--------- .../packet/ServerboundPackets1_20_5.java | 78 ++++----- .../BlockItemPacketRewriter1_20_5.java | 34 ++-- .../rewriter/EntityPacketRewriter1_20_5.java | 16 +- .../v1_20to1_20_2/Protocol1_20To1_20_2.java | 20 +-- .../packet/ClientboundPackets1_20_2.java | 158 ++++++++--------- .../packet/ServerboundPackets1_20_2.java | 78 ++++----- .../BlockItemPacketRewriter1_20_2.java | 34 ++-- .../rewriter/EntityPacketRewriter1_20_2.java | 14 +- .../storage/ConfigurationState.java | 2 +- .../v1_8/packet/ClientboundPackets1_8.java | 116 ++++++------- .../v1_8/packet/ServerboundPackets1_8.java | 48 +++--- .../packet/ClientboundPackets1_9.java | 122 ++++++------- .../packet/ServerboundPackets1_9.java | 54 +++--- .../providers/CommandBlockProvider.java | 2 +- .../MovementTransmitterProvider.java | 2 +- .../rewriter/EntityPacketRewriter1_9.java | 24 +-- .../rewriter/ItemPacketRewriter1_9.java | 24 +-- .../v1_8to1_9/rewriter/PlayerPackets1_9.java | 34 ++-- .../v1_8to1_9/rewriter/SpawnPackets1_9.java | 18 +- .../rewriter/WorldPacketRewriter1_9.java | 24 +-- .../v1_8to1_9/storage/EntityTracker1_9.java | 6 +- .../v1_9_1to1_9_3/Protocol1_9_1To1_9_3.java | 4 +- .../packet/ClientboundPackets1_9_3.java | 122 ++++++------- .../packet/ServerboundPackets1_9_3.java | 54 +++--- .../v1_9_3to1_10/Protocol1_9_3To1_10.java | 14 +- .../rewriter/ItemPacketRewriter1_10.java | 2 +- .../v1_9to1_9_1/Protocol1_9To1_9_1.java | 2 +- .../template/protocols/Protocol1_99To_98.java | 8 +- .../rewriter/BlockItemPacketRewriter1_99.java | 32 ++-- .../rewriter/EntityPacketRewriter1_99.java | 8 +- 149 files changed, 3497 insertions(+), 3496 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java index 9d16033f1..3eb72a246 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java @@ -43,26 +43,26 @@ public enum EntityTypes1_14 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -75,61 +75,61 @@ public enum EntityTypes1_14 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), + PATHFINDER_MOB(MOB, null), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), - SQUID(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), + SQUID(WATER_ANIMAL), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -147,25 +147,25 @@ public enum EntityTypes1_14 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -197,12 +197,12 @@ public enum EntityTypes1_14 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java index ecdf1fcde..13016af32 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java @@ -43,26 +43,26 @@ public enum EntityTypes1_15 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -75,61 +75,61 @@ public enum EntityTypes1_15 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), + PATHFINDER_MOB(MOB, null), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), - SQUID(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), + SQUID(WATER_ANIMAL), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -148,25 +148,25 @@ public enum EntityTypes1_15 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -198,12 +198,12 @@ public enum EntityTypes1_15 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java index 7039c4de2..27af3eeaf 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java @@ -43,26 +43,26 @@ public enum EntityTypes1_16 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -75,61 +75,61 @@ public enum EntityTypes1_16 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), + PATHFINDER_MOB(MOB, null), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), - SQUID(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), + SQUID(WATER_ANIMAL), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -150,25 +150,25 @@ public enum EntityTypes1_16 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -202,12 +202,12 @@ public enum EntityTypes1_16 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java index aa8e2fb3a..ee0fe9cf7 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java @@ -43,26 +43,26 @@ public enum EntityTypes1_16_2 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -75,61 +75,61 @@ public enum EntityTypes1_16_2 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), + PATHFINDER_MOB(MOB, null), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), - SQUID(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), + SQUID(WATER_ANIMAL), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -150,25 +150,25 @@ public enum EntityTypes1_16_2 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -205,12 +205,12 @@ public enum EntityTypes1_16_2 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java index f942bbe07..1fda2142c 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java @@ -44,27 +44,27 @@ public enum EntityTypes1_17 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -77,63 +77,63 @@ public enum EntityTypes1_17 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), + PATHFINDER_MOB(MOB, null), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -156,25 +156,25 @@ public enum EntityTypes1_17 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -211,12 +211,12 @@ public enum EntityTypes1_17 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java index 885a31900..d9f9c63e4 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java @@ -44,27 +44,27 @@ public enum EntityTypes1_19 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -77,66 +77,66 @@ public enum EntityTypes1_19 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), CHEST_BOAT(BOAT), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), - ALLAY(ABSTRACT_CREATURE), + PATHFINDER_MOB(MOB, null), + ALLAY(PATHFINDER_MOB), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), - TADPOLE(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), + TADPOLE(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -160,25 +160,25 @@ public enum EntityTypes1_19 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -216,12 +216,12 @@ public enum EntityTypes1_19 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java index 646de4ba7..6f26e2d30 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java @@ -44,27 +44,27 @@ public enum EntityTypes1_19_3 implements EntityType { LIGHTNING_BOLT(ENTITY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -77,66 +77,66 @@ public enum EntityTypes1_19_3 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), CHEST_BOAT(BOAT), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), - ALLAY(ABSTRACT_CREATURE), + PATHFINDER_MOB(MOB, null), + ALLAY(PATHFINDER_MOB), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), - TADPOLE(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), + TADPOLE(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -160,11 +160,11 @@ public enum EntityTypes1_19_3 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), @@ -172,14 +172,14 @@ public enum EntityTypes1_19_3 implements EntityType { ZOMBIE_HORSE(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -217,12 +217,12 @@ public enum EntityTypes1_19_3 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java index da6a0420b..e41f89cf7 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java @@ -50,27 +50,27 @@ public enum EntityTypes1_19_4 implements EntityType { TEXT_DISPLAY(DISPLAY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -83,66 +83,66 @@ public enum EntityTypes1_19_4 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), CHEST_BOAT(BOAT), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), - ALLAY(ABSTRACT_CREATURE), + PATHFINDER_MOB(MOB, null), + ALLAY(PATHFINDER_MOB), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), - TADPOLE(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), + TADPOLE(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -167,11 +167,11 @@ public enum EntityTypes1_19_4 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), @@ -179,14 +179,14 @@ public enum EntityTypes1_19_4 implements EntityType { ZOMBIE_HORSE(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -224,12 +224,12 @@ public enum EntityTypes1_19_4 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_3.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_3.java index 14fb9ea6b..59bb50734 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_3.java @@ -50,28 +50,28 @@ public enum EntityTypes1_20_3 implements EntityType { TEXT_DISPLAY(DISPLAY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball - WIND_CHARGE(PROJECTILE_ABSTRACT), + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball + WIND_CHARGE(PROJECTILE), - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -84,66 +84,66 @@ public enum EntityTypes1_20_3 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), CHEST_BOAT(BOAT), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), - ALLAY(ABSTRACT_CREATURE), + PATHFINDER_MOB(MOB, null), + ALLAY(PATHFINDER_MOB), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), - TADPOLE(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), + TADPOLE(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -168,11 +168,11 @@ public enum EntityTypes1_20_3 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), @@ -180,14 +180,14 @@ public enum EntityTypes1_20_3 implements EntityType { ZOMBIE_HORSE(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -226,12 +226,12 @@ public enum EntityTypes1_20_3 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java index 1e1c65099..2c3f24728 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java @@ -51,27 +51,27 @@ public enum EntityTypes1_20_5 implements EntityType { TEXT_DISPLAY(DISPLAY), // Hanging entities - ABSTRACT_HANGING(ENTITY, null), - LEASH_KNOT(ABSTRACT_HANGING), - PAINTING(ABSTRACT_HANGING), - ITEM_FRAME(ABSTRACT_HANGING), + HANGING_ENTITY(ENTITY, null), + LEASH_KNOT(HANGING_ENTITY), + PAINTING(HANGING_ENTITY), + ITEM_FRAME(HANGING_ENTITY), GLOW_ITEM_FRAME(ITEM_FRAME), // Projectiles - PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing - SNOWBALL(PROJECTILE_ABSTRACT), - ENDER_PEARL(PROJECTILE_ABSTRACT), - EGG(PROJECTILE_ABSTRACT), - POTION(PROJECTILE_ABSTRACT), - EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - FIREWORK_ROCKET(PROJECTILE_ABSTRACT), - LLAMA_SPIT(PROJECTILE_ABSTRACT), - SHULKER_BULLET(PROJECTILE_ABSTRACT), - FISHING_BOBBER(PROJECTILE_ABSTRACT), - WITHER_SKULL(PROJECTILE_ABSTRACT), - DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball + PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing + SNOWBALL(PROJECTILE), + ENDER_PEARL(PROJECTILE), + EGG(PROJECTILE), + POTION(PROJECTILE), + EXPERIENCE_BOTTLE(PROJECTILE), + FIREWORK_ROCKET(PROJECTILE), + LLAMA_SPIT(PROJECTILE), + SHULKER_BULLET(PROJECTILE), + FISHING_BOBBER(PROJECTILE), + WITHER_SKULL(PROJECTILE), + DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball - ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), + ABSTRACT_ARROW(PROJECTILE, null), ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW), @@ -80,7 +80,7 @@ public enum EntityTypes1_20_5 implements EntityType { FIREBALL(ABSTRACT_FIREBALL), SMALL_FIREBALL(ABSTRACT_FIREBALL), - ABSTRACT_WIND_CHARGE(PROJECTILE_ABSTRACT, null), + ABSTRACT_WIND_CHARGE(PROJECTILE, null), WIND_CHARGE(ABSTRACT_WIND_CHARGE), BREEZE_WIND_CHARGE(ABSTRACT_WIND_CHARGE), @@ -88,66 +88,66 @@ public enum EntityTypes1_20_5 implements EntityType { VEHICLE(ENTITY, null), BOAT(VEHICLE), - MINECART_ABSTRACT(VEHICLE, null), - MINECART(MINECART_ABSTRACT), - FURNACE_MINECART(MINECART_ABSTRACT), - COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), - TNT_MINECART(MINECART_ABSTRACT), - SPAWNER_MINECART(MINECART_ABSTRACT), + ABSTRACT_MINECART(VEHICLE, null), + MINECART(ABSTRACT_MINECART), + FURNACE_MINECART(ABSTRACT_MINECART), + COMMAND_BLOCK_MINECART(ABSTRACT_MINECART), + TNT_MINECART(ABSTRACT_MINECART), + SPAWNER_MINECART(ABSTRACT_MINECART), CHEST_BOAT(BOAT), - CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), - CHEST_MINECART(CHESTED_MINECART_ABSTRACT), - HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), + ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null), + CHEST_MINECART(ABSTRACT_MINECART_CONTAINER), + HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER), // Living entities as a larger subclass - LIVINGENTITY(ENTITY, null), - ARMOR_STAND(LIVINGENTITY), - PLAYER(LIVINGENTITY), + LIVING_ENTITY(ENTITY, null), + ARMOR_STAND(LIVING_ENTITY), + PLAYER(LIVING_ENTITY), // Mobs as a larger subclass - ABSTRACT_INSENTIENT(LIVINGENTITY, null), - ENDER_DRAGON(ABSTRACT_INSENTIENT), + MOB(LIVING_ENTITY, null), + ENDER_DRAGON(MOB), - SLIME(ABSTRACT_INSENTIENT), + SLIME(MOB), MAGMA_CUBE(SLIME), // Ambient mobs - ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), - BAT(ABSTRACT_AMBIENT), + AMBIENT_CREATURE(MOB, null), + BAT(AMBIENT_CREATURE), // Flying mobs - ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), - GHAST(ABSTRACT_FLYING), - PHANTOM(ABSTRACT_FLYING), + FLYING_MOB(MOB, null), + GHAST(FLYING_MOB), + PHANTOM(FLYING_MOB), // Pathfinder mobs and its subclasses - ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), - ALLAY(ABSTRACT_CREATURE), + PATHFINDER_MOB(MOB, null), + ALLAY(PATHFINDER_MOB), - ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), + ABSTRACT_GOLEM(PATHFINDER_MOB, null), SNOW_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM), // Water mobs - ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), - DOLPHIN(ABSTRACT_WATERMOB), + WATER_ANIMAL(PATHFINDER_MOB, null), + DOLPHIN(WATER_ANIMAL), - SQUID(ABSTRACT_WATERMOB), + SQUID(WATER_ANIMAL), GLOW_SQUID(SQUID), - ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), - PUFFERFISH(ABSTRACT_FISHES), - TADPOLE(ABSTRACT_FISHES), + ABSTRACT_FISH(WATER_ANIMAL, null), + PUFFERFISH(ABSTRACT_FISH), + TADPOLE(ABSTRACT_FISH), - ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), + ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null), COD(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), // Ageable mobs and (tamable) animals - ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), + ABSTRACT_AGEABLE(PATHFINDER_MOB, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), VILLAGER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER), @@ -173,11 +173,11 @@ public enum EntityTypes1_20_5 implements EntityType { COW(ABSTRACT_ANIMAL), MOOSHROOM(COW), - ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), - CAT(ABSTRACT_TAMEABLE_ANIMAL), - OCELOT(ABSTRACT_TAMEABLE_ANIMAL), - WOLF(ABSTRACT_TAMEABLE_ANIMAL), - PARROT(ABSTRACT_TAMEABLE_ANIMAL), + TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null), + CAT(TAMABLE_ANIMAL), + OCELOT(TAMABLE_ANIMAL), + WOLF(TAMABLE_ANIMAL), + PARROT(TAMABLE_ANIMAL), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), HORSE(ABSTRACT_HORSE), @@ -185,14 +185,14 @@ public enum EntityTypes1_20_5 implements EntityType { ZOMBIE_HORSE(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE), - CHESTED_HORSE(ABSTRACT_HORSE, null), - DONKEY(CHESTED_HORSE), - MULE(CHESTED_HORSE), - LLAMA(CHESTED_HORSE), + ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null), + DONKEY(ABSTRACT_CHESTED_HORSE), + MULE(ABSTRACT_CHESTED_HORSE), + LLAMA(ABSTRACT_CHESTED_HORSE), TRADER_LLAMA(LLAMA), // Monsters - ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), + ABSTRACT_MONSTER(PATHFINDER_MOB, null), BLAZE(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER), @@ -232,12 +232,12 @@ public enum EntityTypes1_20_5 implements EntityType { WITCH(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER), - ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), - ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), - VINDICATOR(ABSTRACT_ILLAGER_BASE), - PILLAGER(ABSTRACT_ILLAGER_BASE), - EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), - ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); + ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null), + SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null), + VINDICATOR(ABSTRACT_ILLAGER), + PILLAGER(ABSTRACT_ILLAGER), + EVOKER(SPELLCASTER_ILLAGER), + ILLUSIONER(SPELLCASTER_ILLAGER); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private final EntityType parent; diff --git a/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/ArmorListener.java b/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/ArmorListener.java index 5eb5bff0e..8d71c6bc0 100644 --- a/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/ArmorListener.java +++ b/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/ArmorListener.java @@ -59,7 +59,7 @@ public class ArmorListener extends ViaBukkitListener { armor += ArmorType.findById(stack.getTypeId()).getArmorPoints(); } - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_PROPERTIES, null, getUserConnection(player)); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.UPDATE_ATTRIBUTES, null, getUserConnection(player)); wrapper.write(Type.VAR_INT, player.getEntityId()); // Player ID wrapper.write(Type.INT, 1); // only 1 property wrapper.write(Type.STRING, "generic.armor"); diff --git a/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/DeathListener.java b/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/DeathListener.java index efeff951c..cbc7320c0 100644 --- a/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/DeathListener.java +++ b/bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_9to1_8/DeathListener.java @@ -59,7 +59,7 @@ public class DeathListener extends ViaBukkitListener { // If online UserConnection userConnection = getUserConnection(p); if (userConnection != null) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.COMBAT_EVENT, userConnection); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.PLAYER_COMBAT, userConnection); try { wrapper.write(Type.VAR_INT, 2); // Event - Entity dead wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_15to1_14_4/EntityToggleGlideListener.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_15to1_14_4/EntityToggleGlideListener.java index c25d96d64..d17e3f9da 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_15to1_14_4/EntityToggleGlideListener.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/protocol1_15to1_14_4/EntityToggleGlideListener.java @@ -55,7 +55,7 @@ public class EntityToggleGlideListener extends ViaBukkitListener { // Cancelling can only be done by updating the player's metadata if (event.isGliding() && event.isCancelled()) { - PacketWrapper packet = PacketWrapper.create(ClientboundPackets1_15.ENTITY_METADATA, null, getUserConnection(player)); + PacketWrapper packet = PacketWrapper.create(ClientboundPackets1_15.SET_ENTITY_DATA, null, getUserConnection(player)); packet.write(Type.VAR_INT, player.getEntityId()); byte bitmask = 0; diff --git a/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java b/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java index 6701e9267..56ad8d147 100644 --- a/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java +++ b/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java @@ -185,7 +185,7 @@ public class BungeeServerHandler implements Listener { // This ensures we can encode it properly as only the 1.9 protocol is currently implemented. if (user.getProtocolInfo().getPipeline().contains(Protocol1_8To1_9.class)) { for (UUID uuid : storage.getBossbar()) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.BOSSBAR, null, user); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.BOSS_EVENT, null, user); wrapper.write(Type.UUID, uuid); wrapper.write(Type.VAR_INT, 1); // remove wrapper.send(Protocol1_8To1_9.class); diff --git a/bungee/src/main/java/com/viaversion/viaversion/bungee/listeners/ElytraPatch.java b/bungee/src/main/java/com/viaversion/viaversion/bungee/listeners/ElytraPatch.java index 6b1c043e7..82678bd3c 100644 --- a/bungee/src/main/java/com/viaversion/viaversion/bungee/listeners/ElytraPatch.java +++ b/bungee/src/main/java/com/viaversion/viaversion/bungee/listeners/ElytraPatch.java @@ -48,7 +48,7 @@ public class ElytraPatch implements Listener { EntityTracker1_9 tracker = user.getEntityTracker(Protocol1_8To1_9.class); int entityId = tracker.getProvidedEntityId(); - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_METADATA, null, user); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.SET_ENTITY_DATA, null, user); wrapper.write(Type.VAR_INT, entityId); wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0))); diff --git a/common/src/main/java/com/viaversion/viaversion/legacy/bossbar/CommonBoss.java b/common/src/main/java/com/viaversion/viaversion/legacy/bossbar/CommonBoss.java index de21d8dfa..3219afc93 100644 --- a/common/src/main/java/com/viaversion/viaversion/legacy/bossbar/CommonBoss.java +++ b/common/src/main/java/com/viaversion/viaversion/legacy/bossbar/CommonBoss.java @@ -241,7 +241,7 @@ public class CommonBoss implements BossBar { private PacketWrapper getPacket(UpdateAction action, UserConnection connection) { try { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.BOSSBAR, null, connection); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.BOSS_EVENT, null, connection); wrapper.write(Type.UUID, uuid); wrapper.write(Type.VAR_INT, action.getId()); switch (action) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/Protocol1_10To1_11.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/Protocol1_10To1_11.java index 780909b22..01cfc57d0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/Protocol1_10To1_11.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/Protocol1_10To1_11.java @@ -61,7 +61,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol(this, this::getNewSoundId).registerSound(ClientboundPackets1_9_3.SOUND); - registerClientbound(ClientboundPackets1_9_3.COLLECT_ITEM, new PacketHandlers() { + registerClientbound(ClientboundPackets1_9_3.TAKE_ITEM_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Collected entity id @@ -121,9 +121,9 @@ public class Protocol1_10To1_11 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_9_3.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); Chunk chunk = wrapper.passthrough(ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment())); @@ -230,7 +230,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol Trading - protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_9_3.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Channel @@ -67,8 +67,8 @@ public class ItemPacketRewriter1_11 extends ItemRewriter { + registerClientbound(ClientboundPackets1_9_3.CHAT, wrapper -> { if (!Via.getConfig().is1_12NBTArrayFix()) return; final JsonElement element = wrapper.passthrough(Type.COMPONENT); TranslateRewriter.toClient(wrapper.user(), element); @@ -107,7 +107,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_9_3.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); ChunkType1_9_3 type = ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment()); @@ -137,10 +137,10 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol packetWrapper.write(Type.VAR_INT, 0)) + wrapper.create(ClientboundPackets1_13.UPDATE_RECIPES, packetWrapper -> packetWrapper.write(Type.VAR_INT, 0)) .scheduleSend(Protocol1_12_2To1_13.class); } }); @@ -176,10 +176,10 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol Trading - protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_9_3.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Channel @@ -71,7 +71,7 @@ public class ItemPacketRewriter1_12 extends ItemRewriter { // Send fake declare commands - w.create(ClientboundPackets1_13.DECLARE_COMMANDS, wrapper -> { + w.create(ClientboundPackets1_13.COMMANDS, wrapper -> { wrapper.write(Type.VAR_INT, 2); // Size // Write root node wrapper.write(Type.BYTE, (byte) 0); // Mark as command @@ -145,7 +145,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { + w.create(ClientboundPackets1_13.UPDATE_TAGS, wrapper -> { wrapper.write(Type.VAR_INT, MAPPINGS.getBlockTags().size()); // block tags for (Map.Entry tag : MAPPINGS.getBlockTags().entrySet()) { wrapper.write(Type.STRING, tag.getKey()); @@ -200,7 +200,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_12_1.AWARD_STATS, wrapper -> { int size = wrapper.read(Type.VAR_INT); List remappedStats = new ArrayList<>(); for (int i = 0; i < size; i++) { @@ -246,10 +246,10 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_12_1.COMMAND_SUGGESTIONS, wrapper -> { wrapper.write(Type.VAR_INT, wrapper.user().get(TabCompleteTracker.class).getTransactionId()); String input = wrapper.user().get(TabCompleteTracker.class).getInput(); @@ -282,7 +282,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol writeDeclareRecipes(w)).send(Protocol1_12_2To1_13.class); + wrapper.create(ClientboundPackets1_13.UPDATE_RECIPES, w -> writeDeclareRecipes(w)).send(Protocol1_12_2To1_13.class); } }); } @@ -419,7 +419,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_12_1.SET_SCORE, wrapper -> { String displayName = wrapper.read(Type.STRING); // Display Name displayName = rewriteTeamMemberName(displayName); wrapper.write(Type.STRING, displayName); }); - componentRewriter.registerTitle(ClientboundPackets1_12_1.TITLE); + componentRewriter.registerTitle(ClientboundPackets1_12_1.SET_TITLES); // New 0x4C - Stop Sound @@ -506,7 +506,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_12_1.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear int size = wrapper.passthrough(Type.VAR_INT); // Mapping size @@ -545,10 +545,10 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { @@ -584,7 +584,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.EDIT_BOOK, ServerboundPackets1_12_1.PLUGIN_MESSAGE, wrapper -> { + registerServerbound(ServerboundPackets1_13.EDIT_BOOK, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, wrapper -> { Item item = wrapper.read(Type.ITEM1_13); boolean isSigning = wrapper.read(Type.BOOLEAN); @@ -595,14 +595,14 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.PICK_ITEM, ServerboundPackets1_12_1.PLUGIN_MESSAGE, wrapper -> { + registerServerbound(ServerboundPackets1_13.PICK_ITEM, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, wrapper -> { wrapper.write(Type.STRING, "MC|PickItem"); // Channel }); - registerServerbound(ServerboundPackets1_13.CRAFT_RECIPE_REQUEST, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.PLACE_RECIPE, new PacketHandlers() { @Override public void register() { map(Type.BYTE); // Window id @@ -620,7 +620,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.RENAME_ITEM, ServerboundPackets1_12_1.PLUGIN_MESSAGE, wrapper -> { + registerServerbound(ServerboundPackets1_13.RENAME_ITEM, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, wrapper -> { wrapper.write(Type.STRING, "MC|ItemName"); // Channel }); // New 0x1F - Select Trade -> Plugin Message - registerServerbound(ServerboundPackets1_13.SELECT_TRADE, ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.SELECT_TRADE, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { create(Type.STRING, "MC|TrSel"); // Channel @@ -664,7 +664,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.SET_BEACON_EFFECT, ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.SET_BEACON, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { create(Type.STRING, "MC|Beacon"); // Channel @@ -674,7 +674,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.UPDATE_COMMAND_BLOCK, ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.SET_COMMAND_BLOCK, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { create(Type.STRING, "MC|AutoCmd"); // Channel @@ -697,7 +697,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol Plugin Message - registerServerbound(ServerboundPackets1_13.UPDATE_COMMAND_BLOCK_MINECART, ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.SET_COMMAND_MINECART, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { handler(wrapper -> { @@ -711,7 +711,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol 0x24 in InventoryPackets // New 0x25 - Update Structure Block -> Message Channel - registerServerbound(ServerboundPackets1_13.UPDATE_STRUCTURE_BLOCK, ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + registerServerbound(ServerboundPackets1_13.SET_STRUCTURE_BLOCK, ServerboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { create(Type.STRING, "MC|Struct"); // Channel diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/blockconnections/ConnectionData.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/blockconnections/ConnectionData.java index 8720b5d67..23b6d17c0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/blockconnections/ConnectionData.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/blockconnections/ConnectionData.java @@ -88,7 +88,7 @@ public final class ConnectionData { updateBlockStorage(user, pos.x(), pos.y(), pos.z(), newBlockState); - PacketWrapper blockUpdatePacket = PacketWrapper.create(ClientboundPackets1_13.BLOCK_CHANGE, null, user); + PacketWrapper blockUpdatePacket = PacketWrapper.create(ClientboundPackets1_13.BLOCK_UPDATE, null, user); blockUpdatePacket.write(Type.POSITION1_8, pos); blockUpdatePacket.write(Type.VAR_INT, newBlockState); blockUpdatePacket.send(Protocol1_12_2To1_13.class); @@ -719,7 +719,7 @@ public final class ConnectionData { } if (!updates.isEmpty()) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_13.MULTI_BLOCK_CHANGE, null, user); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_13.CHUNK_BLOCKS_UPDATE, null, user); wrapper.write(Type.INT, chunkX + chunkDeltaX); wrapper.write(Type.INT, chunkZ + chunkDeltaZ); wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(EMPTY_RECORDS)); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ClientboundPackets1_13.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ClientboundPackets1_13.java index 4074d0872..19f46dc0e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ClientboundPackets1_13.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ClientboundPackets1_13.java @@ -21,92 +21,92 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_13 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_GLOBAL_ENTITY, // 0x02 - SPAWN_MOB, // 0x03 - SPAWN_PAINTING, // 0x04 - SPAWN_PLAYER, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_GLOBAL_ENTITY, // 0x02 + ADD_MOB, // 0x03 + ADD_PAINTING, // 0x04 + ADD_PLAYER, // 0x05 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - CHAT_MESSAGE, // 0x0E - MULTI_BLOCK_CHANGE, // 0x0F - TAB_COMPLETE, // 0x10 - DECLARE_COMMANDS, // 0x11 - WINDOW_CONFIRMATION, // 0x12 - CLOSE_WINDOW, // 0x13 - OPEN_WINDOW, // 0x14 - WINDOW_ITEMS, // 0x15 - WINDOW_PROPERTY, // 0x16 - SET_SLOT, // 0x17 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + CHAT, // 0x0E + CHUNK_BLOCKS_UPDATE, // 0x0F + COMMAND_SUGGESTIONS, // 0x10 + COMMANDS, // 0x11 + CONTAINER_ACK, // 0x12 + CONTAINER_CLOSE, // 0x13 + OPEN_SCREEN, // 0x14 + CONTAINER_SET_CONTENT, // 0x15 + CONTAINER_SET_DATA, // 0x16 + CONTAINER_SET_SLOT, // 0x17 COOLDOWN, // 0x18 - PLUGIN_MESSAGE, // 0x19 - NAMED_SOUND, // 0x1A + CUSTOM_PAYLOAD, // 0x19 + CUSTOM_SOUND, // 0x1A DISCONNECT, // 0x1B - ENTITY_STATUS, // 0x1C - NBT_QUERY, // 0x1D - EXPLOSION, // 0x1E - UNLOAD_CHUNK, // 0x1F + ENTITY_EVENT, // 0x1C + TAG_QUERY, // 0x1D + EXPLODE, // 0x1E + FORGET_LEVEL_CHUNK, // 0x1F GAME_EVENT, // 0x20 KEEP_ALIVE, // 0x21 - CHUNK_DATA, // 0x22 - EFFECT, // 0x23 - SPAWN_PARTICLE, // 0x24 - JOIN_GAME, // 0x25 - MAP_DATA, // 0x26 - ENTITY_MOVEMENT, // 0x27 - ENTITY_POSITION, // 0x28 - ENTITY_POSITION_AND_ROTATION, // 0x29 - ENTITY_ROTATION, // 0x2A - VEHICLE_MOVE, // 0x2B + LEVEL_CHUNK, // 0x22 + LEVEL_EVENT, // 0x23 + LEVEL_PARTICLES, // 0x24 + LOGIN, // 0x25 + MAP_ITEM_DATA, // 0x26 + MOVE_ENTITY, // 0x27 + MOVE_ENTITY_POS, // 0x28 + MOVE_ENTITY_POS_ROT, // 0x29 + MOVE_ENTITY_ROT, // 0x2A + MOVE_VEHICLE, // 0x2B OPEN_SIGN_EDITOR, // 0x2C - CRAFT_RECIPE_RESPONSE, // 0x2D + PLACE_GHOST_RECIPE, // 0x2D PLAYER_ABILITIES, // 0x2E - COMBAT_EVENT, // 0x2F + PLAYER_COMBAT, // 0x2F PLAYER_INFO, // 0x30 - FACE_PLAYER, // 0x31 + PLAYER_LOOK_AT, // 0x31 PLAYER_POSITION, // 0x32 - USE_BED, // 0x33 - UNLOCK_RECIPES, // 0x34 - DESTROY_ENTITIES, // 0x35 - REMOVE_ENTITY_EFFECT, // 0x36 + PLAYER_SLEEP, // 0x33 + RECIPE, // 0x34 + REMOVE_ENTITIES, // 0x35 + REMOVE_MOB_EFFECT, // 0x36 RESOURCE_PACK, // 0x37 RESPAWN, // 0x38 - ENTITY_HEAD_LOOK, // 0x39 + ROTATE_HEAD, // 0x39 SELECT_ADVANCEMENTS_TAB, // 0x3A - WORLD_BORDER, // 0x3B - CAMERA, // 0x3C - HELD_ITEM_CHANGE, // 0x3D - DISPLAY_SCOREBOARD, // 0x3E - ENTITY_METADATA, // 0x3F - ATTACH_ENTITY, // 0x40 - ENTITY_VELOCITY, // 0x41 - ENTITY_EQUIPMENT, // 0x42 + SET_BORDER, // 0x3B + SET_CAMERA, // 0x3C + SET_CARRIED_ITEM, // 0x3D + SET_DISPLAY_OBJECTIVE, // 0x3E + SET_ENTITY_DATA, // 0x3F + SET_ENTITY_LINK, // 0x40 + SET_ENTITY_MOTION, // 0x41 + SET_EQUIPPED_ITEM, // 0x42 SET_EXPERIENCE, // 0x43 - UPDATE_HEALTH, // 0x44 - SCOREBOARD_OBJECTIVE, // 0x45 + SET_HEALTH, // 0x44 + SET_OBJECTIVE, // 0x45 SET_PASSENGERS, // 0x46 - TEAMS, // 0x47 - UPDATE_SCORE, // 0x48 - SPAWN_POSITION, // 0x49 - TIME_UPDATE, // 0x4A - TITLE, // 0x4B + SET_PLAYER_TEAM, // 0x47 + SET_SCORE, // 0x48 + SET_DEFAULT_SPAWN_POSITION, // 0x49 + SET_TIME, // 0x4A + SET_TITLES, // 0x4B STOP_SOUND, // 0x4C SOUND, // 0x4D TAB_LIST, // 0x4E - COLLECT_ITEM, // 0x4F - ENTITY_TELEPORT, // 0x50 - ADVANCEMENTS, // 0x51 - ENTITY_PROPERTIES, // 0x52 - ENTITY_EFFECT, // 0x53 - DECLARE_RECIPES, // 0x54 - TAGS; // 0x55 + TAKE_ITEM_ENTITY, // 0x4F + TELEPORT_ENTITY, // 0x50 + UPDATE_ADVANCEMENTS, // 0x51 + UPDATE_ATTRIBUTES, // 0x52 + UPDATE_MOB_EFFECT, // 0x53 + UPDATE_RECIPES, // 0x54 + UPDATE_TAGS; // 0x55 @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ServerboundPackets1_13.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ServerboundPackets1_13.java index aa4f401f9..709489d70 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ServerboundPackets1_13.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/packet/ServerboundPackets1_13.java @@ -21,48 +21,48 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_13 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - CHAT_MESSAGE, // 0x02 - CLIENT_STATUS, // 0x03 - CLIENT_SETTINGS, // 0x04 - TAB_COMPLETE, // 0x05 - WINDOW_CONFIRMATION, // 0x06 - CLICK_WINDOW_BUTTON, // 0x07 - CLICK_WINDOW, // 0x08 - CLOSE_WINDOW, // 0x09 - PLUGIN_MESSAGE, // 0x0A + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHAT, // 0x02 + CLIENT_COMMAND, // 0x03 + CLIENT_INFORMATION, // 0x04 + COMMAND_SUGGESTION, // 0x05 + CONTAINER_ACK, // 0x06 + CONTAINER_BUTTON_CLICK, // 0x07 + CONTAINER_CLICK, // 0x08 + CONTAINER_CLOSE, // 0x09 + CUSTOM_PAYLOAD, // 0x0A EDIT_BOOK, // 0x0B - ENTITY_NBT_REQUEST, // 0x0C - INTERACT_ENTITY, // 0x0D + ENTITY_TAG_QUERY, // 0x0C + INTERACT, // 0x0D KEEP_ALIVE, // 0x0E - PLAYER_MOVEMENT, // 0x0F - PLAYER_POSITION, // 0x10 - PLAYER_POSITION_AND_ROTATION, // 0x11 - PLAYER_ROTATION, // 0x12 - VEHICLE_MOVE, // 0x13 - STEER_BOAT, // 0x14 + MOVE_PLAYER_STATUS_ONLY, // 0x0F + MOVE_PLAYER_POS, // 0x10 + MOVE_PLAYER_POS_ROT, // 0x11 + MOVE_PLAYER_ROT, // 0x12 + MOVE_VEHICLE, // 0x13 + PADDLE_BOAT, // 0x14 PICK_ITEM, // 0x15 - CRAFT_RECIPE_REQUEST, // 0x16 + PLACE_RECIPE, // 0x16 PLAYER_ABILITIES, // 0x17 - PLAYER_DIGGING, // 0x18 - ENTITY_ACTION, // 0x19 - STEER_VEHICLE, // 0x1A - RECIPE_BOOK_DATA, // 0x1B + PLAYER_ACTION, // 0x18 + PLAYER_COMMAND, // 0x19 + PLAYER_INPUT, // 0x1A + RECIPE_BOOK_UPDATE, // 0x1B RENAME_ITEM, // 0x1C - RESOURCE_PACK_STATUS, // 0x1D - ADVANCEMENT_TAB, // 0x1E + RESOURCE_PACK, // 0x1D + SEEN_ADVANCEMENTS, // 0x1E SELECT_TRADE, // 0x1F - SET_BEACON_EFFECT, // 0x20 - HELD_ITEM_CHANGE, // 0x21 - UPDATE_COMMAND_BLOCK, // 0x22 - UPDATE_COMMAND_BLOCK_MINECART, // 0x23 - CREATIVE_INVENTORY_ACTION, // 0x24 - UPDATE_STRUCTURE_BLOCK, // 0x25 - UPDATE_SIGN, // 0x26 - ANIMATION, // 0x27 - SPECTATE, // 0x28 - PLAYER_BLOCK_PLACEMENT, // 0x29 + SET_BEACON, // 0x20 + SET_CARRIED_ITEM, // 0x21 + SET_COMMAND_BLOCK, // 0x22 + SET_COMMAND_MINECART, // 0x23 + SET_CREATIVE_MODE_SLOT, // 0x24 + SET_STRUCTURE_BLOCK, // 0x25 + SIGN_UPDATE, // 0x26 + SWING, // 0x27 + TELEPORT_TO_ENTITY, // 0x28 + USE_ITEM_ON, // 0x29 USE_ITEM; // 0x2A @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/providers/BlockEntityProvider.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/providers/BlockEntityProvider.java index a3ce674af..64b4d3046 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/providers/BlockEntityProvider.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/providers/BlockEntityProvider.java @@ -79,7 +79,7 @@ public class BlockEntityProvider implements Provider { } private void sendBlockChange(UserConnection user, Position position, int blockId) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_13.BLOCK_CHANGE, null, user); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_13.BLOCK_UPDATE, null, user); wrapper.write(Type.POSITION1_8, position); wrapper.write(Type.VAR_INT, blockId); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/EntityPacketRewriter1_13.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/EntityPacketRewriter1_13.java index edd52690d..ca39fc17c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/EntityPacketRewriter1_13.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/EntityPacketRewriter1_13.java @@ -33,7 +33,7 @@ public class EntityPacketRewriter1_13 { public static void register(Protocol1_12_2To1_13 protocol) { MetadataRewriter1_13To1_12_2 metadataRewriter = protocol.get(MetadataRewriter1_13To1_12_2.class); - protocol.registerClientbound(ClientboundPackets1_12_1.SPAWN_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.ADD_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity id @@ -78,7 +78,7 @@ public class EntityPacketRewriter1_13 { } }); - protocol.registerClientbound(ClientboundPackets1_12_1.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -99,7 +99,7 @@ public class EntityPacketRewriter1_13 { } }); - protocol.registerClientbound(ClientboundPackets1_12_1.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -115,7 +115,7 @@ public class EntityPacketRewriter1_13 { } }); - protocol.registerClientbound(ClientboundPackets1_12_1.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Entity ID @@ -132,7 +132,7 @@ public class EntityPacketRewriter1_13 { } }); - protocol.registerClientbound(ClientboundPackets1_12_1.ENTITY_EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.UPDATE_MOB_EFFECT, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // Entity id @@ -151,7 +151,7 @@ public class EntityPacketRewriter1_13 { } }); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_12_1.DESTROY_ENTITIES); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_12_1.ENTITY_METADATA, Types1_12.METADATA_LIST, Types1_13.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_12_1.REMOVE_ENTITIES); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_12_1.SET_ENTITY_DATA, Types1_12.METADATA_LIST, Types1_13.METADATA_LIST); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/ItemPacketRewriter1_13.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/ItemPacketRewriter1_13.java index b2dc4d8cf..cc50540a9 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/ItemPacketRewriter1_13.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/rewriter/ItemPacketRewriter1_13.java @@ -56,7 +56,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter handleItemToClient(wrapper.user(), wrapper.get(Type.ITEM1_13, 0))); } }); - protocol.registerClientbound(ClientboundPackets1_12_1.WINDOW_ITEMS, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.CONTAINER_SET_CONTENT, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID @@ -80,7 +80,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter Trading - protocol.registerClientbound(ClientboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Channel @@ -195,7 +195,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_12_1.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); BlockStorage storage = wrapper.user().get(BlockStorage.class); @@ -467,7 +467,7 @@ public class WorldPacketRewriter1_13 { } }); - protocol.registerClientbound(ClientboundPackets1_12_1.SPAWN_PARTICLE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_12_1.LEVEL_PARTICLES, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Particle ID @@ -536,7 +536,7 @@ public class WorldPacketRewriter1_13 { }); // Incoming Packets - protocol.registerServerbound(ServerboundPackets1_13.PLAYER_BLOCK_PLACEMENT, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_13.USE_ITEM_ON, wrapper -> { Position pos = wrapper.passthrough(Type.POSITION1_8); wrapper.passthrough(Type.VAR_INT); // block face wrapper.passthrough(Type.VAR_INT); // hand @@ -548,7 +548,7 @@ public class WorldPacketRewriter1_13 { ConnectionData.markModified(wrapper.user(), pos); } }); - protocol.registerServerbound(ServerboundPackets1_13.PLAYER_DIGGING, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_13.PLAYER_ACTION, wrapper -> { int status = wrapper.passthrough(Type.VAR_INT); // Status Position pos = wrapper.passthrough(Type.POSITION1_8); // Location wrapper.passthrough(Type.UNSIGNED_BYTE); // block face diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/storage/TabCompleteTracker.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/storage/TabCompleteTracker.java index 0b962d3c8..b786f632d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/storage/TabCompleteTracker.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/storage/TabCompleteTracker.java @@ -36,7 +36,7 @@ public class TabCompleteTracker implements StorableObject { public void sendPacketToServer(UserConnection connection) { if (lastTabComplete == null || timeToSend > System.currentTimeMillis()) return; - PacketWrapper wrapper = PacketWrapper.create(ServerboundPackets1_12_1.TAB_COMPLETE, null, connection); + PacketWrapper wrapper = PacketWrapper.create(ServerboundPackets1_12_1.COMMAND_SUGGESTION, null, connection); wrapper.write(Type.STRING, lastTabComplete); wrapper.write(Type.BOOLEAN, false); final Position playerLookTarget = Via.getManager().getProviders().get(PlayerLookTargetProvider.class).getPlayerLookTarget(connection); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12to1_12_1/Protocol1_12To1_12_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12to1_12_1/Protocol1_12To1_12_1.java index 3adc131e1..7f7fb8cba 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12to1_12_1/Protocol1_12To1_12_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12to1_12_1/Protocol1_12To1_12_1.java @@ -31,6 +31,6 @@ public class Protocol1_12To1_12_1 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_13.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear int size = wrapper.passthrough(Type.VAR_INT); // Mapping size diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/EntityPacketRewriter1_13_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/EntityPacketRewriter1_13_2.java index a8e8a80a4..7fd9edf07 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/EntityPacketRewriter1_13_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/EntityPacketRewriter1_13_2.java @@ -35,7 +35,7 @@ public class EntityPacketRewriter1_13_2 { } }; - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -56,7 +56,7 @@ public class EntityPacketRewriter1_13_2 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -72,7 +72,7 @@ public class EntityPacketRewriter1_13_2 { } }); - protocol.registerClientbound(ClientboundPackets1_13.ENTITY_METADATA, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.SET_ENTITY_DATA, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/ItemPacketRewriter1_13_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/ItemPacketRewriter1_13_2.java index efd3c00fa..3f5a0e124 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/ItemPacketRewriter1_13_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/ItemPacketRewriter1_13_2.java @@ -27,7 +27,7 @@ import com.viaversion.viaversion.util.Key; public class ItemPacketRewriter1_13_2 { public static void register(Protocol1_13_1To1_13_2 protocol) { - protocol.registerClientbound(ClientboundPackets1_13.SET_SLOT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.CONTAINER_SET_SLOT, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID @@ -35,7 +35,7 @@ public class ItemPacketRewriter1_13_2 { map(Type.ITEM1_13, Type.ITEM1_13_2); // 2 - Slot Value } }); - protocol.registerClientbound(ClientboundPackets1_13.WINDOW_ITEMS, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.CONTAINER_SET_CONTENT, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID @@ -43,7 +43,7 @@ public class ItemPacketRewriter1_13_2 { } }); - protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // Channel @@ -73,7 +73,7 @@ public class ItemPacketRewriter1_13_2 { } }); - protocol.registerClientbound(ClientboundPackets1_13.ENTITY_EQUIPMENT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.SET_EQUIPPED_ITEM, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -82,7 +82,7 @@ public class ItemPacketRewriter1_13_2 { } }); - protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.UPDATE_RECIPES, wrapper -> { int recipesNo = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < recipesNo; i++) { wrapper.passthrough(Type.STRING); // Id @@ -113,7 +113,7 @@ public class ItemPacketRewriter1_13_2 { } }); - protocol.registerServerbound(ServerboundPackets1_13.CLICK_WINDOW, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_13.CONTAINER_CLICK, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID @@ -124,7 +124,7 @@ public class ItemPacketRewriter1_13_2 { map(Type.ITEM1_13_2, Type.ITEM1_13); // 5 - Clicked Item } }); - protocol.registerServerbound(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_13.SET_CREATIVE_MODE_SLOT, new PacketHandlers() { @Override public void register() { map(Type.SHORT); // 0 - Slot diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/WorldPacketRewriter1_13_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/WorldPacketRewriter1_13_2.java index cca2ea948..9857cef08 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/WorldPacketRewriter1_13_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_1to1_13_2/rewriter/WorldPacketRewriter1_13_2.java @@ -25,7 +25,7 @@ import com.viaversion.viaversion.protocols.v1_13_1to1_13_2.Protocol1_13_1To1_13_ public class WorldPacketRewriter1_13_2 { public static void register(Protocol1_13_1To1_13_2 protocol) { - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PARTICLE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.LEVEL_PARTICLES, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Particle ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/Protocol1_13_2To1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/Protocol1_13_2To1_14.java index e0d80632a..4c11ea005 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/Protocol1_13_2To1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/Protocol1_13_2To1_14.java @@ -62,10 +62,10 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol(this).registerSound(ClientboundPackets1_13.SOUND); - new StatisticsRewriter<>(this).register(ClientboundPackets1_13.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_13.AWARD_STATS); ComponentRewriter componentRewriter = new ComponentRewriter1_14<>(this); - componentRewriter.registerComponentPacket(ClientboundPackets1_13.CHAT_MESSAGE); + componentRewriter.registerComponentPacket(ClientboundPackets1_13.CHAT); CommandRewriter commandRewriter = new CommandRewriter<>(this) { @Override @@ -76,9 +76,9 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_13.UPDATE_TAGS, wrapper -> { int blockTagsSize = wrapper.read(Type.VAR_INT); wrapper.write(Type.VAR_INT, blockTagsSize + 6); // block tags for (int i = 0; i < blockTagsSize; i++) { @@ -134,11 +134,11 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol { + filter().type(EntityTypes1_14.LIVING_ENTITY).index(8).handler((event, meta) -> { float value = ((Number) meta.getValue()).floatValue(); if (Float.isNaN(value) && Via.getConfig().is1_14HealthNaNFix()) { meta.setValue(1F); } }); - filter().type(EntityTypes1_14.ABSTRACT_INSENTIENT).index(13).handler((event, meta) -> { + filter().type(EntityTypes1_14.MOB).index(13).handler((event, meta) -> { EntityTracker1_14 tracker = tracker(event.user()); int entityId = event.entityId(); tracker.setInsentientData(entityId, (byte) ((((Number) meta.getValue()).byteValue() & ~0x4) @@ -93,7 +93,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter { + filter().type(EntityTypes1_14.ABSTRACT_MINECART).index(10).handler((event, meta) -> { int data = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); @@ -111,7 +111,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter { + filter().type(EntityTypes1_14.ABSTRACT_ILLAGER).handler((event, meta) -> { if (event.index() == 14) { EntityTracker1_14 tracker = tracker(event.user()); int entityId = event.entityId(); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ClientboundPackets1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ClientboundPackets1_14.java index ff9091b9b..219b1c2ca 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ClientboundPackets1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ClientboundPackets1_14.java @@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_14 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_GLOBAL_ENTITY, // 0x02 - SPAWN_MOB, // 0x03 - SPAWN_PAINTING, // 0x04 - SPAWN_PLAYER, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_GLOBAL_ENTITY, // 0x02 + ADD_MOB, // 0x03 + ADD_PAINTING, // 0x04 + ADD_PLAYER, // 0x05 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - CHAT_MESSAGE, // 0x0E - MULTI_BLOCK_CHANGE, // 0x0F - TAB_COMPLETE, // 0x10 - DECLARE_COMMANDS, // 0x11 - WINDOW_CONFIRMATION, // 0x12 - CLOSE_WINDOW, // 0x13 - WINDOW_ITEMS, // 0x14 - WINDOW_PROPERTY, // 0x15 - SET_SLOT, // 0x16 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + CHAT, // 0x0E + CHUNK_BLOCKS_UPDATE, // 0x0F + COMMAND_SUGGESTIONS, // 0x10 + COMMANDS, // 0x11 + CONTAINER_ACK, // 0x12 + CONTAINER_CLOSE, // 0x13 + CONTAINER_SET_CONTENT, // 0x14 + CONTAINER_SET_DATA, // 0x15 + CONTAINER_SET_SLOT, // 0x16 COOLDOWN, // 0x17 - PLUGIN_MESSAGE, // 0x18 - NAMED_SOUND, // 0x19 + CUSTOM_PAYLOAD, // 0x18 + CUSTOM_SOUND, // 0x19 DISCONNECT, // 0x1A - ENTITY_STATUS, // 0x1B - EXPLOSION, // 0x1C - UNLOAD_CHUNK, // 0x1D + ENTITY_EVENT, // 0x1B + EXPLODE, // 0x1C + FORGET_LEVEL_CHUNK, // 0x1D GAME_EVENT, // 0x1E - OPEN_HORSE_WINDOW, // 0x1F + HORSE_SCREEN_OPEN, // 0x1F KEEP_ALIVE, // 0x20 - CHUNK_DATA, // 0x21 - EFFECT, // 0x22 - SPAWN_PARTICLE, // 0x23 - UPDATE_LIGHT, // 0x24 - JOIN_GAME, // 0x25 - MAP_DATA, // 0x26 - TRADE_LIST, // 0x27 - ENTITY_POSITION, // 0x28 - ENTITY_POSITION_AND_ROTATION, // 0x29 - ENTITY_ROTATION, // 0x2A - ENTITY_MOVEMENT, // 0x2B - VEHICLE_MOVE, // 0x2C + LEVEL_CHUNK, // 0x21 + LEVEL_EVENT, // 0x22 + LEVEL_PARTICLES, // 0x23 + LIGHT_UPDATE, // 0x24 + LOGIN, // 0x25 + MAP_ITEM_DATA, // 0x26 + MERCHANT_OFFERS, // 0x27 + MOVE_ENTITY_POS, // 0x28 + MOVE_ENTITY_POS_ROT, // 0x29 + MOVE_ENTITY_ROT, // 0x2A + MOVE_ENTITY, // 0x2B + MOVE_VEHICLE, // 0x2C OPEN_BOOK, // 0x2D - OPEN_WINDOW, // 0x2E + OPEN_SCREEN, // 0x2E OPEN_SIGN_EDITOR, // 0x2F - CRAFT_RECIPE_RESPONSE, // 0x30 + PLACE_GHOST_RECIPE, // 0x30 PLAYER_ABILITIES, // 0x31 - COMBAT_EVENT, // 0x32 + PLAYER_COMBAT, // 0x32 PLAYER_INFO, // 0x33 - FACE_PLAYER, // 0x34 + PLAYER_LOOK_AT, // 0x34 PLAYER_POSITION, // 0x35 - UNLOCK_RECIPES, // 0x36 - DESTROY_ENTITIES, // 0x37 - REMOVE_ENTITY_EFFECT, // 0x38 + RECIPE, // 0x36 + REMOVE_ENTITIES, // 0x37 + REMOVE_MOB_EFFECT, // 0x38 RESOURCE_PACK, // 0x39 RESPAWN, // 0x3A - ENTITY_HEAD_LOOK, // 0x3B + ROTATE_HEAD, // 0x3B SELECT_ADVANCEMENTS_TAB, // 0x3C - WORLD_BORDER, // 0x3D - CAMERA, // 0x3E - HELD_ITEM_CHANGE, // 0x3F - UPDATE_VIEW_POSITION, // 0x40 - UPDATE_VIEW_DISTANCE, // 0x41 - DISPLAY_SCOREBOARD, // 0x42 - ENTITY_METADATA, // 0x43 - ATTACH_ENTITY, // 0x44 - ENTITY_VELOCITY, // 0x45 - ENTITY_EQUIPMENT, // 0x46 + SET_BORDER, // 0x3D + SET_CAMERA, // 0x3E + SET_CARRIED_ITEM, // 0x3F + SET_CHUNK_CACHE_CENTER, // 0x40 + SET_CHUNK_CACHE_RADIUS, // 0x41 + SET_DISPLAY_OBJECTIVE, // 0x42 + SET_ENTITY_DATA, // 0x43 + SET_ENTITY_LINK, // 0x44 + SET_ENTITY_MOTION, // 0x45 + SET_EQUIPPED_ITEM, // 0x46 SET_EXPERIENCE, // 0x47 - UPDATE_HEALTH, // 0x48 - SCOREBOARD_OBJECTIVE, // 0x49 + SET_HEALTH, // 0x48 + SET_OBJECTIVE, // 0x49 SET_PASSENGERS, // 0x4A - TEAMS, // 0x4B - UPDATE_SCORE, // 0x4C - SPAWN_POSITION, // 0x4D - TIME_UPDATE, // 0x4E - TITLE, // 0x4F - ENTITY_SOUND, // 0x50 + SET_PLAYER_TEAM, // 0x4B + SET_SCORE, // 0x4C + SET_DEFAULT_SPAWN_POSITION, // 0x4D + SET_TIME, // 0x4E + SET_TITLES, // 0x4F + SOUND_ENTITY, // 0x50 SOUND, // 0x51 STOP_SOUND, // 0x52 TAB_LIST, // 0x53 - NBT_QUERY, // 0x54 - COLLECT_ITEM, // 0x55 - ENTITY_TELEPORT, // 0x56 - ADVANCEMENTS, // 0x57 - ENTITY_PROPERTIES, // 0x58 - ENTITY_EFFECT, // 0x59 - DECLARE_RECIPES, // 0x5A - TAGS; // 0x5B + TAG_QUERY, // 0x54 + TAKE_ITEM_ENTITY, // 0x55 + TELEPORT_ENTITY, // 0x56 + UPDATE_ADVANCEMENTS, // 0x57 + UPDATE_ATTRIBUTES, // 0x58 + UPDATE_MOB_EFFECT, // 0x59 + UPDATE_RECIPES, // 0x5A + UPDATE_TAGS; // 0x5B @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ServerboundPackets1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ServerboundPackets1_14.java index d0da1f332..3346d614a 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ServerboundPackets1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/packet/ServerboundPackets1_14.java @@ -21,51 +21,51 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_14 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - SET_DIFFICULTY, // 0x02 - CHAT_MESSAGE, // 0x03 - CLIENT_STATUS, // 0x04 - CLIENT_SETTINGS, // 0x05 - TAB_COMPLETE, // 0x06 - WINDOW_CONFIRMATION, // 0x07 - CLICK_WINDOW_BUTTON, // 0x08 - CLICK_WINDOW, // 0x09 - CLOSE_WINDOW, // 0x0A - PLUGIN_MESSAGE, // 0x0B + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHANGE_DIFFICULTY, // 0x02 + CHAT, // 0x03 + CLIENT_COMMAND, // 0x04 + CLIENT_INFORMATION, // 0x05 + COMMAND_SUGGESTION, // 0x06 + CONTAINER_ACK, // 0x07 + CONTAINER_BUTTON_CLICK, // 0x08 + CONTAINER_CLICK, // 0x09 + CONTAINER_CLOSE, // 0x0A + CUSTOM_PAYLOAD, // 0x0B EDIT_BOOK, // 0x0C - ENTITY_NBT_REQUEST, // 0x0D - INTERACT_ENTITY, // 0x0E + ENTITY_TAG_QUERY, // 0x0D + INTERACT, // 0x0E KEEP_ALIVE, // 0x0F LOCK_DIFFICULTY, // 0x10 - PLAYER_POSITION, // 0x11 - PLAYER_POSITION_AND_ROTATION, // 0x12 - PLAYER_ROTATION, // 0x13 - PLAYER_MOVEMENT, // 0x14 - VEHICLE_MOVE, // 0x15 - STEER_BOAT, // 0x16 + MOVE_PLAYER_POS, // 0x11 + MOVE_PLAYER_POS_ROT, // 0x12 + MOVE_PLAYER_ROT, // 0x13 + MOVE_PLAYER_STATUS_ONLY, // 0x14 + MOVE_VEHICLE, // 0x15 + PADDLE_BOAT, // 0x16 PICK_ITEM, // 0x17 - CRAFT_RECIPE_REQUEST, // 0x18 + PLACE_RECIPE, // 0x18 PLAYER_ABILITIES, // 0x19 - PLAYER_DIGGING, // 0x1A - ENTITY_ACTION, // 0x1B - STEER_VEHICLE, // 0x1C - RECIPE_BOOK_DATA, // 0x1D + PLAYER_ACTION, // 0x1A + PLAYER_COMMAND, // 0x1B + PLAYER_INPUT, // 0x1C + RECIPE_BOOK_UPDATE, // 0x1D RENAME_ITEM, // 0x1E - RESOURCE_PACK_STATUS, // 0x1F - ADVANCEMENT_TAB, // 0x20 + RESOURCE_PACK, // 0x1F + SEEN_ADVANCEMENTS, // 0x20 SELECT_TRADE, // 0x21 - SET_BEACON_EFFECT, // 0x22 - HELD_ITEM_CHANGE, // 0x23 - UPDATE_COMMAND_BLOCK, // 0x24 - UPDATE_COMMAND_BLOCK_MINECART, // 0x25 - CREATIVE_INVENTORY_ACTION, // 0x26 - UPDATE_JIGSAW_BLOCK, // 0x27 - UPDATE_STRUCTURE_BLOCK, // 0x28 - UPDATE_SIGN, // 0x29 - ANIMATION, // 0x2A - SPECTATE, // 0x2B - PLAYER_BLOCK_PLACEMENT, // 0x2C + SET_BEACON, // 0x22 + SET_CARRIED_ITEM, // 0x23 + SET_COMMAND_BLOCK, // 0x24 + SET_COMMAND_MINECART, // 0x25 + SET_CREATIVE_MODE_SLOT, // 0x26 + SET_JIGSAW_BLOCK, // 0x27 + SET_STRUCTURE_BLOCK, // 0x28 + SIGN_UPDATE, // 0x29 + SWING, // 0x2A + TELEPORT_TO_ENTITY, // 0x2B + USE_ITEM_ON, // 0x2C USE_ITEM; // 0x2D @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/EntityPacketRewriter1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/EntityPacketRewriter1_14.java index 8d199c964..f7e3457e3 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/EntityPacketRewriter1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/EntityPacketRewriter1_14.java @@ -41,19 +41,19 @@ public class EntityPacketRewriter1_14 { public static void register(Protocol1_13_2To1_14 protocol) { MetadataRewriter1_14To1_13_2 metadataRewriter = protocol.get(MetadataRewriter1_14To1_13_2.class); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_EXPERIENCE_ORB, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.ADD_EXPERIENCE_ORB, wrapper -> { int entityId = wrapper.passthrough(Type.VAR_INT); metadataRewriter.tracker(wrapper.user()).addEntity(entityId, EntityTypes1_14.EXPERIENCE_ORB); }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_GLOBAL_ENTITY, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.ADD_GLOBAL_ENTITY, wrapper -> { int entityId = wrapper.passthrough(Type.VAR_INT); if (wrapper.passthrough(Type.BYTE) == 1) { metadataRewriter.tracker(wrapper.user()).addEntity(entityId, EntityTypes1_14.LIGHTNING_BOLT); } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity id @@ -115,7 +115,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -136,7 +136,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PAINTING, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_PAINTING, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -148,7 +148,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -164,7 +164,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.ENTITY_ANIMATION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ANIMATE, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -175,7 +175,7 @@ public class EntityPacketRewriter1_14 { int entityId = wrapper.get(Type.VAR_INT, 0); tracker.setSleeping(entityId, false); - PacketWrapper metadataPacket = wrapper.create(ClientboundPackets1_14.ENTITY_METADATA); + PacketWrapper metadataPacket = wrapper.create(ClientboundPackets1_14.SET_ENTITY_DATA); metadataPacket.write(Type.VAR_INT, entityId); List metadataList = new LinkedList<>(); if (tracker.clientEntityId() != entityId) { @@ -189,7 +189,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Entity ID @@ -204,7 +204,7 @@ public class EntityPacketRewriter1_14 { handler(metadataRewriter.playerTrackerHandler()); handler(wrapper -> { short difficulty = wrapper.read(Type.UNSIGNED_BYTE); // 19w11a removed difficulty from join game - PacketWrapper difficultyPacket = wrapper.create(ClientboundPackets1_14.SERVER_DIFFICULTY); + PacketWrapper difficultyPacket = wrapper.create(ClientboundPackets1_14.CHANGE_DIFFICULTY); difficultyPacket.write(Type.UNSIGNED_BYTE, difficulty); difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a difficultyPacket.scheduleSend(protocol.getClass()); @@ -225,7 +225,7 @@ public class EntityPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.USE_BED, ClientboundPackets1_14.ENTITY_METADATA, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.PLAYER_SLEEP, ClientboundPackets1_14.SET_ENTITY_DATA, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -245,7 +245,7 @@ public class EntityPacketRewriter1_14 { } }); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.DESTROY_ENTITIES); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.ENTITY_METADATA, Types1_13_2.METADATA_LIST, Types1_14.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.REMOVE_ENTITIES); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.SET_ENTITY_DATA, Types1_13_2.METADATA_LIST, Types1_14.METADATA_LIST); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/ItemPacketRewriter1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/ItemPacketRewriter1_14.java index daffacbde..328d5707e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/ItemPacketRewriter1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/ItemPacketRewriter1_14.java @@ -66,9 +66,9 @@ public class ItemPacketRewriter1_14 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_13.OPEN_SCREEN, null, wrapper -> { Short windowId = wrapper.read(Type.UNSIGNED_BYTE); String type = wrapper.read(Type.STRING); JsonElement title = wrapper.read(Type.COMPONENT); @@ -76,13 +76,13 @@ public class ItemPacketRewriter1_14 extends ItemRewriter { String channel = Key.namespaced(wrapper.get(Type.STRING, 0)); if (channel.equals("minecraft:trader_list")) { - wrapper.setPacketType(ClientboundPackets1_14.TRADE_LIST); + wrapper.setPacketType(ClientboundPackets1_14.MERCHANT_OFFERS); wrapper.resetReader(); wrapper.read(Type.STRING); // Remove channel @@ -188,10 +188,10 @@ public class ItemPacketRewriter1_14 extends ItemRewriter recipeRewriter = new RecipeRewriter<>(protocol); - protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.UPDATE_RECIPES, wrapper -> { int size = wrapper.passthrough(Type.VAR_INT); int deleted = 0; for (int i = 0; i < size; i++) { @@ -210,11 +210,11 @@ public class ItemPacketRewriter1_14 extends ItemRewriter { // Selecting trade now moves the items, we need to resync the inventory - PacketWrapper resyncPacket = wrapper.create(ServerboundPackets1_13.CLICK_WINDOW); + PacketWrapper resyncPacket = wrapper.create(ServerboundPackets1_13.CONTAINER_CLICK); EntityTracker1_14 tracker = wrapper.user().getEntityTracker(Protocol1_13_2To1_14.class); resyncPacket.write(Type.UNSIGNED_BYTE, ((short) tracker.getLatestTradeWindowId())); // 0 - Window ID resyncPacket.write(Type.SHORT, ((short) -999)); // 1 - Slot @@ -227,9 +227,9 @@ public class ItemPacketRewriter1_14 extends ItemRewriter { + protocol.registerServerbound(ServerboundPackets1_14.USE_ITEM_ON, wrapper -> { int hand = wrapper.read(Type.VAR_INT); Position position = wrapper.read(Type.POSITION1_14); int face = wrapper.read(Type.VAR_INT); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/WorldPacketRewriter1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/WorldPacketRewriter1_14.java index a857e85f5..cf323a020 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/WorldPacketRewriter1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13_2to1_14/rewriter/WorldPacketRewriter1_14.java @@ -55,7 +55,7 @@ public class WorldPacketRewriter1_14 { public static void register(Protocol1_13_2To1_14 protocol) { BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - protocol.registerClientbound(ClientboundPackets1_13.BLOCK_BREAK_ANIMATION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.BLOCK_DESTRUCTION, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -69,7 +69,7 @@ public class WorldPacketRewriter1_14 { map(Type.POSITION1_8, Type.POSITION1_14); } }); - protocol.registerClientbound(ClientboundPackets1_13.BLOCK_ACTION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.BLOCK_EVENT, new PacketHandlers() { @Override public void register() { map(Type.POSITION1_8, Type.POSITION1_14); // Location @@ -79,7 +79,7 @@ public class WorldPacketRewriter1_14 { handler(wrapper -> wrapper.set(Type.VAR_INT, 0, protocol.getMappingData().getNewBlockId(wrapper.get(Type.VAR_INT, 0)))); } }); - protocol.registerClientbound(ClientboundPackets1_13.BLOCK_CHANGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.BLOCK_UPDATE, new PacketHandlers() { @Override public void register() { map(Type.POSITION1_8, Type.POSITION1_14); @@ -92,7 +92,7 @@ public class WorldPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SERVER_DIFFICULTY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.CHANGE_DIFFICULTY, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); @@ -102,9 +102,9 @@ public class WorldPacketRewriter1_14 { } }); - blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.MULTI_BLOCK_CHANGE); + blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.CHUNK_BLOCKS_UPDATE); - protocol.registerClientbound(ClientboundPackets1_13.EXPLOSION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.EXPLODE, new PacketHandlers() { @Override public void register() { map(Type.FLOAT); // X @@ -124,7 +124,7 @@ public class WorldPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); Chunk chunk = wrapper.read(ChunkType1_13.forEnvironment(clientWorld.getEnvironment())); wrapper.write(ChunkType1_14.TYPE, chunk); @@ -182,7 +182,7 @@ public class WorldPacketRewriter1_14 { heightMap.put("WORLD_SURFACE", new LongArrayTag(encodeHeightMap(worldSurface))); chunk.setHeightMap(heightMap); - PacketWrapper lightPacket = wrapper.create(ClientboundPackets1_14.UPDATE_LIGHT); + PacketWrapper lightPacket = wrapper.create(ClientboundPackets1_14.LIGHT_UPDATE); lightPacket.write(Type.VAR_INT, chunk.getX()); lightPacket.write(Type.VAR_INT, chunk.getZ()); @@ -229,7 +229,7 @@ public class WorldPacketRewriter1_14 { if (entityTracker.isForceSendCenterChunk() || diffX >= SERVERSIDE_VIEW_DISTANCE || diffZ >= SERVERSIDE_VIEW_DISTANCE) { - PacketWrapper fakePosLook = wrapper.create(ClientboundPackets1_14.UPDATE_VIEW_POSITION); // Set center chunk + PacketWrapper fakePosLook = wrapper.create(ClientboundPackets1_14.SET_CHUNK_CACHE_CENTER); // Set center chunk fakePosLook.write(Type.VAR_INT, chunk.getX()); fakePosLook.write(Type.VAR_INT, chunk.getZ()); fakePosLook.send(Protocol1_13_2To1_14.class); @@ -247,7 +247,7 @@ public class WorldPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.LEVEL_EVENT, new PacketHandlers() { @Override public void register() { map(Type.INT); // Effect Id @@ -265,7 +265,7 @@ public class WorldPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.MAP_DATA, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.MAP_ITEM_DATA, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -291,7 +291,7 @@ public class WorldPacketRewriter1_14 { }); handler(wrapper -> { short difficulty = wrapper.read(Type.UNSIGNED_BYTE); // 19w11a removed difficulty from respawn - PacketWrapper difficultyPacket = wrapper.create(ClientboundPackets1_14.SERVER_DIFFICULTY); + PacketWrapper difficultyPacket = wrapper.create(ClientboundPackets1_14.CHANGE_DIFFICULTY); difficultyPacket.write(Type.UNSIGNED_BYTE, difficulty); difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a difficultyPacket.scheduleSend(protocol.getClass()); @@ -305,7 +305,7 @@ public class WorldPacketRewriter1_14 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_POSITION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.SET_DEFAULT_SPAWN_POSITION, new PacketHandlers() { @Override public void register() { map(Type.POSITION1_8, Type.POSITION1_14); @@ -314,7 +314,7 @@ public class WorldPacketRewriter1_14 { } static void sendViewDistancePacket(UserConnection connection) { - PacketWrapper setViewDistance = PacketWrapper.create(ClientboundPackets1_14.UPDATE_VIEW_DISTANCE, connection); + PacketWrapper setViewDistance = PacketWrapper.create(ClientboundPackets1_14.SET_CHUNK_CACHE_RADIUS, connection); setViewDistance.write(Type.VAR_INT, WorldPacketRewriter1_14.SERVERSIDE_VIEW_DISTANCE); setViewDistance.send(Protocol1_13_2To1_14.class); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/Protocol1_13To1_13_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/Protocol1_13To1_13_1.java index 02abb8bc1..efec1c653 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/Protocol1_13To1_13_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/Protocol1_13To1_13_1.java @@ -57,7 +57,7 @@ public class Protocol1_13To1_13_1 extends AbstractProtocol(this).register(ClientboundPackets1_13.STATISTICS); + tagRewriter.register(ClientboundPackets1_13.UPDATE_TAGS, RegistryType.ITEM); + new StatisticsRewriter<>(this).register(ClientboundPackets1_13.AWARD_STATS); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/EntityPacketRewriter1_13_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/EntityPacketRewriter1_13_1.java index ab778db64..f105f7a95 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/EntityPacketRewriter1_13_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/EntityPacketRewriter1_13_1.java @@ -30,7 +30,7 @@ public class EntityPacketRewriter1_13_1 { public static void register(Protocol1_13To1_13_1 protocol) { MetadataRewriter1_13_1To1_13 metadataRewriter = protocol.get(MetadataRewriter1_13_1To1_13.class); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity id @@ -61,7 +61,7 @@ public class EntityPacketRewriter1_13_1 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -82,7 +82,7 @@ public class EntityPacketRewriter1_13_1 { } }); - protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -98,7 +98,7 @@ public class EntityPacketRewriter1_13_1 { } }); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.DESTROY_ENTITIES); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.ENTITY_METADATA, Types1_13.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.REMOVE_ENTITIES); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.SET_ENTITY_DATA, Types1_13.METADATA_LIST); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/ItemPacketRewriter1_13_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/ItemPacketRewriter1_13_1.java index 05c704bda..919a15052 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/ItemPacketRewriter1_13_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_13to1_13_1/rewriter/ItemPacketRewriter1_13_1.java @@ -35,12 +35,12 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter recipeRewriter = new RecipeRewriter<>(protocol) { @Override @@ -84,7 +84,7 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_13.UPDATE_RECIPES, wrapper -> { int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { // First id, then type @@ -94,9 +94,9 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter blockRewriter = BlockRewriter.legacy(protocol); - protocol.registerClientbound(ClientboundPackets1_13.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_13.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); Chunk chunk = wrapper.passthrough(ChunkType1_13.forEnvironment(clientWorld.getEnvironment())); @@ -51,11 +51,11 @@ public class WorldPacketRewriter1_13_1 { } }); - blockRewriter.registerBlockAction(ClientboundPackets1_13.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_13.BLOCK_CHANGE); - blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.MULTI_BLOCK_CHANGE); + blockRewriter.registerBlockAction(ClientboundPackets1_13.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_13.BLOCK_UPDATE); + blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.CHUNK_BLOCKS_UPDATE); - protocol.registerClientbound(ClientboundPackets1_13.EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.LEVEL_EVENT, new PacketHandlers() { @Override public void register() { map(Type.INT); // Effect Id @@ -95,7 +95,7 @@ public class WorldPacketRewriter1_13_1 { } }); - protocol.registerClientbound(ClientboundPackets1_13.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_13.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Entity ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_2to1_14_3/Protocol1_14_2To1_14_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_2to1_14_3/Protocol1_14_2To1_14_3.java index 09f6d322d..edc05aa51 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_2to1_14_3/Protocol1_14_2To1_14_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_2to1_14_3/Protocol1_14_2To1_14_3.java @@ -30,7 +30,7 @@ public class Protocol1_14_2To1_14_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_14.MERCHANT_OFFERS, wrapper -> { wrapper.passthrough(Type.VAR_INT); int size = wrapper.passthrough(Type.UNSIGNED_BYTE); for (int i = 0; i < size; i++) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/Protocol1_14_3To1_14_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/Protocol1_14_3To1_14_4.java index caaef8f2a..afe043a31 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/Protocol1_14_3To1_14_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/Protocol1_14_3To1_14_4.java @@ -31,7 +31,7 @@ public class Protocol1_14_3To1_14_4 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_14.MERCHANT_OFFERS, wrapper -> { wrapper.passthrough(Type.VAR_INT); int size = wrapper.passthrough(Type.UNSIGNED_BYTE); for (int i = 0; i < size; i++) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/packet/ClientboundPackets1_14_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/packet/ClientboundPackets1_14_4.java index 192b49c13..4bd5abd38 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/packet/ClientboundPackets1_14_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_3to1_14_4/packet/ClientboundPackets1_14_4.java @@ -21,99 +21,99 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_14_4 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_GLOBAL_ENTITY, // 0x02 - SPAWN_MOB, // 0x03 - SPAWN_PAINTING, // 0x04 - SPAWN_PLAYER, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_GLOBAL_ENTITY, // 0x02 + ADD_MOB, // 0x03 + ADD_PAINTING, // 0x04 + ADD_PLAYER, // 0x05 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - CHAT_MESSAGE, // 0x0E - MULTI_BLOCK_CHANGE, // 0x0F - TAB_COMPLETE, // 0x10 - DECLARE_COMMANDS, // 0x11 - WINDOW_CONFIRMATION, // 0x12 - CLOSE_WINDOW, // 0x13 - WINDOW_ITEMS, // 0x14 - WINDOW_PROPERTY, // 0x15 - SET_SLOT, // 0x16 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + CHAT, // 0x0E + CHUNK_BLOCKS_UPDATE, // 0x0F + COMMAND_SUGGESTIONS, // 0x10 + COMMANDS, // 0x11 + CONTAINER_ACK, // 0x12 + CONTAINER_CLOSE, // 0x13 + CONTAINER_SET_CONTENT, // 0x14 + CONTAINER_SET_DATA, // 0x15 + CONTAINER_SET_SLOT, // 0x16 COOLDOWN, // 0x17 - PLUGIN_MESSAGE, // 0x18 - NAMED_SOUND, // 0x19 + CUSTOM_PAYLOAD, // 0x18 + CUSTOM_SOUND, // 0x19 DISCONNECT, // 0x1A - ENTITY_STATUS, // 0x1B - EXPLOSION, // 0x1C - UNLOAD_CHUNK, // 0x1D + ENTITY_EVENT, // 0x1B + EXPLODE, // 0x1C + FORGET_LEVEL_CHUNK, // 0x1D GAME_EVENT, // 0x1E - OPEN_HORSE_WINDOW, // 0x1F + HORSE_SCREEN_OPEN, // 0x1F KEEP_ALIVE, // 0x20 - CHUNK_DATA, // 0x21 - EFFECT, // 0x22 - SPAWN_PARTICLE, // 0x23 - UPDATE_LIGHT, // 0x24 - JOIN_GAME, // 0x25 - MAP_DATA, // 0x26 - TRADE_LIST, // 0x27 - ENTITY_POSITION, // 0x28 - ENTITY_POSITION_AND_ROTATION, // 0x29 - ENTITY_ROTATION, // 0x2A - ENTITY_MOVEMENT, // 0x2B - VEHICLE_MOVE, // 0x2C + LEVEL_CHUNK, // 0x21 + LEVEL_EVENT, // 0x22 + LEVEL_PARTICLES, // 0x23 + LIGHT_UPDATE, // 0x24 + LOGIN, // 0x25 + MAP_ITEM_DATA, // 0x26 + MERCHANT_OFFERS, // 0x27 + MOVE_ENTITY_POS, // 0x28 + MOVE_ENTITY_POS_ROT, // 0x29 + MOVE_ENTITY_ROT, // 0x2A + MOVE_ENTITY, // 0x2B + MOVE_VEHICLE, // 0x2C OPEN_BOOK, // 0x2D - OPEN_WINDOW, // 0x2E + OPEN_SCREEN, // 0x2E OPEN_SIGN_EDITOR, // 0x2F - CRAFT_RECIPE_RESPONSE, // 0x30 + PLACE_GHOST_RECIPE, // 0x30 PLAYER_ABILITIES, // 0x31 - COMBAT_EVENT, // 0x32 + PLAYER_COMBAT, // 0x32 PLAYER_INFO, // 0x33 - FACE_PLAYER, // 0x34 + PLAYER_LOOK_AT, // 0x34 PLAYER_POSITION, // 0x35 - UNLOCK_RECIPES, // 0x36 - DESTROY_ENTITIES, // 0x37 - REMOVE_ENTITY_EFFECT, // 0x38 + RECIPE, // 0x36 + REMOVE_ENTITIES, // 0x37 + REMOVE_MOB_EFFECT, // 0x38 RESOURCE_PACK, // 0x39 RESPAWN, // 0x3A - ENTITY_HEAD_LOOK, // 0x3B + ROTATE_HEAD, // 0x3B SELECT_ADVANCEMENTS_TAB, // 0x3C - WORLD_BORDER, // 0x3D - CAMERA, // 0x3E - HELD_ITEM_CHANGE, // 0x3F - UPDATE_VIEW_POSITION, // 0x40 - UPDATE_VIEW_DISTANCE, // 0x41 - DISPLAY_SCOREBOARD, // 0x42 - ENTITY_METADATA, // 0x43 - ATTACH_ENTITY, // 0x44 - ENTITY_VELOCITY, // 0x45 - ENTITY_EQUIPMENT, // 0x46 + SET_BORDER, // 0x3D + SET_CAMERA, // 0x3E + SET_CARRIED_ITEM, // 0x3F + SET_CHUNK_CACHE_CENTER, // 0x40 + SET_CHUNK_CACHE_RADIUS, // 0x41 + SET_DISPLAY_OBJECTIVE, // 0x42 + SET_ENTITY_DATA, // 0x43 + SET_ENTITY_LINK, // 0x44 + SET_ENTITY_MOTION, // 0x45 + SET_EQUIPPED_ITEM, // 0x46 SET_EXPERIENCE, // 0x47 - UPDATE_HEALTH, // 0x48 - SCOREBOARD_OBJECTIVE, // 0x49 + SET_HEALTH, // 0x48 + SET_OBJECTIVE, // 0x49 SET_PASSENGERS, // 0x4A - TEAMS, // 0x4B - UPDATE_SCORE, // 0x4C - SPAWN_POSITION, // 0x4D - TIME_UPDATE, // 0x4E - TITLE, // 0x4F - ENTITY_SOUND, // 0x50 + SET_PLAYER_TEAM, // 0x4B + SET_SCORE, // 0x4C + SET_DEFAULT_SPAWN_POSITION, // 0x4D + SET_TIME, // 0x4E + SET_TITLES, // 0x4F + SOUND_ENTITY, // 0x50 SOUND, // 0x51 STOP_SOUND, // 0x52 TAB_LIST, // 0x53 - NBT_QUERY, // 0x54 - COLLECT_ITEM, // 0x55 - ENTITY_TELEPORT, // 0x56 - ADVANCEMENTS, // 0x57 - ENTITY_PROPERTIES, // 0x58 - ENTITY_EFFECT, // 0x59 - DECLARE_RECIPES, // 0x5A - TAGS, // 0x5B - ACKNOWLEDGE_PLAYER_DIGGING; // 0x5C + TAG_QUERY, // 0x54 + TAKE_ITEM_ENTITY, // 0x55 + TELEPORT_ENTITY, // 0x56 + UPDATE_ADVANCEMENTS, // 0x57 + UPDATE_ATTRIBUTES, // 0x58 + UPDATE_MOB_EFFECT, // 0x59 + UPDATE_RECIPES, // 0x5A + UPDATE_TAGS, // 0x5B + BLOCK_BREAK_ACK; // 0x5C @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java index fdf835912..5b05610cb 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java @@ -55,14 +55,14 @@ public class Protocol1_14_4To1_15 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); - soundRewriter.registerSound(ClientboundPackets1_14_4.ENTITY_SOUND); // Entity Sound Effect (added somewhere in 1.14) + soundRewriter.registerSound(ClientboundPackets1_14_4.SOUND_ENTITY); // Entity Sound Effect (added somewhere in 1.14) soundRewriter.registerSound(ClientboundPackets1_14_4.SOUND); - new StatisticsRewriter<>(this).register(ClientboundPackets1_14_4.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_14_4.AWARD_STATS); registerServerbound(ServerboundPackets1_14.EDIT_BOOK, wrapper -> itemRewriter.handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); - tagRewriter.register(ClientboundPackets1_14_4.TAGS, RegistryType.ENTITY); + tagRewriter.register(ClientboundPackets1_14_4.UPDATE_TAGS, RegistryType.ENTITY); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/metadata/MetadataRewriter1_15To1_14_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/metadata/MetadataRewriter1_15To1_14_4.java index 6a4949c28..02bd507bc 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/metadata/MetadataRewriter1_15To1_14_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/metadata/MetadataRewriter1_15To1_14_4.java @@ -34,12 +34,12 @@ public class MetadataRewriter1_15To1_14_4 extends EntityRewriter { + filter().type(EntityTypes1_15.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> { int data = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); - filter().type(EntityTypes1_15.LIVINGENTITY).addIndex(12); + filter().type(EntityTypes1_15.LIVING_ENTITY).addIndex(12); filter().type(EntityTypes1_15.WOLF).removeIndex(18); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/packet/ClientboundPackets1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/packet/ClientboundPackets1_15.java index 3f0bb905c..ecac1c5df 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/packet/ClientboundPackets1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/packet/ClientboundPackets1_15.java @@ -21,99 +21,99 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_15 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_GLOBAL_ENTITY, // 0x02 - SPAWN_MOB, // 0x03 - SPAWN_PAINTING, // 0x04 - SPAWN_PLAYER, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 - BLOCK_BREAK_ANIMATION, // 0x09 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_GLOBAL_ENTITY, // 0x02 + ADD_MOB, // 0x03 + ADD_PAINTING, // 0x04 + ADD_PLAYER, // 0x05 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_BREAK_ACK, // 0x08 + BLOCK_DESTRUCTION, // 0x09 BLOCK_ENTITY_DATA, // 0x0A - BLOCK_ACTION, // 0x0B - BLOCK_CHANGE, // 0x0C - BOSSBAR, // 0x0D - SERVER_DIFFICULTY, // 0x0E - CHAT_MESSAGE, // 0x0F - MULTI_BLOCK_CHANGE, // 0x10 - TAB_COMPLETE, // 0x11 - DECLARE_COMMANDS, // 0x12 - WINDOW_CONFIRMATION, // 0x13 - CLOSE_WINDOW, // 0x14 - WINDOW_ITEMS, // 0x15 - WINDOW_PROPERTY, // 0x16 - SET_SLOT, // 0x17 + BLOCK_EVENT, // 0x0B + BLOCK_UPDATE, // 0x0C + BOSS_EVENT, // 0x0D + CHANGE_DIFFICULTY, // 0x0E + CHAT, // 0x0F + CHUNK_BLOCKS_UPDATE, // 0x10 + COMMAND_SUGGESTIONS, // 0x11 + COMMANDS, // 0x12 + CONTAINER_ACK, // 0x13 + CONTAINER_CLOSE, // 0x14 + CONTAINER_SET_CONTENT, // 0x15 + CONTAINER_SET_DATA, // 0x16 + CONTAINER_SET_SLOT, // 0x17 COOLDOWN, // 0x18 - PLUGIN_MESSAGE, // 0x19 - NAMED_SOUND, // 0x1A + CUSTOM_PAYLOAD, // 0x19 + CUSTOM_SOUND, // 0x1A DISCONNECT, // 0x1B - ENTITY_STATUS, // 0x1C - EXPLOSION, // 0x1D - UNLOAD_CHUNK, // 0x1E + ENTITY_EVENT, // 0x1C + EXPLODE, // 0x1D + FORGET_LEVEL_CHUNK, // 0x1E GAME_EVENT, // 0x1F - OPEN_HORSE_WINDOW, // 0x20 + HORSE_SCREEN_OPEN, // 0x20 KEEP_ALIVE, // 0x21 - CHUNK_DATA, // 0x22 - EFFECT, // 0x23 - SPAWN_PARTICLE, // 0x24 - UPDATE_LIGHT, // 0x25 - JOIN_GAME, // 0x26 - MAP_DATA, // 0x27 - TRADE_LIST, // 0x28 - ENTITY_POSITION, // 0x29 - ENTITY_POSITION_AND_ROTATION, // 0x2A - ENTITY_ROTATION, // 0x2B - ENTITY_MOVEMENT, // 0x2C - VEHICLE_MOVE, // 0x2D + LEVEL_CHUNK, // 0x22 + LEVEL_EVENT, // 0x23 + LEVEL_PARTICLES, // 0x24 + LIGHT_UPDATE, // 0x25 + LOGIN, // 0x26 + MAP_ITEM_DATA, // 0x27 + MERCHANT_OFFERS, // 0x28 + MOVE_ENTITY_POS, // 0x29 + MOVE_ENTITY_POS_ROT, // 0x2A + MOVE_ENTITY_ROT, // 0x2B + MOVE_ENTITY, // 0x2C + MOVE_VEHICLE, // 0x2D OPEN_BOOK, // 0x2E - OPEN_WINDOW, // 0x2F + OPEN_SCREEN, // 0x2F OPEN_SIGN_EDITOR, // 0x30 - CRAFT_RECIPE_RESPONSE, // 0x31 + PLACE_GHOST_RECIPE, // 0x31 PLAYER_ABILITIES, // 0x32 - COMBAT_EVENT, // 0x33 + PLAYER_COMBAT, // 0x33 PLAYER_INFO, // 0x34 - FACE_PLAYER, // 0x35 + PLAYER_LOOK_AT, // 0x35 PLAYER_POSITION, // 0x36 - UNLOCK_RECIPES, // 0x37 - DESTROY_ENTITIES, // 0x38 - REMOVE_ENTITY_EFFECT, // 0x39 + RECIPE, // 0x37 + REMOVE_ENTITIES, // 0x38 + REMOVE_MOB_EFFECT, // 0x39 RESOURCE_PACK, // 0x3A RESPAWN, // 0x3B - ENTITY_HEAD_LOOK, // 0x3C + ROTATE_HEAD, // 0x3C SELECT_ADVANCEMENTS_TAB, // 0x3D - WORLD_BORDER, // 0x3E - CAMERA, // 0x3F - HELD_ITEM_CHANGE, // 0x40 - UPDATE_VIEW_POSITION, // 0x41 - UPDATE_VIEW_DISTANCE, // 0x42 - DISPLAY_SCOREBOARD, // 0x43 - ENTITY_METADATA, // 0x44 - ATTACH_ENTITY, // 0x45 - ENTITY_VELOCITY, // 0x46 - ENTITY_EQUIPMENT, // 0x47 + SET_BORDER, // 0x3E + SET_CAMERA, // 0x3F + SET_CARRIED_ITEM, // 0x40 + SET_CHUNK_CACHE_CENTER, // 0x41 + SET_CHUNK_CACHE_RADIUS, // 0x42 + SET_DISPLAY_OBJECTIVE, // 0x43 + SET_ENTITY_DATA, // 0x44 + SET_ENTITY_LINK, // 0x45 + SET_ENTITY_MOTION, // 0x46 + SET_EQUIPPED_ITEM, // 0x47 SET_EXPERIENCE, // 0x48 - UPDATE_HEALTH, // 0x49 - SCOREBOARD_OBJECTIVE, // 0x4A + SET_HEALTH, // 0x49 + SET_OBJECTIVE, // 0x4A SET_PASSENGERS, // 0x4B - TEAMS, // 0x4C - UPDATE_SCORE, // 0x4D - SPAWN_POSITION, // 0x4E - TIME_UPDATE, // 0x4F - TITLE, // 0x50 - ENTITY_SOUND, // 0x51 + SET_PLAYER_TEAM, // 0x4C + SET_SCORE, // 0x4D + SET_DEFAULT_SPAWN_POSITION, // 0x4E + SET_TIME, // 0x4F + SET_TITLES, // 0x50 + SOUND_ENTITY, // 0x51 SOUND, // 0x52 STOP_SOUND, // 0x53 TAB_LIST, // 0x54 - NBT_QUERY, // 0x55 - COLLECT_ITEM, // 0x56 - ENTITY_TELEPORT, // 0x57 - ADVANCEMENTS, // 0x58 - ENTITY_PROPERTIES, // 0x59 - ENTITY_EFFECT, // 0x5A - DECLARE_RECIPES, // 0x5B - TAGS; // 0x5C + TAG_QUERY, // 0x55 + TAKE_ITEM_ENTITY, // 0x56 + TELEPORT_ENTITY, // 0x57 + UPDATE_ADVANCEMENTS, // 0x58 + UPDATE_ATTRIBUTES, // 0x59 + UPDATE_MOB_EFFECT, // 0x5A + UPDATE_RECIPES, // 0x5B + UPDATE_TAGS; // 0x5C @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/EntityPacketRewriter1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/EntityPacketRewriter1_15.java index f3ae7a00a..83e1e34b7 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/EntityPacketRewriter1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/EntityPacketRewriter1_15.java @@ -36,9 +36,9 @@ public final class EntityPacketRewriter1_15 { public static void register(Protocol1_14_4To1_15 protocol) { MetadataRewriter1_15To1_14_4 metadataRewriter = protocol.get(MetadataRewriter1_15To1_14_4.class); - metadataRewriter.registerTrackerWithData(ClientboundPackets1_14_4.SPAWN_ENTITY, EntityTypes1_15.FALLING_BLOCK); + metadataRewriter.registerTrackerWithData(ClientboundPackets1_14_4.ADD_ENTITY, EntityTypes1_15.FALLING_BLOCK); - protocol.registerClientbound(ClientboundPackets1_14_4.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_14_4.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -59,7 +59,7 @@ public final class EntityPacketRewriter1_15 { } }); - protocol.registerClientbound(ClientboundPackets1_14_4.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_14_4.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -87,7 +87,7 @@ public final class EntityPacketRewriter1_15 { } }); - protocol.registerClientbound(ClientboundPackets1_14_4.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_14_4.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Entity ID @@ -105,8 +105,8 @@ public final class EntityPacketRewriter1_15 { } }); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_14_4.ENTITY_METADATA, Types1_14.METADATA_LIST); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_14_4.DESTROY_ENTITIES); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_14_4.SET_ENTITY_DATA, Types1_14.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_14_4.REMOVE_ENTITIES); } private static void sendMetadataPacket(PacketWrapper wrapper, int entityId, EntityRewriter rewriter) { @@ -123,7 +123,7 @@ public final class EntityPacketRewriter1_15 { // Handle meta rewriter.handleMetadata(entityId, metadata, wrapper.user()); - PacketWrapper metadataPacket = PacketWrapper.create(ClientboundPackets1_15.ENTITY_METADATA, wrapper.user()); + PacketWrapper metadataPacket = PacketWrapper.create(ClientboundPackets1_15.SET_ENTITY_DATA, wrapper.user()); metadataPacket.write(Type.VAR_INT, entityId); metadataPacket.write(Types1_14.METADATA_LIST, metadata); metadataPacket.send(Protocol1_14_4To1_15.class); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/ItemPacketRewriter1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/ItemPacketRewriter1_15.java index 1eefb0cad..be466d274 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/ItemPacketRewriter1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/ItemPacketRewriter1_15.java @@ -33,15 +33,15 @@ public class ItemPacketRewriter1_15 extends ItemRewriter(protocol).register(ClientboundPackets1_14_4.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_14_4.UPDATE_RECIPES); - registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION); + registerClickWindow(ServerboundPackets1_14.CONTAINER_CLICK); + registerCreativeInvAction(ServerboundPackets1_14.SET_CREATIVE_MODE_SLOT); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/WorldPacketRewriter1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/WorldPacketRewriter1_15.java index fcde03c86..712eba740 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/WorldPacketRewriter1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/rewriter/WorldPacketRewriter1_15.java @@ -34,12 +34,12 @@ public final class WorldPacketRewriter1_15 { public static void register(Protocol1_14_4To1_15 protocol) { BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_14_4.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_14_4.BLOCK_CHANGE); - blockRewriter.registerMultiBlockChange(ClientboundPackets1_14_4.MULTI_BLOCK_CHANGE); - blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_14_4.ACKNOWLEDGE_PLAYER_DIGGING); + blockRewriter.registerBlockAction(ClientboundPackets1_14_4.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_14_4.BLOCK_UPDATE); + blockRewriter.registerMultiBlockChange(ClientboundPackets1_14_4.CHUNK_BLOCKS_UPDATE); + blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_14_4.BLOCK_BREAK_ACK); - protocol.registerClientbound(ClientboundPackets1_14_4.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_14_4.LEVEL_CHUNK, wrapper -> { Chunk chunk = wrapper.read(ChunkType1_14.TYPE); wrapper.write(ChunkType1_15.TYPE, chunk); @@ -79,8 +79,8 @@ public final class WorldPacketRewriter1_15 { } }); - blockRewriter.registerEffect(ClientboundPackets1_14_4.EFFECT, 1010, 2001); - protocol.registerClientbound(ClientboundPackets1_14_4.SPAWN_PARTICLE, new PacketHandlers() { + blockRewriter.registerEffect(ClientboundPackets1_14_4.LEVEL_EVENT, 1010, 2001); + protocol.registerClientbound(ClientboundPackets1_14_4.LEVEL_PARTICLES, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Particle ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14to1_14_1/rewriter/EntityPacketRewriter1_14_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14to1_14_1/rewriter/EntityPacketRewriter1_14_1.java index 95b63e7bc..4ade1a8aa 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14to1_14_1/rewriter/EntityPacketRewriter1_14_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14to1_14_1/rewriter/EntityPacketRewriter1_14_1.java @@ -30,7 +30,7 @@ public class EntityPacketRewriter1_14_1 { public static void register(Protocol1_14To1_14_1 protocol) { MetadataRewriter1_14_1To1_14 metadataRewriter = protocol.get(MetadataRewriter1_14_1To1_14.class); - protocol.registerClientbound(ClientboundPackets1_14.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_14.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -51,9 +51,9 @@ public class EntityPacketRewriter1_14_1 { } }); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_14.DESTROY_ENTITIES); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_14.REMOVE_ENTITIES); - protocol.registerClientbound(ClientboundPackets1_14.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_14.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -69,6 +69,6 @@ public class EntityPacketRewriter1_14_1 { } }); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_14.ENTITY_METADATA, Types1_14.METADATA_LIST); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_14.SET_ENTITY_DATA, Types1_14.METADATA_LIST); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java index 1e15d75cb..a26049bf1 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java @@ -78,9 +78,9 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol(this).register(ClientboundPackets1_15.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_15.AWARD_STATS); // Login Success registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), wrapper -> { @@ -125,7 +125,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.registerSound(ClientboundPackets1_15.SOUND); - soundRewriter.registerSound(ClientboundPackets1_15.ENTITY_SOUND); + soundRewriter.registerSound(ClientboundPackets1_15.SOUND_ENTITY); - registerServerbound(ServerboundPackets1_16.INTERACT_ENTITY, wrapper -> { + registerServerbound(ServerboundPackets1_16.INTERACT, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity Id int action = wrapper.passthrough(Type.VAR_INT); if (action == 0 || action == 2) { @@ -163,7 +163,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol { + filter().type(EntityTypes1_16.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> { int data = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ClientboundPackets1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ClientboundPackets1_16.java index 62658cf0c..17487a1b7 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ClientboundPackets1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ClientboundPackets1_16.java @@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_16 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_MOB, // 0x02 - SPAWN_PAINTING, // 0x03 - SPAWN_PLAYER, // 0x04 - ENTITY_ANIMATION, // 0x05 - STATISTICS, // 0x06 - ACKNOWLEDGE_PLAYER_DIGGING, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_MOB, // 0x02 + ADD_PAINTING, // 0x03 + ADD_PLAYER, // 0x04 + ANIMATE, // 0x05 + AWARD_STATS, // 0x06 + BLOCK_BREAK_ACK, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - CHAT_MESSAGE, // 0x0E - MULTI_BLOCK_CHANGE, // 0x0F - TAB_COMPLETE, // 0x10 - DECLARE_COMMANDS, // 0x11 - WINDOW_CONFIRMATION, // 0x12 - CLOSE_WINDOW, // 0x13 - WINDOW_ITEMS, // 0x14 - WINDOW_PROPERTY, // 0x15 - SET_SLOT, // 0x16 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + CHAT, // 0x0E + CHUNK_BLOCKS_UPDATE, // 0x0F + COMMAND_SUGGESTIONS, // 0x10 + COMMANDS, // 0x11 + CONTAINER_ACK, // 0x12 + CONTAINER_CLOSE, // 0x13 + CONTAINER_SET_CONTENT, // 0x14 + CONTAINER_SET_DATA, // 0x15 + CONTAINER_SET_SLOT, // 0x16 COOLDOWN, // 0x17 - PLUGIN_MESSAGE, // 0x18 - NAMED_SOUND, // 0x19 + CUSTOM_PAYLOAD, // 0x18 + CUSTOM_SOUND, // 0x19 DISCONNECT, // 0x1A - ENTITY_STATUS, // 0x1B - EXPLOSION, // 0x1C - UNLOAD_CHUNK, // 0x1D + ENTITY_EVENT, // 0x1B + EXPLODE, // 0x1C + FORGET_LEVEL_CHUNK, // 0x1D GAME_EVENT, // 0x1E - OPEN_HORSE_WINDOW, // 0x1F + HORSE_SCREEN_OPEN, // 0x1F KEEP_ALIVE, // 0x20 - CHUNK_DATA, // 0x21 - EFFECT, // 0x22 - SPAWN_PARTICLE, // 0x23 - UPDATE_LIGHT, // 0x24 - JOIN_GAME, // 0x25 - MAP_DATA, // 0x26 - TRADE_LIST, // 0x27 - ENTITY_POSITION, // 0x28 - ENTITY_POSITION_AND_ROTATION, // 0x29 - ENTITY_ROTATION, // 0x2A - ENTITY_MOVEMENT, // 0x2B - VEHICLE_MOVE, // 0x2C + LEVEL_CHUNK, // 0x21 + LEVEL_EVENT, // 0x22 + LEVEL_PARTICLES, // 0x23 + LIGHT_UPDATE, // 0x24 + LOGIN, // 0x25 + MAP_ITEM_DATA, // 0x26 + MERCHANT_OFFERS, // 0x27 + MOVE_ENTITY_POS, // 0x28 + MOVE_ENTITY_POS_ROT, // 0x29 + MOVE_ENTITY_ROT, // 0x2A + MOVE_ENTITY, // 0x2B + MOVE_VEHICLE, // 0x2C OPEN_BOOK, // 0x2D - OPEN_WINDOW, // 0x2E + OPEN_SCREEN, // 0x2E OPEN_SIGN_EDITOR, // 0x2F - CRAFT_RECIPE_RESPONSE, // 0x30 + PLACE_GHOST_RECIPE, // 0x30 PLAYER_ABILITIES, // 0x31 - COMBAT_EVENT, // 0x32 + PLAYER_COMBAT, // 0x32 PLAYER_INFO, // 0x33 - FACE_PLAYER, // 0x34 + PLAYER_LOOK_AT, // 0x34 PLAYER_POSITION, // 0x35 - UNLOCK_RECIPES, // 0x36 - DESTROY_ENTITIES, // 0x37 - REMOVE_ENTITY_EFFECT, // 0x38 + RECIPE, // 0x36 + REMOVE_ENTITIES, // 0x37 + REMOVE_MOB_EFFECT, // 0x38 RESOURCE_PACK, // 0x39 RESPAWN, // 0x3A - ENTITY_HEAD_LOOK, // 0x3B + ROTATE_HEAD, // 0x3B SELECT_ADVANCEMENTS_TAB, // 0x3C - WORLD_BORDER, // 0x3D - CAMERA, // 0x3E - HELD_ITEM_CHANGE, // 0x3F - UPDATE_VIEW_POSITION, // 0x40 - UPDATE_VIEW_DISTANCE, // 0x41 - SPAWN_POSITION, // 0x42 - DISPLAY_SCOREBOARD, // 0x43 - ENTITY_METADATA, // 0x44 - ATTACH_ENTITY, // 0x45 - ENTITY_VELOCITY, // 0x46 - ENTITY_EQUIPMENT, // 0x47 + SET_BORDER, // 0x3D + SET_CAMERA, // 0x3E + SET_CARRIED_ITEM, // 0x3F + SET_CHUNK_CACHE_CENTER, // 0x40 + SET_CHUNK_CACHE_RADIUS, // 0x41 + SET_DEFAULT_SPAWN_POSITION, // 0x42 + SET_DISPLAY_OBJECTIVE, // 0x43 + SET_ENTITY_DATA, // 0x44 + SET_ENTITY_LINK, // 0x45 + SET_ENTITY_MOTION, // 0x46 + SET_EQUIPMENT, // 0x47 SET_EXPERIENCE, // 0x48 - UPDATE_HEALTH, // 0x49 - SCOREBOARD_OBJECTIVE, // 0x4A + SET_HEALTH, // 0x49 + SET_OBJECTIVE, // 0x4A SET_PASSENGERS, // 0x4B - TEAMS, // 0x4C - UPDATE_SCORE, // 0x4D - TIME_UPDATE, // 0x4E - TITLE, // 0x4F - ENTITY_SOUND, // 0x50 + SET_PLAYER_TEAM, // 0x4C + SET_SCORE, // 0x4D + SET_TIME, // 0x4E + SET_TITLES, // 0x4F + SOUND_ENTITY, // 0x50 SOUND, // 0x51 STOP_SOUND, // 0x52 TAB_LIST, // 0x53 - NBT_QUERY, // 0x54 - COLLECT_ITEM, // 0x55 - ENTITY_TELEPORT, // 0x56 - ADVANCEMENTS, // 0x57 - ENTITY_PROPERTIES, // 0x58 - ENTITY_EFFECT, // 0x59 - DECLARE_RECIPES, // 0x5A - TAGS; // 0x5B + TAG_QUERY, // 0x54 + TAKE_ITEM_ENTITY, // 0x55 + TELEPORT_ENTITY, // 0x56 + UPDATE_ADVANCEMENTS, // 0x57 + UPDATE_ATTRIBUTES, // 0x58 + UPDATE_MOB_EFFECT, // 0x59 + UPDATE_RECIPES, // 0x5A + UPDATE_TAGS; // 0x5B @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ServerboundPackets1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ServerboundPackets1_16.java index 64469f2e1..85e6de6f4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ServerboundPackets1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/packet/ServerboundPackets1_16.java @@ -21,52 +21,52 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_16 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - SET_DIFFICULTY, // 0x02 - CHAT_MESSAGE, // 0x03 - CLIENT_STATUS, // 0x04 - CLIENT_SETTINGS, // 0x05 - TAB_COMPLETE, // 0x06 - WINDOW_CONFIRMATION, // 0x07 - CLICK_WINDOW_BUTTON, // 0x08 - CLICK_WINDOW, // 0x09 - CLOSE_WINDOW, // 0x0A - PLUGIN_MESSAGE, // 0x0B + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHANGE_DIFFICULTY, // 0x02 + CHAT, // 0x03 + CLIENT_COMMAND, // 0x04 + CLIENT_INFORMATION, // 0x05 + COMMAND_SUGGESTION, // 0x06 + CONTAINER_ACK, // 0x07 + CONTAINER_BUTTON_CLICK, // 0x08 + CONTAINER_CLICK, // 0x09 + CONTAINER_CLOSE, // 0x0A + CUSTOM_PAYLOAD, // 0x0B EDIT_BOOK, // 0x0C - ENTITY_NBT_REQUEST, // 0x0D - INTERACT_ENTITY, // 0x0E - GENERATE_JIGSAW, // 0x0F + ENTITY_TAG_QUERY, // 0x0D + INTERACT, // 0x0E + JIGSAW_GENERATE, // 0x0F KEEP_ALIVE, // 0x10 LOCK_DIFFICULTY, // 0x11 - PLAYER_POSITION, // 0x12 - PLAYER_POSITION_AND_ROTATION, // 0x13 - PLAYER_ROTATION, // 0x14 - PLAYER_MOVEMENT, // 0x15 - VEHICLE_MOVE, // 0x16 - STEER_BOAT, // 0x17 + MOVE_PLAYER_POS, // 0x12 + MOVE_PLAYER_POS_ROT, // 0x13 + MOVE_PLAYER_ROT, // 0x14 + MOVE_PLAYER_STATUS_ONLY, // 0x15 + MOVE_VEHICLE, // 0x16 + PADDLE_BOAT, // 0x17 PICK_ITEM, // 0x18 - CRAFT_RECIPE_REQUEST, // 0x19 + PLACE_RECIPE, // 0x19 PLAYER_ABILITIES, // 0x1A - PLAYER_DIGGING, // 0x1B - ENTITY_ACTION, // 0x1C - STEER_VEHICLE, // 0x1D - RECIPE_BOOK_DATA, // 0x1E + PLAYER_ACTION, // 0x1B + PLAYER_COMMAND, // 0x1C + PLAYER_INPUT, // 0x1D + RECIPE_BOOK_UPDATE, // 0x1E RENAME_ITEM, // 0x1F - RESOURCE_PACK_STATUS, // 0x20 - ADVANCEMENT_TAB, // 0x21 + RESOURCE_PACK, // 0x20 + SEEN_ADVANCEMENTS, // 0x21 SELECT_TRADE, // 0x22 - SET_BEACON_EFFECT, // 0x23 - HELD_ITEM_CHANGE, // 0x24 - UPDATE_COMMAND_BLOCK, // 0x25 - UPDATE_COMMAND_BLOCK_MINECART, // 0x26 - CREATIVE_INVENTORY_ACTION, // 0x27 - UPDATE_JIGSAW_BLOCK, // 0x28 - UPDATE_STRUCTURE_BLOCK, // 0x29 - UPDATE_SIGN, // 0x2A - ANIMATION, // 0x2B - SPECTATE, // 0x2C - PLAYER_BLOCK_PLACEMENT, // 0x2D + SET_BEACON, // 0x23 + SET_CARRIED_ITEM, // 0x24 + SET_COMMAND_BLOCK, // 0x25 + SET_COMMAND_MINECART, // 0x26 + SET_CREATIVE_MODE_SLOT, // 0x27 + SET_JIGSAW_BLOCK, // 0x28 + SET_STRUCTURE_BLOCK, // 0x29 + SIGN_UPDATE, // 0x2A + SWING, // 0x2B + TELEPORT_TO_ENTITY, // 0x2C + USE_ITEM_ON, // 0x2D USE_ITEM; // 0x2E @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/EntityPacketRewriter1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/EntityPacketRewriter1_16.java index ccd77d202..cdc444ec1 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/EntityPacketRewriter1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/EntityPacketRewriter1_16.java @@ -160,7 +160,7 @@ public class EntityPacketRewriter1_16 { MetadataRewriter1_16To1_15_2 metadataRewriter = protocol.get(MetadataRewriter1_16To1_15_2.class); // Spawn lightning -> Spawn entity - protocol.registerClientbound(ClientboundPackets1_15.SPAWN_GLOBAL_ENTITY, ClientboundPackets1_16.SPAWN_ENTITY, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_15.ADD_GLOBAL_ENTITY, ClientboundPackets1_16.ADD_ENTITY, wrapper -> { int entityId = wrapper.passthrough(Type.VAR_INT); byte type = wrapper.read(Type.BYTE); if (type != 1) { @@ -185,11 +185,11 @@ public class EntityPacketRewriter1_16 { wrapper.write(Type.SHORT, (short) 0); // velocity }); - metadataRewriter.registerTrackerWithData(ClientboundPackets1_15.SPAWN_ENTITY, EntityTypes1_16.FALLING_BLOCK); - metadataRewriter.registerTracker(ClientboundPackets1_15.SPAWN_MOB); - metadataRewriter.registerTracker(ClientboundPackets1_15.SPAWN_PLAYER, EntityTypes1_16.PLAYER); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_15.ENTITY_METADATA, Types1_14.METADATA_LIST, Types1_16.METADATA_LIST); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_15.DESTROY_ENTITIES); + metadataRewriter.registerTrackerWithData(ClientboundPackets1_15.ADD_ENTITY, EntityTypes1_16.FALLING_BLOCK); + metadataRewriter.registerTracker(ClientboundPackets1_15.ADD_MOB); + metadataRewriter.registerTracker(ClientboundPackets1_15.ADD_PLAYER, EntityTypes1_16.PLAYER); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_15.SET_ENTITY_DATA, Types1_14.METADATA_LIST, Types1_16.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_15.REMOVE_ENTITIES); protocol.registerClientbound(ClientboundPackets1_15.RESPAWN, new PacketHandlers() { @Override @@ -208,7 +208,7 @@ public class EntityPacketRewriter1_16 { } }); - protocol.registerClientbound(ClientboundPackets1_15.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_15.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // Entity ID @@ -235,7 +235,7 @@ public class EntityPacketRewriter1_16 { } }); - protocol.registerClientbound(ClientboundPackets1_15.ENTITY_PROPERTIES, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_15.UPDATE_ATTRIBUTES, wrapper -> { wrapper.passthrough(Type.VAR_INT); int size = wrapper.passthrough(Type.INT); int actualSize = size; @@ -276,7 +276,7 @@ public class EntityPacketRewriter1_16 { } }); - protocol.registerServerbound(ServerboundPackets1_16.ANIMATION, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_16.SWING, wrapper -> { InventoryTracker1_16 inventoryTracker = wrapper.user().get(InventoryTracker1_16.class); // Don't send an arm swing if the player has an inventory opened. if (inventoryTracker.isInventoryOpen()) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/ItemPacketRewriter1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/ItemPacketRewriter1_16.java index d14326c25..a398d5505 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/ItemPacketRewriter1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/ItemPacketRewriter1_16.java @@ -50,14 +50,14 @@ public class ItemPacketRewriter1_16 extends ItemRewriter { - PacketWrapper clearPacket = wrapper.create(ClientboundPackets1_16.SET_SLOT); + PacketWrapper clearPacket = wrapper.create(ClientboundPackets1_16.CONTAINER_SET_SLOT); clearPacket.write(Type.UNSIGNED_BYTE, (short) -1); clearPacket.write(Type.SHORT, (short) -1); clearPacket.write(Type.ITEM1_13_2, null); clearPacket.send(Protocol1_15_2To1_16.class); }; - protocol.registerClientbound(ClientboundPackets1_15.OPEN_WINDOW, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_15.OPEN_SCREEN, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // Window Id @@ -76,7 +76,7 @@ public class ItemPacketRewriter1_16 extends ItemRewriter(protocol).register(ClientboundPackets1_15.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_15.UPDATE_RECIPES); - registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION); + registerClickWindow(ServerboundPackets1_16.CONTAINER_CLICK); + registerCreativeInvAction(ServerboundPackets1_16.SET_CREATIVE_MODE_SLOT); - protocol.registerServerbound(ServerboundPackets1_16.CLOSE_WINDOW, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_16.CONTAINER_CLOSE, wrapper -> { InventoryTracker1_16 inventoryTracker = wrapper.user().get(InventoryTracker1_16.class); inventoryTracker.setInventoryOpen(false); }); protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); - registerSpawnParticle(ClientboundPackets1_15.SPAWN_PARTICLE, Type.DOUBLE); + registerSpawnParticle(ClientboundPackets1_15.LEVEL_PARTICLES, Type.DOUBLE); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/WorldPacketRewriter1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/WorldPacketRewriter1_16.java index cfd920ae4..b0bcea4d5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/WorldPacketRewriter1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/rewriter/WorldPacketRewriter1_16.java @@ -46,12 +46,12 @@ public class WorldPacketRewriter1_16 { public static void register(Protocol1_15_2To1_16 protocol) { BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_15.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_CHANGE); - blockRewriter.registerMultiBlockChange(ClientboundPackets1_15.MULTI_BLOCK_CHANGE); - blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_15.ACKNOWLEDGE_PLAYER_DIGGING); + blockRewriter.registerBlockAction(ClientboundPackets1_15.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_UPDATE); + blockRewriter.registerMultiBlockChange(ClientboundPackets1_15.CHUNK_BLOCKS_UPDATE); + blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_15.BLOCK_BREAK_ACK); - protocol.registerClientbound(ClientboundPackets1_15.UPDATE_LIGHT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_15.LIGHT_UPDATE, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // x @@ -60,7 +60,7 @@ public class WorldPacketRewriter1_16 { } }); - protocol.registerClientbound(ClientboundPackets1_15.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_15.LEVEL_CHUNK, wrapper -> { Chunk chunk = wrapper.read(ChunkType1_15.TYPE); wrapper.write(ChunkType1_16.TYPE, chunk); @@ -100,7 +100,7 @@ public class WorldPacketRewriter1_16 { handleBlockEntity(protocol, wrapper.user(), tag); }); - blockRewriter.registerEffect(ClientboundPackets1_15.EFFECT, 1010, 2001); + blockRewriter.registerEffect(ClientboundPackets1_15.LEVEL_EVENT, 1010, 2001); } private static void handleBlockEntity(Protocol1_15_2To1_16 protocol, UserConnection connection, CompoundTag compoundTag) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java index 3a2430eac..a3c29c168 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java @@ -54,16 +54,16 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol(this).register(ClientboundPackets1_16.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_16.AWARD_STATS); SoundRewriter soundRewriter = new SoundRewriter<>(this); soundRewriter.registerSound(ClientboundPackets1_16.SOUND); - soundRewriter.registerSound(ClientboundPackets1_16.ENTITY_SOUND); + soundRewriter.registerSound(ClientboundPackets1_16.SOUND_ENTITY); // Recipe book data has been split into 2 separate packets - registerServerbound(ServerboundPackets1_16_2.RECIPE_BOOK_DATA, wrapper -> { + registerServerbound(ServerboundPackets1_16_2.RECIPE_BOOK_CHANGE_SETTINGS, ServerboundPackets1_16.RECIPE_BOOK_UPDATE, wrapper -> { int recipeType = wrapper.read(Type.VAR_INT); boolean open = wrapper.read(Type.BOOLEAN); boolean filter = wrapper.read(Type.BOOLEAN); @@ -77,7 +77,7 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol { + registerServerbound(ServerboundPackets1_16_2.RECIPE_BOOK_SEEN_RECIPE, ServerboundPackets1_16.RECIPE_BOOK_UPDATE, wrapper -> { String recipe = wrapper.read(Type.STRING); wrapper.write(Type.VAR_INT, 0); // Shown wrapper.write(Type.STRING, recipe); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/metadata/MetadataRewriter1_16_2To1_16_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/metadata/MetadataRewriter1_16_2To1_16_1.java index 7131ff15e..c5b897e5e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/metadata/MetadataRewriter1_16_2To1_16_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/metadata/MetadataRewriter1_16_2To1_16_1.java @@ -33,7 +33,7 @@ public class MetadataRewriter1_16_2To1_16_1 extends EntityRewriter { + filter().type(EntityTypes1_16_2.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> { int data = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ClientboundPackets1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ClientboundPackets1_16_2.java index c27cdcfcb..cccba5b53 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ClientboundPackets1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ClientboundPackets1_16_2.java @@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_16_2 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_MOB, // 0x02 - SPAWN_PAINTING, // 0x03 - SPAWN_PLAYER, // 0x04 - ENTITY_ANIMATION, // 0x05 - STATISTICS, // 0x06 - ACKNOWLEDGE_PLAYER_DIGGING, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_MOB, // 0x02 + ADD_PAINTING, // 0x03 + ADD_PLAYER, // 0x04 + ANIMATE, // 0x05 + AWARD_STATS, // 0x06 + BLOCK_BREAK_ACK, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - CHAT_MESSAGE, // 0x0E - TAB_COMPLETE, // 0x0F - DECLARE_COMMANDS, // 0x10 - WINDOW_CONFIRMATION, // 0x11 - CLOSE_WINDOW, // 0x12 - WINDOW_ITEMS, // 0x13 - WINDOW_PROPERTY, // 0x14 - SET_SLOT, // 0x15 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + CHAT, // 0x0E + COMMAND_SUGGESTIONS, // 0x0F + COMMANDS, // 0x10 + CONTAINER_ACK, // 0x11 + CONTAINER_CLOSE, // 0x12 + CONTAINER_SET_CONTENT, // 0x13 + CONTAINER_SET_DATA, // 0x14 + CONTAINER_SET_SLOT, // 0x15 COOLDOWN, // 0x16 - PLUGIN_MESSAGE, // 0x17 - NAMED_SOUND, // 0x18 + CUSTOM_PAYLOAD, // 0x17 + CUSTOM_SOUND, // 0x18 DISCONNECT, // 0x19 - ENTITY_STATUS, // 0x1A - EXPLOSION, // 0x1B - UNLOAD_CHUNK, // 0x1C + ENTITY_EVENT, // 0x1A + EXPLODE, // 0x1B + FORGET_LEVEL_CHUNK, // 0x1C GAME_EVENT, // 0x1D - OPEN_HORSE_WINDOW, // 0x1E + HORSE_SCREEN_OPEN, // 0x1E KEEP_ALIVE, // 0x1F - CHUNK_DATA, // 0x20 - EFFECT, // 0x21 - SPAWN_PARTICLE, // 0x22 - UPDATE_LIGHT, // 0x23 - JOIN_GAME, // 0x24 - MAP_DATA, // 0x25 - TRADE_LIST, // 0x26 - ENTITY_POSITION, // 0x27 - ENTITY_POSITION_AND_ROTATION, // 0x28 - ENTITY_ROTATION, // 0x29 - ENTITY_MOVEMENT, // 0x2A - VEHICLE_MOVE, // 0x2B + LEVEL_CHUNK, // 0x20 + LEVEL_EVENT, // 0x21 + LEVEL_PARTICLES, // 0x22 + LIGHT_UPDATE, // 0x23 + LOGIN, // 0x24 + MAP_ITEM_DATA, // 0x25 + MERCHANT_OFFERS, // 0x26 + MOVE_ENTITY_POS, // 0x27 + MOVE_ENTITY_POS_ROT, // 0x28 + MOVE_ENTITY_ROT, // 0x29 + MOVE_ENTITY, // 0x2A + MOVE_VEHICLE, // 0x2B OPEN_BOOK, // 0x2C - OPEN_WINDOW, // 0x2D + OPEN_SCREEN, // 0x2D OPEN_SIGN_EDITOR, // 0x2E - CRAFT_RECIPE_RESPONSE, // 0x2F + PLACE_GHOST_RECIPE, // 0x2F PLAYER_ABILITIES, // 0x30 - COMBAT_EVENT, // 0x31 + PLAYER_COMBAT, // 0x31 PLAYER_INFO, // 0x32 - FACE_PLAYER, // 0x33 + PLAYER_LOOK_AT, // 0x33 PLAYER_POSITION, // 0x34 - UNLOCK_RECIPES, // 0x35 - DESTROY_ENTITIES, // 0x36 - REMOVE_ENTITY_EFFECT, // 0x37 + RECIPE, // 0x35 + REMOVE_ENTITIES, // 0x36 + REMOVE_MOB_EFFECT, // 0x37 RESOURCE_PACK, // 0x38 RESPAWN, // 0x39 - ENTITY_HEAD_LOOK, // 0x3A - MULTI_BLOCK_CHANGE, // 0x3B + ROTATE_HEAD, // 0x3A + SECTION_BLOCKS_UPDATE, // 0x3B SELECT_ADVANCEMENTS_TAB, // 0x3C - WORLD_BORDER, // 0x3D - CAMERA, // 0x3E - HELD_ITEM_CHANGE, // 0x3F - UPDATE_VIEW_POSITION, // 0x40 - UPDATE_VIEW_DISTANCE, // 0x41 - SPAWN_POSITION, // 0x42 - DISPLAY_SCOREBOARD, // 0x43 - ENTITY_METADATA, // 0x44 - ATTACH_ENTITY, // 0x45 - ENTITY_VELOCITY, // 0x46 - ENTITY_EQUIPMENT, // 0x47 + SET_BORDER, // 0x3D + SET_CAMERA, // 0x3E + SET_CARRIED_ITEM, // 0x3F + SET_CHUNK_CACHE_CENTER, // 0x40 + SET_CHUNK_CACHE_RADIUS, // 0x41 + SET_DEFAULT_SPAWN_POSITION, // 0x42 + SET_DISPLAY_OBJECTIVE, // 0x43 + SET_ENTITY_DATA, // 0x44 + SET_ENTITY_LINK, // 0x45 + SET_ENTITY_MOTION, // 0x46 + SET_EQUIPMENT, // 0x47 SET_EXPERIENCE, // 0x48 - UPDATE_HEALTH, // 0x49 - SCOREBOARD_OBJECTIVE, // 0x4A + SET_HEALTH, // 0x49 + SET_OBJECTIVE, // 0x4A SET_PASSENGERS, // 0x4B - TEAMS, // 0x4C - UPDATE_SCORE, // 0x4D - TIME_UPDATE, // 0x4E - TITLE, // 0x4F - ENTITY_SOUND, // 0x50 + SET_PLAYER_TEAM, // 0x4C + SET_SCORE, // 0x4D + SET_TIME, // 0x4E + SET_TITLES, // 0x4F + SOUND_ENTITY, // 0x50 SOUND, // 0x51 STOP_SOUND, // 0x52 TAB_LIST, // 0x53 - NBT_QUERY, // 0x54 - COLLECT_ITEM, // 0x55 - ENTITY_TELEPORT, // 0x56 - ADVANCEMENTS, // 0x57 - ENTITY_PROPERTIES, // 0x58 - ENTITY_EFFECT, // 0x59 - DECLARE_RECIPES, // 0x5A - TAGS; // 0x5B + TAG_QUERY, // 0x54 + TAKE_ITEM_ENTITY, // 0x55 + TELEPORT_ENTITY, // 0x56 + UPDATE_ADVANCEMENTS, // 0x57 + UPDATE_ATTRIBUTES, // 0x58 + UPDATE_MOB_EFFECT, // 0x59 + UPDATE_RECIPES, // 0x5A + UPDATE_TAGS; // 0x5B @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ServerboundPackets1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ServerboundPackets1_16_2.java index 97577d04e..defef96a5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ServerboundPackets1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/packet/ServerboundPackets1_16_2.java @@ -21,53 +21,53 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_16_2 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - SET_DIFFICULTY, // 0x02 - CHAT_MESSAGE, // 0x03 - CLIENT_STATUS, // 0x04 - CLIENT_SETTINGS, // 0x05 - TAB_COMPLETE, // 0x06 - WINDOW_CONFIRMATION, // 0x07 - CLICK_WINDOW_BUTTON, // 0x08 - CLICK_WINDOW, // 0x09 - CLOSE_WINDOW, // 0x0A - PLUGIN_MESSAGE, // 0x0B + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHANGE_DIFFICULTY, // 0x02 + CHAT, // 0x03 + CLIENT_COMMAND, // 0x04 + CLIENT_INFORMATION, // 0x05 + COMMAND_SUGGESTION, // 0x06 + CONTAINER_ACK, // 0x07 + CONTAINER_BUTTON_CLICK, // 0x08 + CONTAINER_CLICK, // 0x09 + CONTAINER_CLOSE, // 0x0A + CUSTOM_PAYLOAD, // 0x0B EDIT_BOOK, // 0x0C - ENTITY_NBT_REQUEST, // 0x0D - INTERACT_ENTITY, // 0x0E - GENERATE_JIGSAW, // 0x0F + ENTITY_TAG_QUERY, // 0x0D + INTERACT, // 0x0E + JIGSAW_GENERATE, // 0x0F KEEP_ALIVE, // 0x10 LOCK_DIFFICULTY, // 0x11 - PLAYER_POSITION, // 0x12 - PLAYER_POSITION_AND_ROTATION, // 0x13 - PLAYER_ROTATION, // 0x14 - PLAYER_MOVEMENT, // 0x15 - VEHICLE_MOVE, // 0x16 - STEER_BOAT, // 0x17 + MOVE_PLAYER_POS, // 0x12 + MOVE_PLAYER_POS_ROT, // 0x13 + MOVE_PLAYER_ROT, // 0x14 + MOVE_PLAYER_STATUS_ONLY, // 0x15 + MOVE_VEHICLE, // 0x16 + PADDLE_BOAT, // 0x17 PICK_ITEM, // 0x18 - CRAFT_RECIPE_REQUEST, // 0x19 + PLACE_RECIPE, // 0x19 PLAYER_ABILITIES, // 0x1A - PLAYER_DIGGING, // 0x1B - ENTITY_ACTION, // 0x1C - STEER_VEHICLE, // 0x1D - RECIPE_BOOK_DATA, // 0x1E - SEEN_RECIPE, // 0x1F + PLAYER_ACTION, // 0x1B + PLAYER_COMMAND, // 0x1C + PLAYER_INPUT, // 0x1D + RECIPE_BOOK_CHANGE_SETTINGS, // 0x1E + RECIPE_BOOK_SEEN_RECIPE, // 0x1F RENAME_ITEM, // 0x20 - RESOURCE_PACK_STATUS, // 0x21 - ADVANCEMENT_TAB, // 0x22 + RESOURCE_PACK, // 0x21 + SEEN_ADVANCEMENTS, // 0x22 SELECT_TRADE, // 0x23 - SET_BEACON_EFFECT, // 0x24 - HELD_ITEM_CHANGE, // 0x25 - UPDATE_COMMAND_BLOCK, // 0x26 - UPDATE_COMMAND_BLOCK_MINECART, // 0x27 - CREATIVE_INVENTORY_ACTION, // 0x28 - UPDATE_JIGSAW_BLOCK, // 0x29 - UPDATE_STRUCTURE_BLOCK, // 0x2A - UPDATE_SIGN, // 0x2B - ANIMATION, // 0x2C - SPECTATE, // 0x2D - PLAYER_BLOCK_PLACEMENT, // 0x2E + SET_BEACON, // 0x24 + SET_CARRIED_ITEM, // 0x25 + SET_COMMAND_BLOCK, // 0x26 + SET_COMMAND_MINECART, // 0x27 + SET_CREATIVE_MODE_SLOT, // 0x28 + SET_JIGSAW_BLOCK, // 0x29 + SET_STRUCTURE_BLOCK, // 0x2A + SIGN_UPDATE, // 0x2B + SWING, // 0x2C + TELEPORT_TO_ENTITY, // 0x2D + USE_ITEM_ON, // 0x2E USE_ITEM; // 0x2F @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/EntityPacketRewriter1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/EntityPacketRewriter1_16_2.java index 3c4786c09..985283fc0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/EntityPacketRewriter1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/EntityPacketRewriter1_16_2.java @@ -31,13 +31,13 @@ public class EntityPacketRewriter1_16_2 { public static void register(Protocol1_16_1To1_16_2 protocol) { MetadataRewriter1_16_2To1_16_1 metadataRewriter = protocol.get(MetadataRewriter1_16_2To1_16_1.class); - metadataRewriter.registerTrackerWithData(ClientboundPackets1_16.SPAWN_ENTITY, EntityTypes1_16_2.FALLING_BLOCK); - metadataRewriter.registerTracker(ClientboundPackets1_16.SPAWN_MOB); - metadataRewriter.registerTracker(ClientboundPackets1_16.SPAWN_PLAYER, EntityTypes1_16_2.PLAYER); - metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16.ENTITY_METADATA, Types1_16.METADATA_LIST); - metadataRewriter.registerRemoveEntities(ClientboundPackets1_16.DESTROY_ENTITIES); + metadataRewriter.registerTrackerWithData(ClientboundPackets1_16.ADD_ENTITY, EntityTypes1_16_2.FALLING_BLOCK); + metadataRewriter.registerTracker(ClientboundPackets1_16.ADD_MOB); + metadataRewriter.registerTracker(ClientboundPackets1_16.ADD_PLAYER, EntityTypes1_16_2.PLAYER); + metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16.SET_ENTITY_DATA, Types1_16.METADATA_LIST); + metadataRewriter.registerRemoveEntities(ClientboundPackets1_16.REMOVE_ENTITIES); - protocol.registerClientbound(ClientboundPackets1_16.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_16.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // Entity ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/ItemPacketRewriter1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/ItemPacketRewriter1_16_2.java index 6f9fd1695..46641e2ff 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/ItemPacketRewriter1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/ItemPacketRewriter1_16_2.java @@ -33,13 +33,13 @@ public class ItemPacketRewriter1_16_2 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_16.RECIPE, wrapper -> { wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.BOOLEAN); // Open wrapper.passthrough(Type.BOOLEAN); // Filter @@ -52,12 +52,12 @@ public class ItemPacketRewriter1_16_2 extends ItemRewriter(protocol).register(ClientboundPackets1_16.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_16.UPDATE_RECIPES); - registerClickWindow(ServerboundPackets1_16_2.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION); + registerClickWindow(ServerboundPackets1_16_2.CONTAINER_CLICK); + registerCreativeInvAction(ServerboundPackets1_16_2.SET_CREATIVE_MODE_SLOT); protocol.registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); - registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.DOUBLE); + registerSpawnParticle(ClientboundPackets1_16.LEVEL_PARTICLES, Type.DOUBLE); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/WorldPacketRewriter1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/WorldPacketRewriter1_16_2.java index 423ec6ec9..46aa10319 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/WorldPacketRewriter1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/rewriter/WorldPacketRewriter1_16_2.java @@ -41,11 +41,11 @@ public class WorldPacketRewriter1_16_2 { public static void register(Protocol1_16_1To1_16_2 protocol) { BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_CHANGE); - blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16.ACKNOWLEDGE_PLAYER_DIGGING); + blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_UPDATE); + blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16.BLOCK_BREAK_ACK); - protocol.registerClientbound(ClientboundPackets1_16.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_16.LEVEL_CHUNK, wrapper -> { Chunk chunk = wrapper.read(ChunkType1_16.TYPE); wrapper.write(ChunkType1_16_2.TYPE, chunk); @@ -63,7 +63,7 @@ public class WorldPacketRewriter1_16_2 { } }); - protocol.registerClientbound(ClientboundPackets1_16.MULTI_BLOCK_CHANGE, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_16.CHUNK_BLOCKS_UPDATE, ClientboundPackets1_16_2.SECTION_BLOCKS_UPDATE, wrapper -> { wrapper.cancel(); int chunkX = wrapper.read(Type.INT); @@ -92,7 +92,7 @@ public class WorldPacketRewriter1_16_2 { List sectionRecord = sectionRecords[chunkY]; if (sectionRecord == null) continue; - PacketWrapper newPacket = wrapper.create(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE); + PacketWrapper newPacket = wrapper.create(ClientboundPackets1_16_2.SECTION_BLOCKS_UPDATE); newPacket.write(Type.LONG, chunkPosition | (chunkY & 0xFFFFFL)); newPacket.write(Type.BOOLEAN, false); // Ignore light updates newPacket.write(Type.VAR_LONG_BLOCK_CHANGE_RECORD_ARRAY, sectionRecord.toArray(EMPTY_RECORDS)); @@ -100,6 +100,6 @@ public class WorldPacketRewriter1_16_2 { } }); - blockRewriter.registerEffect(ClientboundPackets1_16.EFFECT, 1010, 2001); + blockRewriter.registerEffect(ClientboundPackets1_16.LEVEL_EVENT, 1010, 2001); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java index f15828dc2..afeb0192b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java @@ -62,7 +62,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_16_2.UPDATE_TAGS, wrapper -> { // Tags are now generically written with resource location - 5 different Vanilla types wrapper.write(Type.VAR_INT, 5); for (RegistryType type : RegistryType.getValues()) { @@ -87,11 +87,11 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol(this).register(ClientboundPackets1_16_2.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_16_2.AWARD_STATS); SoundRewriter soundRewriter = new SoundRewriter<>(this); soundRewriter.registerSound(ClientboundPackets1_16_2.SOUND); - soundRewriter.registerSound(ClientboundPackets1_16_2.ENTITY_SOUND); + soundRewriter.registerSound(ClientboundPackets1_16_2.SOUND_ENTITY); registerClientbound(ClientboundPackets1_16_2.RESOURCE_PACK, wrapper -> { wrapper.passthrough(Type.STRING); @@ -100,7 +100,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_16_2.MAP_ITEM_DATA, wrapper -> { wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.BYTE); wrapper.read(Type.BOOLEAN); // Tracking position removed @@ -116,15 +116,15 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_16_2.SET_TITLES, null, wrapper -> { // Title packet actions have been split into individual packets (the content hasn't changed) int type = wrapper.read(Type.VAR_INT); ClientboundPacketType packetType; switch (type) { - case 0 -> packetType = ClientboundPackets1_17.TITLE_TEXT; - case 1 -> packetType = ClientboundPackets1_17.TITLE_SUBTITLE; - case 2 -> packetType = ClientboundPackets1_17.ACTIONBAR; - case 3 -> packetType = ClientboundPackets1_17.TITLE_TIMES; + case 0 -> packetType = ClientboundPackets1_17.SET_TITLE_TEXT; + case 1 -> packetType = ClientboundPackets1_17.SET_SUBTITLE_TEXT; + case 2 -> packetType = ClientboundPackets1_17.SET_ACTION_BAR_TEXT; + case 3 -> packetType = ClientboundPackets1_17.SET_TITLES_ANIMATION; case 4 -> { packetType = ClientboundPackets1_17.CLEAR_TITLES; wrapper.write(Type.BOOLEAN, false); // Reset times @@ -139,7 +139,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol { + protocol.registerClientbound(ClientboundPackets1_16_2.REMOVE_ENTITIES, null, wrapper -> { int[] entityIds = wrapper.read(Type.VAR_INT_ARRAY_PRIMITIVE); wrapper.cancel(); @@ -63,7 +63,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_16_2.PLAYER_COMBAT, null, wrapper -> { // Combat packet actions have been split into individual packets (the content hasn't changed) int type = wrapper.read(Type.VAR_INT); ClientboundPacketType packetType = switch (type) { - case 0 -> ClientboundPackets1_17.COMBAT_ENTER; - case 1 -> ClientboundPackets1_17.COMBAT_END; - case 2 -> ClientboundPackets1_17.COMBAT_KILL; + case 0 -> ClientboundPackets1_17.PLAYER_COMBAT_ENTER; + case 1 -> ClientboundPackets1_17.PLAYER_COMBAT_END; + case 2 -> ClientboundPackets1_17.PLAYER_COMBAT_KILL; default -> throw new IllegalArgumentException("Invalid combat type received: " + type); }; @@ -130,7 +130,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter { + filter().type(EntityTypes1_17.ABSTRACT_MINECART).index(11).handler((event, meta) -> { // Convert to new block id int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/ItemPacketRewriter1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/ItemPacketRewriter1_17.java index 6f75360c0..49b8df4e9 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/ItemPacketRewriter1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/ItemPacketRewriter1_17.java @@ -42,20 +42,20 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter(protocol).register(ClientboundPackets1_16_2.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_16_2.UPDATE_RECIPES); - registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION); + registerCreativeInvAction(ServerboundPackets1_17.SET_CREATIVE_MODE_SLOT); protocol.registerServerbound(ServerboundPackets1_17.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); - protocol.registerServerbound(ServerboundPackets1_17.CLICK_WINDOW, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_17.CONTAINER_CLICK, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // Window Id @@ -90,7 +90,7 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_16_2.CONTAINER_ACK, null, wrapper -> { short inventoryId = wrapper.read(Type.UNSIGNED_BYTE); short confirmationId = wrapper.read(Type.SHORT); boolean accepted = wrapper.read(Type.BOOLEAN); @@ -115,7 +115,7 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter> 16) & 0xFF); short confirmationId = (short) (id & 0xFFFF); - PacketWrapper packet = wrapper.create(ServerboundPackets1_16_2.WINDOW_CONFIRMATION); + PacketWrapper packet = wrapper.create(ServerboundPackets1_16_2.CONTAINER_ACK); packet.write(Type.UNSIGNED_BYTE, inventoryId); packet.write(Type.SHORT, confirmationId); packet.write(Type.BOOLEAN, true); // Accept diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/WorldPacketRewriter1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/WorldPacketRewriter1_17.java index 473d6e1d4..eb513000a 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/WorldPacketRewriter1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/rewriter/WorldPacketRewriter1_17.java @@ -42,28 +42,28 @@ public final class WorldPacketRewriter1_17 { public static void register(Protocol1_16_4To1_17 protocol) { BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE); - blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16_2.ACKNOWLEDGE_PLAYER_DIGGING); + blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.SECTION_BLOCKS_UPDATE); + blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16_2.BLOCK_BREAK_ACK); - protocol.registerClientbound(ClientboundPackets1_16_2.WORLD_BORDER, null, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_16_2.SET_BORDER, null, wrapper -> { // Border packet actions have been split into individual packets (the content hasn't changed) int type = wrapper.read(Type.VAR_INT); ClientboundPacketType packetType = switch (type) { - case 0 -> ClientboundPackets1_17.WORLD_BORDER_SIZE; - case 1 -> ClientboundPackets1_17.WORLD_BORDER_LERP_SIZE; - case 2 -> ClientboundPackets1_17.WORLD_BORDER_CENTER; - case 3 -> ClientboundPackets1_17.WORLD_BORDER_INIT; - case 4 -> ClientboundPackets1_17.WORLD_BORDER_WARNING_DELAY; - case 5 -> ClientboundPackets1_17.WORLD_BORDER_WARNING_DISTANCE; + case 0 -> ClientboundPackets1_17.SET_BORDER_SIZE; + case 1 -> ClientboundPackets1_17.SET_BORDER_LERP_SIZE; + case 2 -> ClientboundPackets1_17.SET_BORDER_CENTER; + case 3 -> ClientboundPackets1_17.INITIALIZE_BORDER; + case 4 -> ClientboundPackets1_17.SET_BORDER_WARNING_DELAY; + case 5 -> ClientboundPackets1_17.SET_BORDER_WARNING_DISTANCE; default -> throw new IllegalArgumentException("Invalid world border type received: " + type); }; wrapper.setPacketType(packetType); }); - protocol.registerClientbound(ClientboundPackets1_16_2.UPDATE_LIGHT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_16_2.LIGHT_UPDATE, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // x @@ -107,7 +107,7 @@ public final class WorldPacketRewriter1_17 { } }); - protocol.registerClientbound(ClientboundPackets1_16_2.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_16_2.LEVEL_CHUNK, wrapper -> { Chunk chunk = wrapper.read(ChunkType1_16_2.TYPE); if (!chunk.isFullChunk()) { // All chunks are full chunk packets now (1.16 already stopped sending non-full chunks) @@ -139,7 +139,7 @@ public final class WorldPacketRewriter1_17 { } }); - blockRewriter.registerEffect(ClientboundPackets1_16_2.EFFECT, 1010, 2001); + blockRewriter.registerEffect(ClientboundPackets1_16_2.LEVEL_EVENT, 1010, 2001); } private static void writeMultiBlockChangePacket(PacketWrapper wrapper, Chunk chunk) { @@ -151,7 +151,7 @@ public final class WorldPacketRewriter1_17 { ChunkSection section = sections[chunkY]; if (section == null) continue; - PacketWrapper blockChangePacket = wrapper.create(ClientboundPackets1_17.MULTI_BLOCK_CHANGE); + PacketWrapper blockChangePacket = wrapper.create(ClientboundPackets1_17.SECTION_BLOCKS_UPDATE); blockChangePacket.write(Type.LONG, chunkPosition | (chunkY & 0xFFFFFL)); blockChangePacket.write(Type.BOOLEAN, true); // Suppress light updates diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java index d8da6f408..2233765b8 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java @@ -58,18 +58,18 @@ public final class Protocol1_17_1To1_18 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.registerSound(ClientboundPackets1_17_1.SOUND); - soundRewriter.registerSound(ClientboundPackets1_17_1.ENTITY_SOUND); + soundRewriter.registerSound(ClientboundPackets1_17_1.SOUND_ENTITY); - tagRewriter.registerGeneric(ClientboundPackets1_17_1.TAGS); + tagRewriter.registerGeneric(ClientboundPackets1_17_1.UPDATE_TAGS); tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:lava_pool_stone_cannot_replace", "minecraft:big_dripleaf_placeable", "minecraft:wolves_spawnable_on", "minecraft:rabbits_spawnable_on", "minecraft:polar_bears_spawnable_on_in_frozen_ocean", "minecraft:parrots_spawnable_on", "minecraft:mooshrooms_spawnable_on", "minecraft:goats_spawnable_on", "minecraft:foxes_spawnable_on", "minecraft:axolotls_spawnable_on", "minecraft:animals_spawnable_on", "minecraft:azalea_grows_on", "minecraft:azalea_root_replaceable", "minecraft:replaceable_plants", "minecraft:terracotta"); tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:dirt", "minecraft:terracotta"); - new StatisticsRewriter<>(this).register(ClientboundPackets1_17_1.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_17_1.AWARD_STATS); - registerServerbound(ServerboundPackets1_17.CLIENT_SETTINGS, new PacketHandlers() { + registerServerbound(ServerboundPackets1_17.CLIENT_INFORMATION, new PacketHandlers() { @Override public void register() { map(Type.STRING); // Language diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/packet/ClientboundPackets1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/packet/ClientboundPackets1_18.java index 7a4f58d76..b12669b13 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/packet/ClientboundPackets1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/packet/ClientboundPackets1_18.java @@ -21,110 +21,110 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_18 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_MOB, // 0x02 - SPAWN_PAINTING, // 0x03 - SPAWN_PLAYER, // 0x04 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_MOB, // 0x02 + ADD_PAINTING, // 0x03 + ADD_PLAYER, // 0x04 ADD_VIBRATION_SIGNAL, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 - BLOCK_BREAK_ANIMATION, // 0x09 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_BREAK_ACK, // 0x08 + BLOCK_DESTRUCTION, // 0x09 BLOCK_ENTITY_DATA, // 0x0A - BLOCK_ACTION, // 0x0B - BLOCK_CHANGE, // 0x0C - BOSSBAR, // 0x0D - SERVER_DIFFICULTY, // 0x0E - CHAT_MESSAGE, // 0x0F + BLOCK_EVENT, // 0x0B + BLOCK_UPDATE, // 0x0C + BOSS_EVENT, // 0x0D + CHANGE_DIFFICULTY, // 0x0E + CHAT, // 0x0F CLEAR_TITLES, // 0x10 - TAB_COMPLETE, // 0x11 - DECLARE_COMMANDS, // 0x12 - CLOSE_WINDOW, // 0x13 - WINDOW_ITEMS, // 0x14 - WINDOW_PROPERTY, // 0x15 - SET_SLOT, // 0x16 + COMMAND_SUGGESTIONS, // 0x11 + COMMANDS, // 0x12 + CONTAINER_CLOSE, // 0x13 + CONTAINER_SET_CONTENT, // 0x14 + CONTAINER_SET_DATA, // 0x15 + CONTAINER_SET_SLOT, // 0x16 COOLDOWN, // 0x17 - PLUGIN_MESSAGE, // 0x18 - NAMED_SOUND, // 0x19 + CUSTOM_PAYLOAD, // 0x18 + CUSTOM_SOUND, // 0x19 DISCONNECT, // 0x1A - ENTITY_STATUS, // 0x1B - EXPLOSION, // 0x1C - UNLOAD_CHUNK, // 0x1D + ENTITY_EVENT, // 0x1B + EXPLODE, // 0x1C + FORGET_LEVEL_CHUNK, // 0x1D GAME_EVENT, // 0x1E - OPEN_HORSE_WINDOW, // 0x1F - WORLD_BORDER_INIT, // 0x20 + HORSE_SCREEN_OPEN, // 0x1F + INITIALIZE_BORDER, // 0x20 KEEP_ALIVE, // 0x21 - CHUNK_DATA, // 0x22 - EFFECT, // 0x23 - SPAWN_PARTICLE, // 0x24 - UPDATE_LIGHT, // 0x25 - JOIN_GAME, // 0x26 - MAP_DATA, // 0x27 - TRADE_LIST, // 0x28 - ENTITY_POSITION, // 0x29 - ENTITY_POSITION_AND_ROTATION, // 0x2A - ENTITY_ROTATION, // 0x2B - VEHICLE_MOVE, // 0x2C + LEVEL_CHUNK_WITH_LIGHT, // 0x22 + LEVEL_EVENT, // 0x23 + LEVEL_PARTICLES, // 0x24 + LIGHT_UPDATE, // 0x25 + LOGIN, // 0x26 + MAP_ITEM_DATA, // 0x27 + MERCHANT_OFFERS, // 0x28 + MOVE_ENTITY_POS, // 0x29 + MOVE_ENTITY_POS_ROT, // 0x2A + MOVE_ENTITY_ROT, // 0x2B + MOVE_VEHICLE, // 0x2C OPEN_BOOK, // 0x2D - OPEN_WINDOW, // 0x2E + OPEN_SCREEN, // 0x2E OPEN_SIGN_EDITOR, // 0x2F PING, // 0x30 - CRAFT_RECIPE_RESPONSE, // 0x31 + PLACE_GHOST_RECIPE, // 0x31 PLAYER_ABILITIES, // 0x32 - COMBAT_END, // 0x33 - COMBAT_ENTER, // 0x34 - COMBAT_KILL, // 0x35 + PLAYER_COMBAT_END, // 0x33 + PLAYER_COMBAT_ENTER, // 0x34 + PLAYER_COMBAT_KILL, // 0x35 PLAYER_INFO, // 0x36 - FACE_PLAYER, // 0x37 + PLAYER_LOOK_AT, // 0x37 PLAYER_POSITION, // 0x38 - UNLOCK_RECIPES, // 0x39 + RECIPE, // 0x39 REMOVE_ENTITIES, // 0x3A - REMOVE_ENTITY_EFFECT, // 0x3B + REMOVE_MOB_EFFECT, // 0x3B RESOURCE_PACK, // 0x3C RESPAWN, // 0x3D - ENTITY_HEAD_LOOK, // 0x3E - MULTI_BLOCK_CHANGE, // 0x3F + ROTATE_HEAD, // 0x3E + SECTION_BLOCKS_UPDATE, // 0x3F SELECT_ADVANCEMENTS_TAB, // 0x40 - ACTIONBAR, // 0x41 - WORLD_BORDER_CENTER, // 0x42 - WORLD_BORDER_LERP_SIZE, // 0x43 - WORLD_BORDER_SIZE, // 0x44 - WORLD_BORDER_WARNING_DELAY, // 0x45 - WORLD_BORDER_WARNING_DISTANCE, // 0x46 - CAMERA, // 0x47 - HELD_ITEM_CHANGE, // 0x48 - UPDATE_VIEW_POSITION, // 0x49 - UPDATE_VIEW_DISTANCE, // 0x4A - SPAWN_POSITION, // 0x4B - DISPLAY_SCOREBOARD, // 0x4C - ENTITY_METADATA, // 0x4D - ATTACH_ENTITY, // 0x4E - ENTITY_VELOCITY, // 0x4F - ENTITY_EQUIPMENT, // 0x50 + SET_ACTION_BAR_TEXT, // 0x41 + SET_BORDER_CENTER, // 0x42 + SET_BORDER_LERP_SIZE, // 0x43 + SET_BORDER_SIZE, // 0x44 + SET_BORDER_WARNING_DELAY, // 0x45 + SET_BORDER_WARNING_DISTANCE, // 0x46 + SET_CAMERA, // 0x47 + SET_CARRIED_ITEM, // 0x48 + SET_CHUNK_CACHE_CENTER, // 0x49 + SET_CHUNK_CACHE_RADIUS, // 0x4A + SET_DEFAULT_SPAWN_POSITION, // 0x4B + SET_DISPLAY_OBJECTIVE, // 0x4C + SET_ENTITY_DATA, // 0x4D + SET_ENTITY_LINK, // 0x4E + SET_ENTITY_MOTION, // 0x4F + SET_EQUIPMENT, // 0x50 SET_EXPERIENCE, // 0x51 - UPDATE_HEALTH, // 0x52 - SCOREBOARD_OBJECTIVE, // 0x53 + SET_HEALTH, // 0x52 + SET_OBJECTIVE, // 0x53 SET_PASSENGERS, // 0x54 - TEAMS, // 0x55 - UPDATE_SCORE, // 0x56 + SET_PLAYER_TEAM, // 0x55 + SET_SCORE, // 0x56 SET_SIMULATION_DISTANCE, // 0x57 - TITLE_SUBTITLE, // 0x58 - TIME_UPDATE, // 0x59 - TITLE_TEXT, // 0x5A - TITLE_TIMES, // 0x5B - ENTITY_SOUND, // 0x5C + SET_SUBTITLE_TEXT, // 0x58 + SET_TIME, // 0x59 + SET_TITLE_TEXT, // 0x5A + SET_TITLES_ANIMATION, // 0x5B + SOUND_ENTITY, // 0x5C SOUND, // 0x5D STOP_SOUND, // 0x5E TAB_LIST, // 0x5F - NBT_QUERY, // 0x60 - COLLECT_ITEM, // 0x61 - ENTITY_TELEPORT, // 0x62 - ADVANCEMENTS, // 0x63 - ENTITY_PROPERTIES, // 0x64 - ENTITY_EFFECT, // 0x65 - DECLARE_RECIPES, // 0x66 - TAGS; // 0x67 + TAG_QUERY, // 0x60 + TAKE_ITEM_ENTITY, // 0x61 + TELEPORT_ENTITY, // 0x62 + UPDATE_ADVANCEMENTS, // 0x63 + UPDATE_ATTRIBUTES, // 0x64 + UPDATE_MOB_EFFECT, // 0x65 + UPDATE_RECIPES, // 0x66 + UPDATE_TAGS; // 0x67 @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/EntityPacketRewriter1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/EntityPacketRewriter1_18.java index 00c705bb0..2cb36cc54 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/EntityPacketRewriter1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/EntityPacketRewriter1_18.java @@ -38,9 +38,9 @@ public final class EntityPacketRewriter1_18 extends EntityRewriter(protocol).register(ClientboundPackets1_17_1.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_17_1.UPDATE_RECIPES); - registerClickWindow1_17_1(ServerboundPackets1_17.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION); + registerClickWindow1_17_1(ServerboundPackets1_17.CONTAINER_CLICK); + registerCreativeInvAction(ServerboundPackets1_17.SET_CREATIVE_MODE_SLOT); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/WorldPacketRewriter1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/WorldPacketRewriter1_18.java index aec6ce848..9dfc6953b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/WorldPacketRewriter1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/rewriter/WorldPacketRewriter1_18.java @@ -37,6 +37,7 @@ import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_18; import com.viaversion.viaversion.protocols.v1_17_1to1_18.Protocol1_17_1To1_18; import com.viaversion.viaversion.protocols.v1_17_1to1_18.data.BlockEntityIds; import com.viaversion.viaversion.protocols.v1_17_1to1_18.data.BlockEntities; +import com.viaversion.viaversion.protocols.v1_17_1to1_18.packet.ClientboundPackets1_18; import com.viaversion.viaversion.protocols.v1_17_1to1_18.storage.ChunkLightStorage; import com.viaversion.viaversion.protocols.v1_17to1_17_1.packet.ClientboundPackets1_17_1; import com.viaversion.viaversion.util.Key; @@ -62,7 +63,7 @@ public final class WorldPacketRewriter1_18 { } }); - protocol.registerClientbound(ClientboundPackets1_17_1.UPDATE_LIGHT, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_17_1.LIGHT_UPDATE, wrapper -> { final int chunkX = wrapper.passthrough(Type.VAR_INT); final int chunkZ = wrapper.passthrough(Type.VAR_INT); @@ -101,7 +102,7 @@ public final class WorldPacketRewriter1_18 { emptySkyLightMask, emptyBlockLightMask, skyLight, blockLight)); }); - protocol.registerClientbound(ClientboundPackets1_17_1.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_17_1.LEVEL_CHUNK, ClientboundPackets1_18.LEVEL_CHUNK_WITH_LIGHT, wrapper -> { final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user()); final Chunk oldChunk = wrapper.read(new ChunkType1_17(tracker.currentWorldSectionHeight())); @@ -194,7 +195,7 @@ public final class WorldPacketRewriter1_18 { } }); - protocol.registerClientbound(ClientboundPackets1_17_1.UNLOAD_CHUNK, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_17_1.FORGET_LEVEL_CHUNK, wrapper -> { final int chunkX = wrapper.passthrough(Type.INT); final int chunkZ = wrapper.passthrough(Type.INT); wrapper.user().get(ChunkLightStorage.class).clear(chunkX, chunkZ); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17to1_17_1/Protocol1_17To1_17_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17to1_17_1/Protocol1_17To1_17_1.java index 5b2908b85..c5e46bb80 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17to1_17_1/Protocol1_17To1_17_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17to1_17_1/Protocol1_17To1_17_1.java @@ -47,7 +47,7 @@ public final class Protocol1_17To1_17_1 extends AbstractProtocol(this).register(ClientboundPackets1_18.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_18.AWARD_STATS); final PacketHandler singleNullTextComponentMapper = wrapper -> wrapper.write(Type.COMPONENT, mapTextComponentIfNull(wrapper.read(Type.COMPONENT))); - registerClientbound(ClientboundPackets1_18.TITLE_TEXT, singleNullTextComponentMapper); - registerClientbound(ClientboundPackets1_18.TITLE_SUBTITLE, singleNullTextComponentMapper); - registerClientbound(ClientboundPackets1_18.ACTIONBAR, singleNullTextComponentMapper); - registerClientbound(ClientboundPackets1_18.SCOREBOARD_OBJECTIVE, wrapper -> { + registerClientbound(ClientboundPackets1_18.SET_TITLE_TEXT, singleNullTextComponentMapper); + registerClientbound(ClientboundPackets1_18.SET_SUBTITLE_TEXT, singleNullTextComponentMapper); + registerClientbound(ClientboundPackets1_18.SET_ACTION_BAR_TEXT, singleNullTextComponentMapper); + registerClientbound(ClientboundPackets1_18.SET_OBJECTIVE, wrapper -> { wrapper.passthrough(Type.STRING); // Objective Name byte action = wrapper.passthrough(Type.BYTE); // Mode if (action == 0 || action == 2) { wrapper.write(Type.COMPONENT, mapTextComponentIfNull(wrapper.read(Type.COMPONENT))); // Display Name } }); - registerClientbound(ClientboundPackets1_18.TEAMS, wrapper -> { + registerClientbound(ClientboundPackets1_18.SET_PLAYER_TEAM, wrapper -> { wrapper.passthrough(Type.STRING); // Team Name byte action = wrapper.passthrough(Type.BYTE); // Mode if (action == 0 || action == 2) { @@ -154,7 +154,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol commandRewriter = new CommandRewriter<>(this); - registerClientbound(ClientboundPackets1_18.DECLARE_COMMANDS, wrapper -> { + registerClientbound(ClientboundPackets1_18.COMMANDS, wrapper -> { final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { final byte flags = wrapper.passthrough(Type.BYTE); @@ -188,7 +188,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol metadata = new ArrayList<>(); metadata.add(new Metadata(8, Types1_19.META_TYPES.paintingVariantType, protocol.getMappingData().getPaintingMappings().getNewIdOrDefault(motive, 0))); @@ -126,7 +126,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter { + filter().type(EntityTypes1_19.ABSTRACT_MINECART).index(11).handler((event, meta) -> { // Convert to new block id final int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/ItemPacketRewriter1_19.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/ItemPacketRewriter1_19.java index 616676335..dfa1e4b00 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/ItemPacketRewriter1_19.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/ItemPacketRewriter1_19.java @@ -39,11 +39,11 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter(protocol).register(ClientboundPackets1_18.DECLARE_RECIPES); + new RecipeRewriter<>(protocol).register(ClientboundPackets1_18.UPDATE_RECIPES); } private PacketHandler sequenceHandler() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/WorldPacketRewriter1_19.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/WorldPacketRewriter1_19.java index 86bb55a3b..c1304f9e4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/WorldPacketRewriter1_19.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/rewriter/WorldPacketRewriter1_19.java @@ -35,14 +35,14 @@ public final class WorldPacketRewriter1_19 { public static void register(final Protocol1_18_2To1_19 protocol) { final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_18.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_18.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_18.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_18.EFFECT, 1010, 2001); + blockRewriter.registerBlockAction(ClientboundPackets1_18.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_18.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_18.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_18.LEVEL_EVENT, 1010, 2001); - protocol.cancelClientbound(ClientboundPackets1_18.ACKNOWLEDGE_PLAYER_DIGGING); + protocol.cancelClientbound(ClientboundPackets1_18.BLOCK_BREAK_ACK); - protocol.registerClientbound(ClientboundPackets1_18.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_18.LEVEL_CHUNK_WITH_LIGHT, wrapper -> { final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user()); Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set"); Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height not set"); @@ -59,7 +59,7 @@ public final class WorldPacketRewriter1_19 { } }); - protocol.registerServerbound(ServerboundPackets1_19.SET_BEACON_EFFECT, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_19.SET_BEACON, wrapper -> { // Primary effect if (wrapper.read(Type.BOOLEAN)) { wrapper.passthrough(Type.VAR_INT); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java index cfb37b012..f02f9ccde 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java @@ -40,9 +40,9 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol tagRewriter = new TagRewriter<>(this); tagRewriter.addEmptyTag(RegistryType.BLOCK, "minecraft:fall_damage_resetting"); - tagRewriter.registerGeneric(ClientboundPackets1_18.TAGS); + tagRewriter.registerGeneric(ClientboundPackets1_18.UPDATE_TAGS); - registerClientbound(ClientboundPackets1_18.ENTITY_EFFECT, new PacketHandlers() { + registerClientbound(ClientboundPackets1_18.UPDATE_MOB_EFFECT, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // Entity id @@ -50,7 +50,7 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_19_1.CUSTOM_SOUND, ClientboundPackets1_19_3.SOUND, wrapper -> { final String soundIdentifier = wrapper.read(Type.STRING); wrapper.write(Type.SOUND_EVENT, Holder.of(new SoundEvent(soundIdentifier, null))); }); - new StatisticsRewriter<>(this).register(ClientboundPackets1_19_1.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_19_1.AWARD_STATS); final CommandRewriter commandRewriter = new CommandRewriter<>(this) { @Override @@ -130,7 +130,7 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol { + filter().type(EntityTypes1_19_3.ABSTRACT_MINECART).index(11).handler((event, meta) -> { // Convert to new block id final int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/ItemPacketRewriter1_19_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/ItemPacketRewriter1_19_3.java index 050ebe327..f629eb8da 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/ItemPacketRewriter1_19_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/ItemPacketRewriter1_19_3.java @@ -40,26 +40,26 @@ public final class ItemPacketRewriter1_19_3 extends ItemRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_19_1.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_19_1.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_1.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_19_1.EFFECT, 1010, 2001); - blockRewriter.registerChunkData1_19(ClientboundPackets1_19_1.CHUNK_DATA, ChunkType1_18::new); + blockRewriter.registerBlockAction(ClientboundPackets1_19_1.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_19_1.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_1.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_19_1.LEVEL_EVENT, 1010, 2001); + blockRewriter.registerChunkData1_19(ClientboundPackets1_19_1.LEVEL_CHUNK_WITH_LIGHT, ChunkType1_18::new); blockRewriter.registerBlockEntityData(ClientboundPackets1_19_1.BLOCK_ENTITY_DATA); registerSetCooldown(ClientboundPackets1_19_1.COOLDOWN); - registerWindowItems1_17_1(ClientboundPackets1_19_1.WINDOW_ITEMS); - registerSetSlot1_17_1(ClientboundPackets1_19_1.SET_SLOT); - registerAdvancements(ClientboundPackets1_19_1.ADVANCEMENTS); - registerEntityEquipmentArray(ClientboundPackets1_19_1.ENTITY_EQUIPMENT); - registerClickWindow1_17_1(ServerboundPackets1_19_3.CLICK_WINDOW); - registerTradeList1_19(ClientboundPackets1_19_1.TRADE_LIST); - registerCreativeInvAction(ServerboundPackets1_19_3.CREATIVE_INVENTORY_ACTION); - registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19_1.WINDOW_PROPERTY); - registerSpawnParticle1_19(ClientboundPackets1_19_1.SPAWN_PARTICLE); + registerWindowItems1_17_1(ClientboundPackets1_19_1.CONTAINER_SET_CONTENT); + registerSetSlot1_17_1(ClientboundPackets1_19_1.CONTAINER_SET_SLOT); + registerAdvancements(ClientboundPackets1_19_1.UPDATE_ADVANCEMENTS); + registerEntityEquipmentArray(ClientboundPackets1_19_1.SET_EQUIPMENT); + registerClickWindow1_17_1(ServerboundPackets1_19_3.CONTAINER_CLICK); + registerTradeList1_19(ClientboundPackets1_19_1.MERCHANT_OFFERS); + registerCreativeInvAction(ServerboundPackets1_19_3.SET_CREATIVE_MODE_SLOT); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19_1.CONTAINER_SET_DATA); + registerSpawnParticle1_19(ClientboundPackets1_19_1.LEVEL_PARTICLES); final RecipeRewriter recipeRewriter = new RecipeRewriter<>(protocol); - protocol.registerClientbound(ClientboundPackets1_19_1.DECLARE_RECIPES, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_19_1.UPDATE_RECIPES, wrapper -> { final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { final String type = Key.stripMinecraftNamespace(wrapper.passthrough(Type.STRING)); @@ -127,7 +127,7 @@ public final class ItemPacketRewriter1_19_3 extends ItemRewriter(this).register(ClientboundPackets1_19_3.STATISTICS); + tagRewriter.registerGeneric(ClientboundPackets1_19_3.UPDATE_TAGS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_19_3.AWARD_STATS); final SoundRewriter soundRewriter = new SoundRewriter<>(this); - soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.SOUND_ENTITY); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.SOUND); new CommandRewriter<>(this) { @@ -74,7 +74,7 @@ public final class Protocol1_19_3To1_19_4 extends AbstractProtocol { JsonElement element = wrapper.read(Type.OPTIONAL_COMPONENT); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ClientboundPackets1_19_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ClientboundPackets1_19_4.java index a486695ef..634bcbbfc 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ClientboundPackets1_19_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ClientboundPackets1_19_4.java @@ -21,117 +21,117 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_19_4 implements ClientboundPacketType { - BUNDLE, // 0x00 - SPAWN_ENTITY, // 0x01 - SPAWN_EXPERIENCE_ORB, // 0x02 - SPAWN_PLAYER, // 0x03 - ENTITY_ANIMATION, // 0x04 - STATISTICS, // 0x05 + BUNDLE_DELIMITER, // 0x00 + ADD_ENTITY, // 0x01 + ADD_EXPERIENCE_ORB, // 0x02 + ADD_PLAYER, // 0x03 + ANIMATE, // 0x04 + AWARD_STATS, // 0x05 BLOCK_CHANGED_ACK, // 0x06 - BLOCK_BREAK_ANIMATION, // 0x07 + BLOCK_DESTRUCTION, // 0x07 BLOCK_ENTITY_DATA, // 0x08 - BLOCK_ACTION, // 0x09 - BLOCK_CHANGE, // 0x0A - BOSSBAR, // 0x0B - SERVER_DIFFICULTY, // 0x0C - CHUNK_BIOMES, // 0x0D + BLOCK_EVENT, // 0x09 + BLOCK_UPDATE, // 0x0A + BOSS_EVENT, // 0x0B + CHANGE_DIFFICULTY, // 0x0C + CHUNKS_BIOMES, // 0x0D CLEAR_TITLES, // 0x0E - TAB_COMPLETE, // 0x0F - DECLARE_COMMANDS, // 0x10 - CLOSE_WINDOW, // 0x11 - WINDOW_ITEMS, // 0x12 - WINDOW_PROPERTY, // 0x13 - SET_SLOT, // 0x14 + COMMAND_SUGGESTIONS, // 0x0F + COMMANDS, // 0x10 + CONTAINER_CLOSE, // 0x11 + CONTAINER_SET_CONTENT, // 0x12 + CONTAINER_SET_DATA, // 0x13 + CONTAINER_SET_SLOT, // 0x14 COOLDOWN, // 0x15 CUSTOM_CHAT_COMPLETIONS, // 0x16 - PLUGIN_MESSAGE, // 0x17 + CUSTOM_PAYLOAD, // 0x17 DAMAGE_EVENT, // 0x18 - DELETE_CHAT_MESSAGE, // 0x19 + DELETE_CHAT, // 0x19 DISCONNECT, // 0x1A DISGUISED_CHAT, // 0x1B - ENTITY_STATUS, // 0x1C - EXPLOSION, // 0x1D - UNLOAD_CHUNK, // 0x1E + ENTITY_EVENT, // 0x1C + EXPLODE, // 0x1D + FORGET_LEVEL_CHUNK, // 0x1E GAME_EVENT, // 0x1F - OPEN_HORSE_WINDOW, // 0x20 - HIT_ANIMATION, // 0x21 - WORLD_BORDER_INIT, // 0x22 + HORSE_SCREEN_OPEN, // 0x20 + HURT_ANIMATION, // 0x21 + INITIALIZE_BORDER, // 0x22 KEEP_ALIVE, // 0x23 - CHUNK_DATA, // 0x24 - EFFECT, // 0x25 - SPAWN_PARTICLE, // 0x26 - UPDATE_LIGHT, // 0x27 - JOIN_GAME, // 0x28 - MAP_DATA, // 0x29 - TRADE_LIST, // 0x2A - ENTITY_POSITION, // 0x2B - ENTITY_POSITION_AND_ROTATION, // 0x2C - ENTITY_ROTATION, // 0x2D - VEHICLE_MOVE, // 0x2E + LEVEL_CHUNK_WITH_LIGHT, // 0x24 + LEVEL_EVENT, // 0x25 + LEVEL_PARTICLES, // 0x26 + LIGHT_UPDATE, // 0x27 + LOGIN, // 0x28 + MAP_ITEM_DATA, // 0x29 + MERCHANT_OFFERS, // 0x2A + MOVE_ENTITY_POS, // 0x2B + MOVE_ENTITY_POS_ROT, // 0x2C + MOVE_ENTITY_ROT, // 0x2D + MOVE_VEHICLE, // 0x2E OPEN_BOOK, // 0x2F - OPEN_WINDOW, // 0x30 + OPEN_SCREEN, // 0x30 OPEN_SIGN_EDITOR, // 0x31 PING, // 0x32 - CRAFT_RECIPE_RESPONSE, // 0x33 + PLACE_GHOST_RECIPE, // 0x33 PLAYER_ABILITIES, // 0x34 PLAYER_CHAT, // 0x35 - COMBAT_END, // 0x36 - COMBAT_ENTER, // 0x37 - COMBAT_KILL, // 0x38 + PLAYER_COMBAT_END, // 0x36 + PLAYER_COMBAT_ENTER, // 0x37 + PLAYER_COMBAT_KILL, // 0x38 PLAYER_INFO_REMOVE, // 0x39 PLAYER_INFO_UPDATE, // 0x3A - FACE_PLAYER, // 0x3B + PLAYER_LOOK_AT, // 0x3B PLAYER_POSITION, // 0x3C - UNLOCK_RECIPES, // 0x3D + RECIPE, // 0x3D REMOVE_ENTITIES, // 0x3E - REMOVE_ENTITY_EFFECT, // 0x3F + REMOVE_MOB_EFFECT, // 0x3F RESOURCE_PACK, // 0x40 RESPAWN, // 0x41 - ENTITY_HEAD_LOOK, // 0x42 - MULTI_BLOCK_CHANGE, // 0x43 + ROTATE_HEAD, // 0x42 + SECTION_BLOCKS_UPDATE, // 0x43 SELECT_ADVANCEMENTS_TAB, // 0x44 SERVER_DATA, // 0x45 - ACTIONBAR, // 0x46 - WORLD_BORDER_CENTER, // 0x47 - WORLD_BORDER_LERP_SIZE, // 0x48 - WORLD_BORDER_SIZE, // 0x49 - WORLD_BORDER_WARNING_DELAY, // 0x4A - WORLD_BORDER_WARNING_DISTANCE, // 0x4B - CAMERA, // 0x4C - HELD_ITEM_CHANGE, // 0x4D - UPDATE_VIEW_POSITION, // 0x4E - UPDATE_VIEW_DISTANCE, // 0x4F - SPAWN_POSITION, // 0x50 - DISPLAY_SCOREBOARD, // 0x51 - ENTITY_METADATA, // 0x52 - ATTACH_ENTITY, // 0x53 - ENTITY_VELOCITY, // 0x54 - ENTITY_EQUIPMENT, // 0x55 + SET_ACTION_BAR_TEXT, // 0x46 + SET_BORDER_CENTER, // 0x47 + SET_BORDER_LERP_SIZE, // 0x48 + SET_BORDER_SIZE, // 0x49 + SET_BORDER_WARNING_DELAY, // 0x4A + SET_BORDER_WARNING_DISTANCE, // 0x4B + SET_CAMERA, // 0x4C + SET_CARRIED_ITEM, // 0x4D + SET_CHUNK_CACHE_CENTER, // 0x4E + SET_CHUNK_CACHE_RADIUS, // 0x4F + SET_DEFAULT_SPAWN_POSITION, // 0x50 + SET_DISPLAY_OBJECTIVE, // 0x51 + SET_ENTITY_DATA, // 0x52 + SET_ENTITY_LINK, // 0x53 + SET_ENTITY_MOTION, // 0x54 + SET_EQUIPMENT, // 0x55 SET_EXPERIENCE, // 0x56 - UPDATE_HEALTH, // 0x57 - SCOREBOARD_OBJECTIVE, // 0x58 + SET_HEALTH, // 0x57 + SET_OBJECTIVE, // 0x58 SET_PASSENGERS, // 0x59 - TEAMS, // 0x5A - UPDATE_SCORE, // 0x5B + SET_PLAYER_TEAM, // 0x5A + SET_SCORE, // 0x5B SET_SIMULATION_DISTANCE, // 0x5C - TITLE_SUBTITLE, // 0x5D - TIME_UPDATE, // 0x5E - TITLE_TEXT, // 0x5F - TITLE_TIMES, // 0x60 - ENTITY_SOUND, // 0x61 + SET_SUBTITLE_TEXT, // 0x5D + SET_TIME, // 0x5E + SET_TITLE_TEXT, // 0x5F + SET_TITLES_ANIMATION, // 0x60 + SOUND_ENTITY, // 0x61 SOUND, // 0x62 STOP_SOUND, // 0x63 SYSTEM_CHAT, // 0x64 TAB_LIST, // 0x65 - NBT_QUERY, // 0x66 - COLLECT_ITEM, // 0x67 - ENTITY_TELEPORT, // 0x68 - ADVANCEMENTS, // 0x69 - ENTITY_PROPERTIES, // 0x6A + TAG_QUERY, // 0x66 + TAKE_ITEM_ENTITY, // 0x67 + TELEPORT_ENTITY, // 0x68 + UPDATE_ADVANCEMENTS, // 0x69 + UPDATE_ATTRIBUTES, // 0x6A UPDATE_ENABLED_FEATURES, // 0x6B - ENTITY_EFFECT, // 0x6C - DECLARE_RECIPES, // 0x6D - TAGS; // 0x6E + UPDATE_MOB_EFFECT, // 0x6C + UPDATE_RECIPES, // 0x6D + UPDATE_TAGS; // 0x6E @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ServerboundPackets1_19_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ServerboundPackets1_19_4.java index 6d10c716e..5ea6d33b8 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ServerboundPackets1_19_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/packet/ServerboundPackets1_19_4.java @@ -21,56 +21,56 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_19_4 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - SET_DIFFICULTY, // 0x02 + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHANGE_DIFFICULTY, // 0x02 CHAT_ACK, // 0x03 CHAT_COMMAND, // 0x04 - CHAT_MESSAGE, // 0x05 + CHAT, // 0x05 CHAT_SESSION_UPDATE, // 0x06 - CLIENT_STATUS, // 0x07 - CLIENT_SETTINGS, // 0x08 - TAB_COMPLETE, // 0x09 - CLICK_WINDOW_BUTTON, // 0x0A - CLICK_WINDOW, // 0x0B - CLOSE_WINDOW, // 0x0C - PLUGIN_MESSAGE, // 0x0D + CLIENT_COMMAND, // 0x07 + CLIENT_INFORMATION, // 0x08 + COMMAND_SUGGESTION, // 0x09 + CONTAINER_BUTTON_CLICK, // 0x0A + CONTAINER_CLICK, // 0x0B + CONTAINER_CLOSE, // 0x0C + CUSTOM_PAYLOAD, // 0x0D EDIT_BOOK, // 0x0E - ENTITY_NBT_REQUEST, // 0x0F - INTERACT_ENTITY, // 0x10 - GENERATE_JIGSAW, // 0x11 + ENTITY_TAG_QUERY, // 0x0F + INTERACT, // 0x10 + JIGSAW_GENERATE, // 0x11 KEEP_ALIVE, // 0x12 LOCK_DIFFICULTY, // 0x13 - PLAYER_POSITION, // 0x14 - PLAYER_POSITION_AND_ROTATION, // 0x15 - PLAYER_ROTATION, // 0x16 - PLAYER_MOVEMENT, // 0x17 - VEHICLE_MOVE, // 0x18 - STEER_BOAT, // 0x19 + MOVE_PLAYER_POS, // 0x14 + MOVE_PLAYER_POS_ROT, // 0x15 + MOVE_PLAYER_ROT, // 0x16 + MOVE_PLAYER_STATUS_ONLY, // 0x17 + MOVE_VEHICLE, // 0x18 + PADDLE_BOAT, // 0x19 PICK_ITEM, // 0x1A - CRAFT_RECIPE_REQUEST, // 0x1B + PLACE_RECIPE, // 0x1B PLAYER_ABILITIES, // 0x1C - PLAYER_DIGGING, // 0x1D - ENTITY_ACTION, // 0x1E - STEER_VEHICLE, // 0x1F + PLAYER_ACTION, // 0x1D + PLAYER_COMMAND, // 0x1E + PLAYER_INPUT, // 0x1F PONG, // 0x20 - RECIPE_BOOK_DATA, // 0x21 - SEEN_RECIPE, // 0x22 + RECIPE_BOOK_CHANGE_SETTINGS, // 0x21 + RECIPE_BOOK_SEEN_RECIPE, // 0x22 RENAME_ITEM, // 0x23 - RESOURCE_PACK_STATUS, // 0x24 - ADVANCEMENT_TAB, // 0x25 + RESOURCE_PACK, // 0x24 + SEEN_ADVANCEMENTS, // 0x25 SELECT_TRADE, // 0x26 - SET_BEACON_EFFECT, // 0x27 - HELD_ITEM_CHANGE, // 0x28 - UPDATE_COMMAND_BLOCK, // 0x29 - UPDATE_COMMAND_BLOCK_MINECART, // 0x2A - CREATIVE_INVENTORY_ACTION, // 0x2B - UPDATE_JIGSAW_BLOCK, // 0x2C - UPDATE_STRUCTURE_BLOCK, // 0x2D - UPDATE_SIGN, // 0x2E - ANIMATION, // 0x2F - SPECTATE, // 0x30 - PLAYER_BLOCK_PLACEMENT, // 0x31 + SET_BEACON, // 0x27 + SET_CARRIED_ITEM, // 0x28 + SET_COMMAND_BLOCK, // 0x29 + SET_COMMAND_MINECART, // 0x2A + SET_CREATIVE_MODE_SLOT, // 0x2B + SET_JIGSAW_BLOCK, // 0x2C + SET_STRUCTURE_BLOCK, // 0x2D + SIGN_UPDATE, // 0x2E + SWING, // 0x2F + TELEPORT_TO_ENTITY, // 0x30 + USE_ITEM_ON, // 0x31 USE_ITEM; // 0x32 @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/EntityPacketRewriter1_19_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/EntityPacketRewriter1_19_4.java index 7acd22bce..9f8d7eea4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/EntityPacketRewriter1_19_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/EntityPacketRewriter1_19_4.java @@ -43,7 +43,7 @@ public final class EntityPacketRewriter1_19_4 extends EntityRewriter { @@ -155,7 +155,7 @@ public final class EntityPacketRewriter1_19_4 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_19_3.ENTITY_EVENT, wrapper -> { final int entityId = wrapper.read(Type.INT); final byte event = wrapper.read(Type.BYTE); @@ -201,9 +201,9 @@ public final class EntityPacketRewriter1_19_4 extends EntityRewriter Types1_19_4.META_TYPES.byId(typeId >= 14 ? typeId + 1 : typeId)); // Optional block state (and map block state=14 to optional block state) registerMetaTypeHandler(Types1_19_4.META_TYPES.itemType, Types1_19_4.META_TYPES.blockStateType, Types1_19_4.META_TYPES.optionalBlockStateType, Types1_19_4.META_TYPES.particleType, null); - filter().type(EntityTypes1_19_4.MINECART_ABSTRACT).index(11).handler((event, meta) -> { + filter().type(EntityTypes1_19_4.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/ItemPacketRewriter1_19_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/ItemPacketRewriter1_19_4.java index 8e22b985c..f4c905dac 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/ItemPacketRewriter1_19_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_3to1_19_4/rewriter/ItemPacketRewriter1_19_4.java @@ -37,13 +37,13 @@ public final class ItemPacketRewriter1_19_4 extends ItemRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_19_3.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_19_3.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_3.MULTI_BLOCK_CHANGE); - blockRewriter.registerChunkData1_19(ClientboundPackets1_19_3.CHUNK_DATA, ChunkType1_18::new); + blockRewriter.registerBlockAction(ClientboundPackets1_19_3.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_19_3.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_3.SECTION_BLOCKS_UPDATE); + blockRewriter.registerChunkData1_19(ClientboundPackets1_19_3.LEVEL_CHUNK_WITH_LIGHT, ChunkType1_18::new); blockRewriter.registerBlockEntityData(ClientboundPackets1_19_3.BLOCK_ENTITY_DATA); - protocol.registerClientbound(ClientboundPackets1_19_3.EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_19_3.LEVEL_EVENT, new PacketHandlers() { @Override public void register() { map(Type.INT); // Effect Id @@ -68,7 +68,7 @@ public final class ItemPacketRewriter1_19_4 extends ItemRewriter(protocol) { @Override @@ -100,6 +100,6 @@ public final class ItemPacketRewriter1_19_4 extends ItemRewriter soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND_ENTITY); - new StatisticsRewriter<>(this).register(ClientboundPackets1_19_4.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_19_4.AWARD_STATS); - registerClientbound(ClientboundPackets1_19_4.COMBAT_END, wrapper -> { + registerClientbound(ClientboundPackets1_19_4.PLAYER_COMBAT_END, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Duration wrapper.read(Type.INT); // Killer ID }); - registerClientbound(ClientboundPackets1_19_4.COMBAT_KILL, wrapper -> { + registerClientbound(ClientboundPackets1_19_4.PLAYER_COMBAT_KILL, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Duration wrapper.read(Type.INT); // Killer ID }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/EntityPacketRewriter1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/EntityPacketRewriter1_20.java index 7547e4ca0..6bb31f156 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/EntityPacketRewriter1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/EntityPacketRewriter1_20.java @@ -45,11 +45,11 @@ public final class EntityPacketRewriter1_20 extends EntityRewriter { + filter().type(EntityTypes1_19_4.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/ItemPacketRewriter1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/ItemPacketRewriter1_20.java index 888d015b2..666e6042e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/ItemPacketRewriter1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/rewriter/ItemPacketRewriter1_20.java @@ -45,23 +45,23 @@ public final class ItemPacketRewriter1_20 extends ItemRewriter blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_19_4.EFFECT, 1010, 2001); + blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_19_4.LEVEL_EVENT, 1010, 2001); blockRewriter.registerBlockEntityData(ClientboundPackets1_19_4.BLOCK_ENTITY_DATA, this::handleBlockEntity); - registerOpenWindow(ClientboundPackets1_19_4.OPEN_WINDOW); + registerOpenWindow(ClientboundPackets1_19_4.OPEN_SCREEN); registerSetCooldown(ClientboundPackets1_19_4.COOLDOWN); - registerWindowItems1_17_1(ClientboundPackets1_19_4.WINDOW_ITEMS); - registerSetSlot1_17_1(ClientboundPackets1_19_4.SET_SLOT); - registerEntityEquipmentArray(ClientboundPackets1_19_4.ENTITY_EQUIPMENT); - registerClickWindow1_17_1(ServerboundPackets1_19_4.CLICK_WINDOW); - registerTradeList1_19(ClientboundPackets1_19_4.TRADE_LIST); - registerCreativeInvAction(ServerboundPackets1_19_4.CREATIVE_INVENTORY_ACTION); - registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19_4.WINDOW_PROPERTY); - registerSpawnParticle1_19(ClientboundPackets1_19_4.SPAWN_PARTICLE); + registerWindowItems1_17_1(ClientboundPackets1_19_4.CONTAINER_SET_CONTENT); + registerSetSlot1_17_1(ClientboundPackets1_19_4.CONTAINER_SET_SLOT); + registerEntityEquipmentArray(ClientboundPackets1_19_4.SET_EQUIPMENT); + registerClickWindow1_17_1(ServerboundPackets1_19_4.CONTAINER_CLICK); + registerTradeList1_19(ClientboundPackets1_19_4.MERCHANT_OFFERS); + registerCreativeInvAction(ServerboundPackets1_19_4.SET_CREATIVE_MODE_SLOT); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19_4.CONTAINER_SET_DATA); + registerSpawnParticle1_19(ClientboundPackets1_19_4.LEVEL_PARTICLES); - protocol.registerClientbound(ClientboundPackets1_19_4.ADVANCEMENTS, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_19_4.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear int size = wrapper.passthrough(Type.VAR_INT); // Mapping size for (int i = 0; i < size; i++) { @@ -97,7 +97,7 @@ public final class ItemPacketRewriter1_20 extends ItemRewriter { + protocol.registerServerbound(ServerboundPackets1_19_4.SIGN_UPDATE, wrapper -> { wrapper.passthrough(Type.POSITION1_14); final boolean frontText = wrapper.read(Type.BOOLEAN); if (!frontText) { @@ -105,7 +105,7 @@ public final class ItemPacketRewriter1_20 extends ItemRewriter handleBlockEntity(blockEntity))); @@ -113,13 +113,13 @@ public final class ItemPacketRewriter1_20 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.LIGHT_UPDATE, wrapper -> { wrapper.passthrough(Type.VAR_INT); // X wrapper.passthrough(Type.VAR_INT); // Y wrapper.read(Type.BOOLEAN); // Trust edges }); - protocol.registerClientbound(ClientboundPackets1_19_4.MULTI_BLOCK_CHANGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_19_4.SECTION_BLOCKS_UPDATE, new PacketHandlers() { @Override public void register() { map(Type.LONG); // Chunk position @@ -133,7 +133,7 @@ public final class ItemPacketRewriter1_20 extends ItemRewriter recipeRewriter = new RecipeRewriter1_19_4<>(protocol); - protocol.registerClientbound(ClientboundPackets1_19_4.DECLARE_RECIPES, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_19_4.UPDATE_RECIPES, wrapper -> { final int size = wrapper.passthrough(Type.VAR_INT); int newSize = size; for (int i = 0; i < size; i++) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19to1_19_1/Protocol1_19To1_19_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19to1_19_1/Protocol1_19To1_19_1.java index ac97dee81..dc2b8b881 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19to1_19_1/Protocol1_19To1_19_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19to1_19_1/Protocol1_19To1_19_1.java @@ -106,7 +106,7 @@ public final class Protocol1_19To1_19_1 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND_ENTITY); - new StatisticsRewriter<>(this).register(ClientboundPackets1_20_2.STATISTICS); - new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_2.DECLARE_COMMANDS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_20_2.AWARD_STATS); + new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_2.COMMANDS); - registerClientbound(ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> { + registerClientbound(ClientboundPackets1_20_2.SET_SCORE, wrapper -> { wrapper.passthrough(Type.STRING); // Owner final int action = wrapper.read(Type.VAR_INT); @@ -101,7 +101,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.SET_OBJECTIVE, wrapper -> { wrapper.passthrough(Type.STRING); // Objective Name final byte action = wrapper.passthrough(Type.BYTE); // Method if (action == 0 || action == 2) { @@ -111,7 +111,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerServerbound(ServerboundPackets1_20_3.SET_JIGSAW_BLOCK, wrapper -> { wrapper.passthrough(Type.POSITION1_14); // Position wrapper.passthrough(Type.STRING); // Name wrapper.passthrough(Type.STRING); // Target @@ -123,7 +123,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size for (int i = 0; i < size; i++) { @@ -152,7 +152,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.COMMAND_SUGGESTIONS, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Transaction id wrapper.passthrough(Type.VAR_INT); // Start wrapper.passthrough(Type.VAR_INT); // Length @@ -163,7 +163,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.MAP_ITEM_DATA, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Map id wrapper.passthrough(Type.BYTE); // Scale wrapper.passthrough(Type.BOOLEAN); // Locked @@ -178,7 +178,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.BOSS_EVENT, wrapper -> { wrapper.passthrough(Type.UUID); // Id final int action = wrapper.passthrough(Type.VAR_INT); @@ -213,7 +213,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.SET_PLAYER_TEAM, wrapper -> { wrapper.passthrough(Type.STRING); // Team Name final byte action = wrapper.passthrough(Type.BYTE); // Mode if (action == 0 || action == 2) { @@ -231,9 +231,9 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { convertComponent(wrapper); wrapper.passthrough(Type.VAR_INT); // Chat type @@ -241,7 +241,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_20_2.OPEN_SCREEN, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Container id final int containerTypeId = wrapper.read(Type.VAR_INT); @@ -254,7 +254,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol blockRewriter = BlockRewriter.for1_20_2(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_20_2.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_20_2.EFFECT, 1010, 2001); - blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.CHUNK_DATA, ChunkType1_20_2::new); + blockRewriter.registerBlockAction(ClientboundPackets1_20_2.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_20_2.LEVEL_EVENT, 1010, 2001); + blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.LEVEL_CHUNK_WITH_LIGHT, ChunkType1_20_2::new); blockRewriter.registerBlockEntityData(ClientboundPackets1_20_2.BLOCK_ENTITY_DATA); registerSetCooldown(ClientboundPackets1_20_2.COOLDOWN); - registerWindowItems1_17_1(ClientboundPackets1_20_2.WINDOW_ITEMS); - registerSetSlot1_17_1(ClientboundPackets1_20_2.SET_SLOT); - registerEntityEquipmentArray(ClientboundPackets1_20_2.ENTITY_EQUIPMENT); - registerClickWindow1_17_1(ServerboundPackets1_20_3.CLICK_WINDOW); - registerTradeList1_19(ClientboundPackets1_20_2.TRADE_LIST); - registerCreativeInvAction(ServerboundPackets1_20_3.CREATIVE_INVENTORY_ACTION); - registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_2.WINDOW_PROPERTY); + registerWindowItems1_17_1(ClientboundPackets1_20_2.CONTAINER_SET_CONTENT); + registerSetSlot1_17_1(ClientboundPackets1_20_2.CONTAINER_SET_SLOT); + registerEntityEquipmentArray(ClientboundPackets1_20_2.SET_EQUIPMENT); + registerClickWindow1_17_1(ServerboundPackets1_20_3.CONTAINER_CLICK); + registerTradeList1_19(ClientboundPackets1_20_2.MERCHANT_OFFERS); + registerCreativeInvAction(ServerboundPackets1_20_3.SET_CREATIVE_MODE_SLOT); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_2.CONTAINER_SET_DATA); - protocol.registerClientbound(ClientboundPackets1_20_2.SPAWN_PARTICLE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_20_2.LEVEL_PARTICLES, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Particle ID @@ -114,9 +114,9 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_20_2.EXPLODE, wrapper -> { wrapper.passthrough(Type.DOUBLE); // X wrapper.passthrough(Type.DOUBLE); // Y wrapper.passthrough(Type.DOUBLE); // Z diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java index 6f5f22de3..3c1aee2d3 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java @@ -44,8 +44,8 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter { + filter().type(EntityTypes1_20_3.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/Protocol1_20_3To1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/Protocol1_20_3To1_20_5.java index bd58dc432..9e51582df 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/Protocol1_20_3To1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/Protocol1_20_3To1_20_5.java @@ -78,18 +78,18 @@ public final class Protocol1_20_3To1_20_5 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.SOUND_ENTITY); - new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.STATISTICS); + new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.AWARD_STATS); componentRewriter.registerComponentPacket(ClientboundPackets1_20_3.SYSTEM_CHAT); componentRewriter.registerComponentPacket(ClientboundPackets1_20_3.DISGUISED_CHAT); - componentRewriter.registerCombatKill1_20(ClientboundPackets1_20_3.COMBAT_KILL); + componentRewriter.registerCombatKill1_20(ClientboundPackets1_20_3.PLAYER_COMBAT_KILL); registerClientbound(State.LOGIN, ClientboundLoginPackets.HELLO, wrapper -> { wrapper.passthrough(Type.STRING); // Server ID @@ -132,7 +132,7 @@ public final class Protocol1_20_3To1_20_5 extends AbstractProtocol { + registerServerbound(ServerboundPackets1_20_5.CHAT, wrapper -> { wrapper.passthrough(Type.STRING); // Message wrapper.passthrough(Type.LONG); // Timestamp @@ -206,7 +206,7 @@ public final class Protocol1_20_3To1_20_5 extends AbstractProtocol wrapper.user().put(new AcknowledgedMessagesStorage())); - new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_3.DECLARE_COMMANDS); + new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_3.COMMANDS); registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE, wrapper -> { wrapper.passthrough(Type.UUID); // UUID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ClientboundPackets1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ClientboundPackets1_20_5.java index df5618f97..d0ce36bbb 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ClientboundPackets1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ClientboundPackets1_20_5.java @@ -19,127 +19,127 @@ package com.viaversion.viaversion.protocols.v1_20_3to1_20_5.packet; public enum ClientboundPackets1_20_5 implements ClientboundPacket1_20_5 { - BUNDLE, // 0x00 - SPAWN_ENTITY, // 0x01 - SPAWN_EXPERIENCE_ORB, // 0x02 - ENTITY_ANIMATION, // 0x03 - STATISTICS, // 0x04 + BUNDLE_DELIMITER, // 0x00 + ADD_ENTITY, // 0x01 + ADD_EXPERIENCE_ORB, // 0x02 + ANIMATE, // 0x03 + AWARD_STATS, // 0x04 BLOCK_CHANGED_ACK, // 0x05 - BLOCK_BREAK_ANIMATION, // 0x06 + BLOCK_DESTRUCTION, // 0x06 BLOCK_ENTITY_DATA, // 0x07 - BLOCK_ACTION, // 0x08 - BLOCK_CHANGE, // 0x09 - BOSSBAR, // 0x0A - SERVER_DIFFICULTY, // 0x0B + BLOCK_EVENT, // 0x08 + BLOCK_UPDATE, // 0x09 + BOSS_EVENT, // 0x0A + CHANGE_DIFFICULTY, // 0x0B CHUNK_BATCH_FINISHED, // 0x0C CHUNK_BATCH_START, // 0x0D - CHUNK_BIOMES, // 0x0E + CHUNKS_BIOMES, // 0x0E CLEAR_TITLES, // 0x0F - TAB_COMPLETE, // 0x10 - DECLARE_COMMANDS, // 0x11 - CLOSE_WINDOW, // 0x12 - WINDOW_ITEMS, // 0x13 - WINDOW_PROPERTY, // 0x14 - SET_SLOT, // 0x15 + COMMAND_SUGGESTIONS, // 0x10 + COMMANDS, // 0x11 + CONTAINER_CLOSE, // 0x12 + CONTAINER_SET_CONTENT, // 0x13 + CONTAINER_SET_DATA, // 0x14 + CONTAINER_SET_SLOT, // 0x15 COOKIE_REQUEST, // 0x16 COOLDOWN, // 0x17 CUSTOM_CHAT_COMPLETIONS, // 0x18 - PLUGIN_MESSAGE, // 0x19 + CUSTOM_PAYLOAD, // 0x19 DAMAGE_EVENT, // 0x1A DEBUG_SAMPLE, // 0x1B - DELETE_CHAT_MESSAGE, // 0x1C + DELETE_CHAT, // 0x1C DISCONNECT, // 0x1D DISGUISED_CHAT, // 0x1E - ENTITY_STATUS, // 0x1F - EXPLOSION, // 0x20 - UNLOAD_CHUNK, // 0x21 + ENTITY_EVENT, // 0x1F + EXPLODE, // 0x20 + FORGET_LEVEL_CHUNK, // 0x21 GAME_EVENT, // 0x22 - OPEN_HORSE_WINDOW, // 0x23 - HIT_ANIMATION, // 0x24 - WORLD_BORDER_INIT, // 0x25 + HORSE_SCREEN_OPEN, // 0x23 + HURT_ANIMATION, // 0x24 + INITIALIZE_BORDER, // 0x25 KEEP_ALIVE, // 0x26 - CHUNK_DATA, // 0x27 - EFFECT, // 0x28 - SPAWN_PARTICLE, // 0x29 - UPDATE_LIGHT, // 0x2A - JOIN_GAME, // 0x2B - MAP_DATA, // 0x2C - TRADE_LIST, // 0x2D - ENTITY_POSITION, // 0x2E - ENTITY_POSITION_AND_ROTATION, // 0x2F - ENTITY_ROTATION, // 0x30 - VEHICLE_MOVE, // 0x31 + LEVEL_CHUNK_WITH_LIGHT, // 0x27 + LEVEL_EVENT, // 0x28 + LEVEL_PARTICLES, // 0x29 + LIGHT_UPDATE, // 0x2A + LOGIN, // 0x2B + MAP_ITEM_DATA, // 0x2C + MERCHANT_OFFERS, // 0x2D + MOVE_ENTITY_POS, // 0x2E + MOVE_ENTITY_POS_ROT, // 0x2F + MOVE_ENTITY_ROT, // 0x30 + MOVE_VEHICLE, // 0x31 OPEN_BOOK, // 0x32 - OPEN_WINDOW, // 0x33 + OPEN_SCREEN, // 0x33 OPEN_SIGN_EDITOR, // 0x34 PING, // 0x35 PONG_RESPONSE, // 0x36 - CRAFT_RECIPE_RESPONSE, // 0x37 + PLACE_GHOST_RECIPE, // 0x37 PLAYER_ABILITIES, // 0x38 PLAYER_CHAT, // 0x39 - COMBAT_END, // 0x3A - COMBAT_ENTER, // 0x3B - COMBAT_KILL, // 0x3C + PLAYER_COMBAT_END, // 0x3A + PLAYER_COMBAT_ENTER, // 0x3B + PLAYER_COMBAT_KILL, // 0x3C PLAYER_INFO_REMOVE, // 0x3D PLAYER_INFO_UPDATE, // 0x3E - FACE_PLAYER, // 0x3F + PLAYER_LOOK_AT, // 0x3F PLAYER_POSITION, // 0x40 - UNLOCK_RECIPES, // 0x41 + RECIPE, // 0x41 REMOVE_ENTITIES, // 0x42 - REMOVE_ENTITY_EFFECT, // 0x43 + REMOVE_MOB_EFFECT, // 0x43 RESET_SCORE, // 0x44 RESOURCE_PACK_POP, // 0x45 RESOURCE_PACK_PUSH, // 0x46 RESPAWN, // 0x47 - ENTITY_HEAD_LOOK, // 0x48 - MULTI_BLOCK_CHANGE, // 0x49 + ROTATE_HEAD, // 0x48 + SECTION_BLOCKS_UPDATE, // 0x49 SELECT_ADVANCEMENTS_TAB, // 0x4A SERVER_DATA, // 0x4B - ACTIONBAR, // 0x4C - WORLD_BORDER_CENTER, // 0x4D - WORLD_BORDER_LERP_SIZE, // 0x4E - WORLD_BORDER_SIZE, // 0x4F - WORLD_BORDER_WARNING_DELAY, // 0x50 - WORLD_BORDER_WARNING_DISTANCE, // 0x51 - CAMERA, // 0x52 - HELD_ITEM_CHANGE, // 0x53 - UPDATE_VIEW_POSITION, // 0x54 - UPDATE_VIEW_DISTANCE, // 0x55 - SPAWN_POSITION, // 0x56 - DISPLAY_SCOREBOARD, // 0x57 - ENTITY_METADATA, // 0x58 - ATTACH_ENTITY, // 0x59 - ENTITY_VELOCITY, // 0x5A - ENTITY_EQUIPMENT, // 0x5B + SET_ACTION_BAR_TEXT, // 0x4C + SET_BORDER_CENTER, // 0x4D + SET_BORDER_LERP_SIZE, // 0x4E + SET_BORDER_SIZE, // 0x4F + SET_BORDER_WARNING_DELAY, // 0x50 + SET_BORDER_WARNING_DISTANCE, // 0x51 + SET_CAMERA, // 0x52 + SET_CARRIED_ITEM, // 0x53 + SET_CHUNK_CACHE_CENTER, // 0x54 + SET_CHUNK_CACHE_RADIUS, // 0x55 + SET_DEFAULT_SPAWN_POSITION, // 0x56 + SET_DISPLAY_OBJECTIVE, // 0x57 + SET_ENTITY_DATA, // 0x58 + SET_ENTITY_LINK, // 0x59 + SET_ENTITY_MOTION, // 0x5A + SET_EQUIPMENT, // 0x5B SET_EXPERIENCE, // 0x5C - UPDATE_HEALTH, // 0x5D - SCOREBOARD_OBJECTIVE, // 0x5E + SET_HEALTH, // 0x5D + SET_OBJECTIVE, // 0x5E SET_PASSENGERS, // 0x5F - TEAMS, // 0x60 - UPDATE_SCORE, // 0x61 + SET_PLAYER_TEAM, // 0x60 + SET_SCORE, // 0x61 SET_SIMULATION_DISTANCE, // 0x62 - TITLE_SUBTITLE, // 0x63 - TIME_UPDATE, // 0x64 - TITLE_TEXT, // 0x65 - TITLE_TIMES, // 0x66 - ENTITY_SOUND, // 0x67 + SET_SUBTITLE_TEXT, // 0x63 + SET_TIME, // 0x64 + SET_TITLE_TEXT, // 0x65 + SET_TITLES_ANIMATION, // 0x66 + SOUND_ENTITY, // 0x67 SOUND, // 0x68 START_CONFIGURATION, // 0x69 STOP_SOUND, // 0x6A STORE_COOKIE, // 0x6B SYSTEM_CHAT, // 0x6C TAB_LIST, // 0x6D - NBT_QUERY, // 0x6E - COLLECT_ITEM, // 0x6F - ENTITY_TELEPORT, // 0x70 + TAG_QUERY, // 0x6E + TAKE_ITEM_ENTITY, // 0x6F + TELEPORT_ENTITY, // 0x70 TICKING_STATE, // 0x71 TICKING_STEP, // 0x72 TRANSFER, // 0x73 - ADVANCEMENTS, // 0x74 - ENTITY_PROPERTIES, // 0x75 - ENTITY_EFFECT, // 0x76 - DECLARE_RECIPES, // 0x77 - TAGS, // 0x78 + UPDATE_ADVANCEMENTS, // 0x74 + UPDATE_ATTRIBUTES, // 0x75 + UPDATE_MOB_EFFECT, // 0x76 + UPDATE_RECIPES, // 0x77 + UPDATE_TAGS, // 0x78 PROJECTILE_POWER; // 0x79 @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ServerboundPackets1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ServerboundPackets1_20_5.java index cba5fd3fc..aa8f00002 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ServerboundPackets1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/packet/ServerboundPackets1_20_5.java @@ -19,63 +19,63 @@ package com.viaversion.viaversion.protocols.v1_20_3to1_20_5.packet; public enum ServerboundPackets1_20_5 implements ServerboundPacket1_20_5 { - TELEPORT_CONFIRM, // 0x00 - QUERY_BLOCK_NBT, // 0x01 - SET_DIFFICULTY, // 0x02 + ACCEPT_TELEPORTATION, // 0x00 + BLOCK_ENTITY_TAG_QUERY, // 0x01 + CHANGE_DIFFICULTY, // 0x02 CHAT_ACK, // 0x03 CHAT_COMMAND, // 0x04 CHAT_COMMAND_SIGNED, // 0x05 - CHAT_MESSAGE, // 0x06 + CHAT, // 0x06 CHAT_SESSION_UPDATE, // 0x07 CHUNK_BATCH_RECEIVED, // 0x08 - CLIENT_STATUS, // 0x09 - CLIENT_SETTINGS, // 0x0A - TAB_COMPLETE, // 0x0B + CLIENT_COMMAND, // 0x09 + CLIENT_INFORMATION, // 0x0A + COMMAND_SUGGESTION, // 0x0B CONFIGURATION_ACKNOWLEDGED, // 0x0C - CLICK_WINDOW_BUTTON, // 0x0D - CLICK_WINDOW, // 0x0E - CLOSE_WINDOW, // 0x0F + CONTAINER_BUTTON_CLICK, // 0x0D + CONTAINER_CLICK, // 0x0E + CONTAINER_CLOSE, // 0x0F CONTAINER_SLOT_STATE_CHANGED, // 0x10 COOKIE_RESPONSE, // 0x11 - PLUGIN_MESSAGE, // 0x12 + CUSTOM_PAYLOAD, // 0x12 DEBUG_SAMPLE_SUBSCRIPTION, // 0x13 EDIT_BOOK, // 0x14 - ENTITY_NBT_REQUEST, // 0x15 - INTERACT_ENTITY, // 0x16 - GENERATE_JIGSAW, // 0x17 + ENTITY_TAG_QUERY, // 0x15 + INTERACT, // 0x16 + JIGSAW_GENERATE, // 0x17 KEEP_ALIVE, // 0x18 LOCK_DIFFICULTY, // 0x19 - PLAYER_POSITION, // 0x1A - PLAYER_POSITION_AND_ROTATION, // 0x1B - PLAYER_ROTATION, // 0x1C - PLAYER_MOVEMENT, // 0x1D - VEHICLE_MOVE, // 0x1E - STEER_BOAT, // 0x1F + MOVE_PLAYER_POS, // 0x1A + MOVE_PLAYER_POS_ROT, // 0x1B + MOVE_PLAYER_ROT, // 0x1C + MOVE_PLAYER_STATUS_ONLY, // 0x1D + MOVE_VEHICLE, // 0x1E + PADDLE_BOAT, // 0x1F PICK_ITEM, // 0x20 PING_REQUEST, // 0x21 - CRAFT_RECIPE_REQUEST, // 0x22 + PLACE_RECIPE, // 0x22 PLAYER_ABILITIES, // 0x23 - PLAYER_DIGGING, // 0x24 - ENTITY_ACTION, // 0x25 - STEER_VEHICLE, // 0x26 + PLAYER_ACTION, // 0x24 + PLAYER_COMMAND, // 0x25 + PLAYER_INPUT, // 0x26 PONG, // 0x27 - RECIPE_BOOK_DATA, // 0x28 - SEEN_RECIPE, // 0x29 + RECIPE_BOOK_CHANGE_SETTINGS, // 0x28 + RECIPE_BOOK_SEEN_RECIPE, // 0x29 RENAME_ITEM, // 0x2A - RESOURCE_PACK_STATUS, // 0x2B - ADVANCEMENT_TAB, // 0x2C + RESOURCE_PACK, // 0x2B + SEEN_ADVANCEMENTS, // 0x2C SELECT_TRADE, // 0x2D - SET_BEACON_EFFECT, // 0x2E - HELD_ITEM_CHANGE, // 0x2F - UPDATE_COMMAND_BLOCK, // 0x30 - UPDATE_COMMAND_BLOCK_MINECART, // 0x31 - CREATIVE_INVENTORY_ACTION, // 0x32 - UPDATE_JIGSAW_BLOCK, // 0x33 - UPDATE_STRUCTURE_BLOCK, // 0x34 - UPDATE_SIGN, // 0x35 - ANIMATION, // 0x36 - SPECTATE, // 0x37 - PLAYER_BLOCK_PLACEMENT, // 0x38 + SET_BEACON, // 0x2E + SET_CARRIED_ITEM, // 0x2F + SET_COMMAND_BLOCK, // 0x30 + SET_COMMAND_MINECART, // 0x31 + SET_CREATIVE_MODE_SLOT, // 0x32 + SET_JIGSAW_BLOCK, // 0x33 + SET_STRUCTURE_BLOCK, // 0x34 + SIGN_UPDATE, // 0x35 + SWING, // 0x36 + TELEPORT_TO_ENTITY, // 0x37 + USE_ITEM_ON, // 0x38 USE_ITEM; // 0x39 @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java index 56b8f1b05..620995f8d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java @@ -135,11 +135,11 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter blockRewriter = BlockRewriter.for1_20_2(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_20_3.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_20_3.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_20_3.EFFECT, 1010, 2001); - protocol.registerClientbound(ClientboundPackets1_20_3.CHUNK_DATA, wrapper -> { + blockRewriter.registerBlockAction(ClientboundPackets1_20_3.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_20_3.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_20_3.LEVEL_EVENT, 1010, 2001); + protocol.registerClientbound(ClientboundPackets1_20_3.LEVEL_CHUNK_WITH_LIGHT, wrapper -> { final Chunk chunk = blockRewriter.handleChunk1_19(wrapper, ChunkType1_20_2::new); for (int i = 0; i < chunk.blockEntities().size(); i++) { final BlockEntity blockEntity = chunk.blockEntities().get(i); @@ -172,20 +172,20 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + registerWindowItems1_17_1(ClientboundPackets1_20_3.CONTAINER_SET_CONTENT); + registerSetSlot1_17_1(ClientboundPackets1_20_3.CONTAINER_SET_SLOT); + registerEntityEquipmentArray(ClientboundPackets1_20_3.SET_EQUIPMENT); + registerClickWindow1_17_1(ServerboundPackets1_20_5.CONTAINER_CLICK); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_3.CONTAINER_SET_DATA); + registerCreativeInvAction(ServerboundPackets1_20_5.SET_CREATIVE_MODE_SLOT); + protocol.registerServerbound(ServerboundPackets1_20_5.CONTAINER_BUTTON_CLICK, wrapper -> { final byte containerId = wrapper.read(Type.VAR_INT).byteValue(); final byte buttonId = wrapper.read(Type.VAR_INT).byteValue(); wrapper.write(Type.BYTE, containerId); wrapper.write(Type.BYTE, buttonId); }); - protocol.registerClientbound(ClientboundPackets1_20_3.ADVANCEMENTS, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_20_3.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear int size = wrapper.passthrough(Type.VAR_INT); // Mapping size for (int i = 0; i < size; i++) { @@ -218,7 +218,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.LEVEL_PARTICLES, wrapper -> { final int particleId = wrapper.read(Type.VAR_INT); wrapper.passthrough(Type.BOOLEAN); // Long Distance @@ -275,7 +275,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.EXPLODE, wrapper -> { wrapper.passthrough(Type.DOUBLE); // X wrapper.passthrough(Type.DOUBLE); // Y wrapper.passthrough(Type.DOUBLE); // Z @@ -297,7 +297,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.MERCHANT_OFFERS, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Container id final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { @@ -331,7 +331,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.UPDATE_RECIPES, wrapper -> { final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { // Change order and write the type as an int diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java index 92abc5754..9b4ee46fb 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java @@ -69,8 +69,8 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { @@ -206,7 +206,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.UPDATE_MOB_EFFECT, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity ID wrapper.passthrough(Type.VAR_INT); // Effect ID @@ -279,7 +279,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_20_3.UPDATE_ATTRIBUTES, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity ID final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { @@ -363,7 +363,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { + filter().type(EntityTypes1_20_5.LIVING_ENTITY).index(10).handler((event, meta) -> { final int effectColor = meta.value(); if (effectColor == 0) { // No effect @@ -480,7 +480,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { + filter().type(EntityTypes1_20_5.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/Protocol1_20To1_20_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/Protocol1_20To1_20_2.java index 7d6f670d7..8a30d8a67 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/Protocol1_20To1_20_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/Protocol1_20To1_20_2.java @@ -76,7 +76,7 @@ public final class Protocol1_20To1_20_2 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND_ENTITY); final PacketHandlers sanitizeCustomPayload = new PacketHandlers() { @Override @@ -91,8 +91,8 @@ public final class Protocol1_20To1_20_2 extends AbstractProtocol { final String url = wrapper.passthrough(Type.STRING); @@ -102,7 +102,7 @@ public final class Protocol1_20To1_20_2 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_19_4.UPDATE_TAGS, wrapper -> { tagRewriter.getGenericHandler().handle(wrapper); wrapper.resetReader(); wrapper.user().put(new LastTags(wrapper)); @@ -113,7 +113,7 @@ public final class Protocol1_20To1_20_2 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_19_4.SET_DISPLAY_OBJECTIVE, wrapper -> { final byte slot = wrapper.read(Type.BYTE); wrapper.write(Type.VAR_INT, (int) slot); }); @@ -177,7 +177,7 @@ public final class Protocol1_20To1_20_2 extends AbstractProtocol blockRewriter = BlockRewriter.for1_14(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_19_4.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_19_4.EFFECT, 1010, 2001); + blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_19_4.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_19_4.LEVEL_EVENT, 1010, 2001); - protocol.registerServerbound(ServerboundPackets1_20_2.SET_BEACON_EFFECT, wrapper -> { + protocol.registerServerbound(ServerboundPackets1_20_2.SET_BEACON, wrapper -> { // Effects start at 1 before 1.20.2 if (wrapper.passthrough(Type.BOOLEAN)) { // Primary effect wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); @@ -72,13 +72,13 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.FORGET_LEVEL_CHUNK, wrapper -> { final int x = wrapper.read(Type.INT); final int z = wrapper.read(Type.INT); wrapper.write(Type.CHUNK_POSITION, new ChunkPosition(x, z)); }); - protocol.registerClientbound(ClientboundPackets1_19_4.NBT_QUERY, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_19_4.TAG_QUERY, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Transaction id wrapper.write(Type.COMPOUND_TAG, wrapper.read(Type.NAMED_COMPOUND_TAG)); }); @@ -89,7 +89,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.LEVEL_CHUNK_WITH_LIGHT, wrapper -> { final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user()); final Type chunkType = new ChunkType1_18(tracker.currentWorldSectionHeight(), MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().size()), @@ -115,7 +115,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter wrapper.write(Type.ITEM1_20_2, handleItemToClient(wrapper.user(), wrapper.read(Type.ITEM1_13_2)))); } }); - protocol.registerClientbound(ClientboundPackets1_19_4.ADVANCEMENTS, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_19_4.UPDATE_ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size for (int i = 0; i < size; i++) { @@ -171,7 +171,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.MERCHANT_OFFERS, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Container id final int size = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < size; i++) { @@ -224,14 +224,14 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter wrapper.write(Type.ITEM1_13_2, handleItemToServer(wrapper.user(), wrapper.read(Type.ITEM1_20_2)))); // 1 - Clicked Item } }); - protocol.registerClientbound(ClientboundPackets1_19_4.SPAWN_PARTICLE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_19_4.LEVEL_PARTICLES, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Particle ID @@ -338,7 +338,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.ADD_PLAYER, ClientboundPackets1_20_2.ADD_ENTITY, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity id wrapper.passthrough(Type.UUID); // UUID @@ -63,7 +63,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { @@ -155,7 +155,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.UPDATE_MOB_EFFECT, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity id wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) - 1); // Effect id wrapper.passthrough(Type.BYTE); // Amplifier @@ -164,7 +164,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { + protocol.registerClientbound(ClientboundPackets1_19_4.REMOVE_MOB_EFFECT, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Entity id wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) - 1); // Effect id }); @@ -177,7 +177,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { + filter().type(EntityTypes1_19_4.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/storage/ConfigurationState.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/storage/ConfigurationState.java index 16c3fa80b..d339b06bf 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/storage/ConfigurationState.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20to1_20_2/storage/ConfigurationState.java @@ -162,7 +162,7 @@ public class ConfigurationState implements StorableObject { return null; } - final PacketWrapper settingsPacket = PacketWrapper.create(ServerboundPackets1_19_4.CLIENT_SETTINGS, connection); + final PacketWrapper settingsPacket = PacketWrapper.create(ServerboundPackets1_19_4.CLIENT_INFORMATION, connection); settingsPacket.write(Type.STRING, clientInformation.language); settingsPacket.write(Type.BYTE, clientInformation.viewDistance); settingsPacket.write(Type.VAR_INT, clientInformation.chatVisibility); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ClientboundPackets1_8.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ClientboundPackets1_8.java index f203642f3..76f5513df 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ClientboundPackets1_8.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ClientboundPackets1_8.java @@ -22,75 +22,75 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_8 implements ClientboundPacketType { KEEP_ALIVE, // 0x00 - JOIN_GAME, // 0x01 - CHAT_MESSAGE, // 0x02 - TIME_UPDATE, // 0x03 - ENTITY_EQUIPMENT, // 0x04 - SPAWN_POSITION, // 0x05 - UPDATE_HEALTH, // 0x06 + LOGIN, // 0x01 + CHAT, // 0x02 + SET_TIME, // 0x03 + SET_EQUIPPED_ITEM, // 0x04 + SET_DEFAULT_SPAWN_POSITION, // 0x05 + SET_HEALTH, // 0x06 RESPAWN, // 0x07 PLAYER_POSITION, // 0x08 - HELD_ITEM_CHANGE, // 0x09 - USE_BED, // 0x0A - ENTITY_ANIMATION, // 0x0B - SPAWN_PLAYER, // 0x0C - COLLECT_ITEM, // 0x0D - SPAWN_ENTITY, // 0x0E - SPAWN_MOB, // 0x0F - SPAWN_PAINTING, // 0x10 - SPAWN_EXPERIENCE_ORB, // 0x11 - ENTITY_VELOCITY, // 0x12 - DESTROY_ENTITIES, // 0x13 - ENTITY_MOVEMENT, // 0x14 - ENTITY_POSITION, // 0x15 - ENTITY_ROTATION, // 0x16 - ENTITY_POSITION_AND_ROTATION, // 0x17 - ENTITY_TELEPORT, // 0x18 - ENTITY_HEAD_LOOK, // 0x19 - ENTITY_STATUS, // 0x1A - ATTACH_ENTITY, // 0x1B - ENTITY_METADATA, // 0x1C - ENTITY_EFFECT, // 0x1D - REMOVE_ENTITY_EFFECT, // 0x1E + SET_CARRIED_ITEM, // 0x09 + PLAYER_SLEEP, // 0x0A + ANIMATE, // 0x0B + ADD_PLAYER, // 0x0C + TAKE_ITEM_ENTITY, // 0x0D + ADD_ENTITY, // 0x0E + ADD_MOB, // 0x0F + ADD_PAINTING, // 0x10 + ADD_EXPERIENCE_ORB, // 0x11 + SET_ENTITY_MOTION, // 0x12 + REMOVE_ENTITIES, // 0x13 + MOVE_ENTITY, // 0x14 + MOVE_ENTITY_POS, // 0x15 + MOVE_ENTITY_ROT, // 0x16 + MOVE_ENTITY_POS_ROT, // 0x17 + TELEPORT_ENTITY, // 0x18 + ROTATE_HEAD, // 0x19 + ENTITY_EVENT, // 0x1A + SET_ENTITY_LINK, // 0x1B + SET_ENTITY_DATA, // 0x1C + UPDATE_MOB_EFFECT, // 0x1D + REMOVE_MOB_EFFECT, // 0x1E SET_EXPERIENCE, // 0x1F - ENTITY_PROPERTIES, // 0x20 - CHUNK_DATA, // 0x21 - MULTI_BLOCK_CHANGE, // 0x22 - BLOCK_CHANGE, // 0x23 - BLOCK_ACTION, // 0x24 - BLOCK_BREAK_ANIMATION, // 0x25 + UPDATE_ATTRIBUTES, // 0x20 + LEVEL_CHUNK, // 0x21 + CHUNK_BLOCKS_UPDATE, // 0x22 + BLOCK_UPDATE, // 0x23 + BLOCK_EVENT, // 0x24 + BLOCK_DESTRUCTION, // 0x25 MAP_BULK_CHUNK, // 0x26 - EXPLOSION, // 0x27 - EFFECT, // 0x28 - NAMED_SOUND, // 0x29 - SPAWN_PARTICLE, // 0x2A + EXPLODE, // 0x27 + LEVEL_EVENT, // 0x28 + CUSTOM_SOUND, // 0x29 + LEVEL_PARTICLES, // 0x2A GAME_EVENT, // 0x2B - SPAWN_GLOBAL_ENTITY, // 0x2C - OPEN_WINDOW, // 0x2D - CLOSE_WINDOW, // 0x2E - SET_SLOT, // 0x2F - WINDOW_ITEMS, // 0x30 - WINDOW_PROPERTY, // 0x31 - WINDOW_CONFIRMATION, // 0x32 + ADD_GLOBAL_ENTITY, // 0x2C + OPEN_SCREEN, // 0x2D + CONTAINER_CLOSE, // 0x2E + CONTAINER_SET_SLOT, // 0x2F + CONTAINER_SET_CONTENT, // 0x30 + CONTAINER_SET_DATA, // 0x31 + CONTAINER_ACK, // 0x32 UPDATE_SIGN, // 0x33 - MAP_DATA, // 0x34 + MAP_ITEM_DATA, // 0x34 BLOCK_ENTITY_DATA, // 0x35 OPEN_SIGN_EDITOR, // 0x36 - STATISTICS, // 0x37 + AWARD_STATS, // 0x37 PLAYER_INFO, // 0x38 PLAYER_ABILITIES, // 0x39 - TAB_COMPLETE, // 0x3A - SCOREBOARD_OBJECTIVE, // 0x3B - UPDATE_SCORE, // 0x3C - DISPLAY_SCOREBOARD, // 0x3D - TEAMS, // 0x3E - PLUGIN_MESSAGE, // 0x3F + COMMAND_SUGGESTIONS, // 0x3A + SET_OBJECTIVE, // 0x3B + SET_SCORE, // 0x3C + SET_DISPLAY_OBJECTIVE, // 0x3D + SET_PLAYER_TEAM, // 0x3E + CUSTOM_PAYLOAD, // 0x3F DISCONNECT, // 0x40 - SERVER_DIFFICULTY, // 0x41 - COMBAT_EVENT, // 0x42 - CAMERA, // 0x43 - WORLD_BORDER, // 0x44 - TITLE, // 0x45 + CHANGE_DIFFICULTY, // 0x41 + PLAYER_COMBAT, // 0x42 + SET_CAMERA, // 0x43 + SET_BORDER, // 0x44 + SET_TITLES, // 0x45 SET_COMPRESSION, // 0x46 TAB_LIST, // 0x47 RESOURCE_PACK, // 0x48 diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ServerboundPackets1_8.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ServerboundPackets1_8.java index c12b23b3f..214b7576b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ServerboundPackets1_8.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8/packet/ServerboundPackets1_8.java @@ -22,31 +22,31 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_8 implements ServerboundPacketType { KEEP_ALIVE, // 0x00 - CHAT_MESSAGE, // 0x01 - INTERACT_ENTITY, // 0x02 - PLAYER_MOVEMENT, // 0x03 - PLAYER_POSITION, // 0x04 - PLAYER_ROTATION, // 0x05 - PLAYER_POSITION_AND_ROTATION, // 0x06 - PLAYER_DIGGING, // 0x07 - PLAYER_BLOCK_PLACEMENT, // 0x08 - HELD_ITEM_CHANGE, // 0x09 - ANIMATION, // 0x0A - ENTITY_ACTION, // 0x0B - STEER_VEHICLE, // 0x0C - CLOSE_WINDOW, // 0x0D - CLICK_WINDOW, // 0x0E - WINDOW_CONFIRMATION, // 0x0F - CREATIVE_INVENTORY_ACTION, // 0x10 - CLICK_WINDOW_BUTTON, // 0x11 - UPDATE_SIGN, // 0x12 + CHAT, // 0x01 + INTERACT, // 0x02 + MOVE_PLAYER_STATUS_ONLY, // 0x03 + MOVE_PLAYER_POS, // 0x04 + MOVE_PLAYER_ROT, // 0x05 + MOVE_PLAYER_POS_ROT, // 0x06 + PLAYER_ACTION, // 0x07 + USE_ITEM_ON, // 0x08 + SET_CARRIED_ITEM, // 0x09 + SWING, // 0x0A + PLAYER_COMMAND, // 0x0B + PLAYER_INPUT, // 0x0C + CONTAINER_CLOSE, // 0x0D + CONTAINER_CLICK, // 0x0E + CONTAINER_ACK, // 0x0F + SET_CREATIVE_MODE_SLOT, // 0x10 + CONTAINER_BUTTON_CLICK, // 0x11 + SIGN_UPDATE, // 0x12 PLAYER_ABILITIES, // 0x13 - TAB_COMPLETE, // 0x14 - CLIENT_SETTINGS, // 0x15 - CLIENT_STATUS, // 0x16 - PLUGIN_MESSAGE, // 0x17 - SPECTATE, // 0x18 - RESOURCE_PACK_STATUS; // 0x19 + COMMAND_SUGGESTION, // 0x14 + CLIENT_INFORMATION, // 0x15 + CLIENT_COMMAND, // 0x16 + CUSTOM_PAYLOAD, // 0x17 + TELEPORT_TO_ENTITY, // 0x18 + RESOURCE_PACK; // 0x19 @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ClientboundPackets1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ClientboundPackets1_9.java index 329d6ff38..8563bce54 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ClientboundPackets1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ClientboundPackets1_9.java @@ -21,83 +21,83 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; public enum ClientboundPackets1_9 implements ClientboundPacketType { - SPAWN_ENTITY, // 0x00 - SPAWN_EXPERIENCE_ORB, // 0x01 - SPAWN_GLOBAL_ENTITY, // 0x02 - SPAWN_MOB, // 0x03 - SPAWN_PAINTING, // 0x04 - SPAWN_PLAYER, // 0x05 - ENTITY_ANIMATION, // 0x06 - STATISTICS, // 0x07 - BLOCK_BREAK_ANIMATION, // 0x08 + ADD_ENTITY, // 0x00 + ADD_EXPERIENCE_ORB, // 0x01 + ADD_GLOBAL_ENTITY, // 0x02 + ADD_MOB, // 0x03 + ADD_PAINTING, // 0x04 + ADD_PLAYER, // 0x05 + ANIMATE, // 0x06 + AWARD_STATS, // 0x07 + BLOCK_DESTRUCTION, // 0x08 BLOCK_ENTITY_DATA, // 0x09 - BLOCK_ACTION, // 0x0A - BLOCK_CHANGE, // 0x0B - BOSSBAR, // 0x0C - SERVER_DIFFICULTY, // 0x0D - TAB_COMPLETE, // 0x0E - CHAT_MESSAGE, // 0x0F - MULTI_BLOCK_CHANGE, // 0x10 - WINDOW_CONFIRMATION, // 0x11 - CLOSE_WINDOW, // 0x12 - OPEN_WINDOW, // 0x13 - WINDOW_ITEMS, // 0x14 - WINDOW_PROPERTY, // 0x15 - SET_SLOT, // 0x16 + BLOCK_EVENT, // 0x0A + BLOCK_UPDATE, // 0x0B + BOSS_EVENT, // 0x0C + CHANGE_DIFFICULTY, // 0x0D + COMMAND_SUGGESTIONS, // 0x0E + CHAT, // 0x0F + CHUNK_BLOCKS_UPDATE, // 0x10 + CONTAINER_ACK, // 0x11 + CONTAINER_CLOSE, // 0x12 + OPEN_SCREEN, // 0x13 + CONTAINER_SET_CONTENT, // 0x14 + CONTAINER_SET_DATA, // 0x15 + CONTAINER_SET_SLOT, // 0x16 COOLDOWN, // 0x17 - PLUGIN_MESSAGE, // 0x18 - NAMED_SOUND, // 0x19 + CUSTOM_PAYLOAD, // 0x18 + CUSTOM_SOUND, // 0x19 DISCONNECT, // 0x1A - ENTITY_STATUS, // 0x1B - EXPLOSION, // 0x1C - UNLOAD_CHUNK, // 0x1D + ENTITY_EVENT, // 0x1B + EXPLODE, // 0x1C + FORGET_LEVEL_CHUNK, // 0x1D GAME_EVENT, // 0x1E KEEP_ALIVE, // 0x1F - CHUNK_DATA, // 0x20 - EFFECT, // 0x21 - SPAWN_PARTICLE, // 0x22 - JOIN_GAME, // 0x23 - MAP_DATA, // 0x24 - ENTITY_POSITION, // 0x25 - ENTITY_POSITION_AND_ROTATION, // 0x26 - ENTITY_ROTATION, // 0x27 - ENTITY_MOVEMENT, // 0x28 - VEHICLE_MOVE, // 0x29 + LEVEL_CHUNK, // 0x20 + LEVEL_EVENT, // 0x21 + LEVEL_PARTICLES, // 0x22 + LOGIN, // 0x23 + MAP_ITEM_DATA, // 0x24 + MOVE_ENTITY_POS, // 0x25 + MOVE_ENTITY_POS_ROT, // 0x26 + MOVE_ENTITY_ROT, // 0x27 + MOVE_ENTITY, // 0x28 + MOVE_VEHICLE, // 0x29 OPEN_SIGN_EDITOR, // 0x2A PLAYER_ABILITIES, // 0x2B - COMBAT_EVENT, // 0x2C + PLAYER_COMBAT, // 0x2C PLAYER_INFO, // 0x2D PLAYER_POSITION, // 0x2E - USE_BED, // 0x2F - DESTROY_ENTITIES, // 0x30 - REMOVE_ENTITY_EFFECT, // 0x31 + PLAYER_SLEEP, // 0x2F + REMOVE_ENTITIES, // 0x30 + REMOVE_MOB_EFFECT, // 0x31 RESOURCE_PACK, // 0x32 RESPAWN, // 0x33 - ENTITY_HEAD_LOOK, // 0x34 - WORLD_BORDER, // 0x35 - CAMERA, // 0x36 - HELD_ITEM_CHANGE, // 0x37 - DISPLAY_SCOREBOARD, // 0x38 - ENTITY_METADATA, // 0x39 - ATTACH_ENTITY, // 0x3A - ENTITY_VELOCITY, // 0x3B - ENTITY_EQUIPMENT, // 0x3C + ROTATE_HEAD, // 0x34 + SET_BORDER, // 0x35 + SET_CAMERA, // 0x36 + SET_CARRIED_ITEM, // 0x37 + SET_DISPLAY_OBJECTIVE, // 0x38 + SET_ENTITY_DATA, // 0x39 + SET_ENTITY_LINK, // 0x3A + SET_ENTITY_MOTION, // 0x3B + SET_EQUIPPED_ITEM, // 0x3C SET_EXPERIENCE, // 0x3D - UPDATE_HEALTH, // 0x3E - SCOREBOARD_OBJECTIVE, // 0x3F + SET_HEALTH, // 0x3E + SET_OBJECTIVE, // 0x3F SET_PASSENGERS, // 0x40 - TEAMS, // 0x41 - UPDATE_SCORE, // 0x42 - SPAWN_POSITION, // 0x43 - TIME_UPDATE, // 0x44 - TITLE, // 0x45 + SET_PLAYER_TEAM, // 0x41 + SET_SCORE, // 0x42 + SET_DEFAULT_SPAWN_POSITION, // 0x43 + SET_TIME, // 0x44 + SET_TITLES, // 0x45 UPDATE_SIGN, // 0x46 SOUND, // 0x47 TAB_LIST, // 0x48 - COLLECT_ITEM, // 0x49 - ENTITY_TELEPORT, // 0x4A - ENTITY_PROPERTIES, // 0x4B - ENTITY_EFFECT; // 0x4C + TAKE_ITEM_ENTITY, // 0x49 + TELEPORT_ENTITY, // 0x4A + UPDATE_ATTRIBUTES, // 0x4B + UPDATE_MOB_EFFECT; // 0x4C @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ServerboundPackets1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ServerboundPackets1_9.java index 42a480212..3ab1ed74c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ServerboundPackets1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/packet/ServerboundPackets1_9.java @@ -21,35 +21,35 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; public enum ServerboundPackets1_9 implements ServerboundPacketType { - TELEPORT_CONFIRM, // 0x00 - TAB_COMPLETE, // 0x01 - CHAT_MESSAGE, // 0x02 - CLIENT_STATUS, // 0x03 - CLIENT_SETTINGS, // 0x04 - WINDOW_CONFIRMATION, // 0x05 - CLICK_WINDOW_BUTTON, // 0x06 - CLICK_WINDOW, // 0x07 - CLOSE_WINDOW, // 0x08 - PLUGIN_MESSAGE, // 0x09 - INTERACT_ENTITY, // 0x0A + ACCEPT_TELEPORTATION, // 0x00 + COMMAND_SUGGESTION, // 0x01 + CHAT, // 0x02 + CLIENT_COMMAND, // 0x03 + CLIENT_INFORMATION, // 0x04 + CONTAINER_ACK, // 0x05 + CONTAINER_BUTTON_CLICK, // 0x06 + CONTAINER_CLICK, // 0x07 + CONTAINER_CLOSE, // 0x08 + CUSTOM_PAYLOAD, // 0x09 + INTERACT, // 0x0A KEEP_ALIVE, // 0x0B - PLAYER_POSITION, // 0x0C - PLAYER_POSITION_AND_ROTATION, // 0x0D - PLAYER_ROTATION, // 0x0E - PLAYER_MOVEMENT, // 0x0F - VEHICLE_MOVE, // 0x10 - STEER_BOAT, // 0x11 + MOVE_PLAYER_POS, // 0x0C + MOVE_PLAYER_POS_ROT, // 0x0D + MOVE_PLAYER_ROT, // 0x0E + MOVE_PLAYER_STATUS_ONLY, // 0x0F + MOVE_VEHICLE, // 0x10 + PADDLE_BOAT, // 0x11 PLAYER_ABILITIES, // 0x12 - PLAYER_DIGGING, // 0x13 - ENTITY_ACTION, // 0x14 - STEER_VEHICLE, // 0x15 - RESOURCE_PACK_STATUS, // 0x16 - HELD_ITEM_CHANGE, // 0x17 - CREATIVE_INVENTORY_ACTION, // 0x18 - UPDATE_SIGN, // 0x19 - ANIMATION, // 0x1A - SPECTATE, // 0x1B - PLAYER_BLOCK_PLACEMENT, // 0x1C + PLAYER_ACTION, // 0x13 + PLAYER_COMMAND, // 0x14 + PLAYER_INPUT, // 0x15 + RESOURCE_PACK, // 0x16 + SET_CARRIED_ITEM, // 0x17 + SET_CREATIVE_MODE_SLOT, // 0x18 + SIGN_UPDATE, // 0x19 + SWING, // 0x1A + TELEPORT_TO_ENTITY, // 0x1B + USE_ITEM_ON, // 0x1C USE_ITEM; // 0x1D @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/CommandBlockProvider.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/CommandBlockProvider.java index 88b9b00c9..43e36157c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/CommandBlockProvider.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/CommandBlockProvider.java @@ -51,7 +51,7 @@ public class CommandBlockProvider implements Provider { } public void sendPermission(UserConnection user) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_STATUS, null, user); // Entity status + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_EVENT, null, user); // Entity status EntityTracker1_9 tracker = user.getEntityTracker(Protocol1_8To1_9.class); wrapper.write(Type.INT, tracker.getProvidedEntityId()); // Entity ID diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/MovementTransmitterProvider.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/MovementTransmitterProvider.java index bf32f4a70..bb4ceead0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/MovementTransmitterProvider.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/providers/MovementTransmitterProvider.java @@ -39,7 +39,7 @@ public class MovementTransmitterProvider implements Provider { movementTracker.incrementIdlePacket(); try { - final PacketWrapper playerMovement = PacketWrapper.create(ServerboundPackets1_8.PLAYER_MOVEMENT, userConnection); + final PacketWrapper playerMovement = PacketWrapper.create(ServerboundPackets1_8.MOVE_PLAYER_STATUS_ONLY, userConnection); playerMovement.write(Type.BOOLEAN, movementTracker.isGround()); // on ground playerMovement.scheduleSendToServer(Protocol1_8To1_9.class); } catch (Throwable e) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/EntityPacketRewriter1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/EntityPacketRewriter1_9.java index 1a30c40f4..9dd838165 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/EntityPacketRewriter1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/EntityPacketRewriter1_9.java @@ -52,7 +52,7 @@ public class EntityPacketRewriter1_9 { public static void register(Protocol1_8To1_9 protocol) { // Attach Entity Packet - protocol.registerClientbound(ClientboundPackets1_8.ATTACH_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.SET_ENTITY_LINK, new PacketHandlers() { @Override public void register() { @@ -86,7 +86,7 @@ public class EntityPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_TELEPORT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.TELEPORT_ENTITY, new PacketHandlers() { @Override public void register() { @@ -115,7 +115,7 @@ public class EntityPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_POSITION_AND_ROTATION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.MOVE_ENTITY_POS_ROT, new PacketHandlers() { @Override public void register() { @@ -130,7 +130,7 @@ public class EntityPacketRewriter1_9 { map(Type.BOOLEAN); // 6 - On Ground } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_POSITION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.MOVE_ENTITY_POS, new PacketHandlers() { @Override public void register() { @@ -142,7 +142,7 @@ public class EntityPacketRewriter1_9 { map(Type.BOOLEAN); // 4 - On Ground } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_EQUIPMENT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.SET_EQUIPPED_ITEM, new PacketHandlers() { @Override public void register() { @@ -191,7 +191,7 @@ public class EntityPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_METADATA, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.SET_ENTITY_DATA, new PacketHandlers() { @Override public void register() { @@ -226,7 +226,7 @@ public class EntityPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.UPDATE_MOB_EFFECT, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -245,7 +245,7 @@ public class EntityPacketRewriter1_9 { protocol.cancelClientbound(ClientboundPackets1_8.UPDATE_ENTITY_NBT); - protocol.registerClientbound(ClientboundPackets1_8.COMBAT_EVENT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.PLAYER_COMBAT, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); //Event id @@ -259,7 +259,7 @@ public class EntityPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_PROPERTIES, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.UPDATE_ATTRIBUTES, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); @@ -313,7 +313,7 @@ public class EntityPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.ENTITY_ANIMATION, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ANIMATE, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -328,7 +328,7 @@ public class EntityPacketRewriter1_9 { /* Incoming Packets */ - protocol.registerServerbound(ServerboundPackets1_9.ENTITY_ACTION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.PLAYER_COMMAND, new PacketHandlers() { @Override public void register() { @@ -346,7 +346,7 @@ public class EntityPacketRewriter1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.INTERACT_ENTITY, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.INTERACT, new PacketHandlers() { @Override public void register() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/ItemPacketRewriter1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/ItemPacketRewriter1_9.java index 6d16a23be..69088d1a7 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/ItemPacketRewriter1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/ItemPacketRewriter1_9.java @@ -32,7 +32,7 @@ import com.viaversion.viaversion.protocols.v1_8to1_9.storage.InventoryTracker; public class ItemPacketRewriter1_9 { public static void register(Protocol1_8To1_9 protocol) { - protocol.registerClientbound(ClientboundPackets1_8.WINDOW_PROPERTY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CONTAINER_SET_DATA, new PacketHandlers() { @Override public void register() { @@ -63,7 +63,7 @@ public class ItemPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.OPEN_WINDOW, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.OPEN_SCREEN, new PacketHandlers() { @Override public void register() { @@ -87,7 +87,7 @@ public class ItemPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.SET_SLOT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CONTAINER_SET_SLOT, new PacketHandlers() { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID @@ -129,7 +129,7 @@ public class ItemPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.WINDOW_ITEMS, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CONTAINER_SET_CONTENT, new PacketHandlers() { @Override public void register() { @@ -182,7 +182,7 @@ public class ItemPacketRewriter1_9 { }); } }); - protocol.registerClientbound(ClientboundPackets1_8.CLOSE_WINDOW, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CONTAINER_CLOSE, new PacketHandlers() { @Override public void register() { @@ -196,7 +196,7 @@ public class ItemPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.MAP_DATA, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.MAP_ITEM_DATA, new PacketHandlers() { @Override public void register() { @@ -211,7 +211,7 @@ public class ItemPacketRewriter1_9 { /* Incoming Packets */ - protocol.registerServerbound(ServerboundPackets1_9.CREATIVE_INVENTORY_ACTION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.SET_CREATIVE_MODE_SLOT, new PacketHandlers() { @Override public void register() { @@ -243,7 +243,7 @@ public class ItemPacketRewriter1_9 { boolean throwItem = (slot == 45); if (throwItem) { // Send a packet wiping the slot - wrapper.create(ClientboundPackets1_9.SET_SLOT, w -> { + wrapper.create(ClientboundPackets1_9.CONTAINER_SET_SLOT, w -> { w.write(Type.UNSIGNED_BYTE, (short) 0); w.write(Type.SHORT, slot); w.write(Type.ITEM1_8, null); @@ -255,7 +255,7 @@ public class ItemPacketRewriter1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.CLICK_WINDOW, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.CONTAINER_CLICK, new PacketHandlers() { @Override public void register() { @@ -298,7 +298,7 @@ public class ItemPacketRewriter1_9 { if (throwItem) { // Send a packet wiping the slot - wrapper.create(ClientboundPackets1_9.SET_SLOT, w -> { + wrapper.create(ClientboundPackets1_9.CONTAINER_SET_SLOT, w -> { w.write(Type.UNSIGNED_BYTE, windowID); w.write(Type.SHORT, slot); w.write(Type.ITEM1_8, null); @@ -312,7 +312,7 @@ public class ItemPacketRewriter1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.CLOSE_WINDOW, new + protocol.registerServerbound(ServerboundPackets1_9.CONTAINER_CLOSE, new PacketHandlers() { @@ -329,7 +329,7 @@ public class ItemPacketRewriter1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.HELD_ITEM_CHANGE, new + protocol.registerServerbound(ServerboundPackets1_9.SET_CARRIED_ITEM, new PacketHandlers() { @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/PlayerPackets1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/PlayerPackets1_9.java index fd57fb349..1251d3970 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/PlayerPackets1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/PlayerPackets1_9.java @@ -42,7 +42,7 @@ import java.util.logging.Level; public class PlayerPackets1_9 { public static void register(Protocol1_8To1_9 protocol) { - protocol.registerClientbound(ClientboundPackets1_8.CHAT_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CHAT, new PacketHandlers() { @Override public void register() { map(Type.STRING, Protocol1_8To1_9.STRING_TO_JSON); // 0 - Chat Message (json) @@ -70,7 +70,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.TITLE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.SET_TITLES, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Action @@ -101,7 +101,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.TEAMS, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.SET_PLAYER_TEAM, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Team Name @@ -162,7 +162,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.JOIN_GAME, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.LOGIN, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Player ID @@ -256,7 +256,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Channel Name @@ -355,7 +355,7 @@ public class PlayerPackets1_9 { /* Incoming Packets */ - protocol.registerServerbound(ServerboundPackets1_9.TAB_COMPLETE, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.COMMAND_SUGGESTION, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Requested Command @@ -363,7 +363,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.CLIENT_SETTINGS, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.CLIENT_INFORMATION, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - locale @@ -386,18 +386,18 @@ public class PlayerPackets1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.ANIMATION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.SWING, new PacketHandlers() { @Override public void register() { read(Type.VAR_INT); // 0 - Hand } }); - protocol.cancelServerbound(ServerboundPackets1_9.TELEPORT_CONFIRM); - protocol.cancelServerbound(ServerboundPackets1_9.VEHICLE_MOVE); - protocol.cancelServerbound(ServerboundPackets1_9.STEER_BOAT); + protocol.cancelServerbound(ServerboundPackets1_9.ACCEPT_TELEPORTATION); + protocol.cancelServerbound(ServerboundPackets1_9.MOVE_VEHICLE); + protocol.cancelServerbound(ServerboundPackets1_9.PADDLE_BOAT); - protocol.registerServerbound(ServerboundPackets1_9.PLUGIN_MESSAGE, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.CUSTOM_PAYLOAD, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Channel Name @@ -427,7 +427,7 @@ public class PlayerPackets1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.CLIENT_STATUS, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.CLIENT_COMMAND, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Action ID @@ -452,7 +452,7 @@ public class PlayerPackets1_9 { tracker.incrementIdlePacket(); tracker.setGround(wrapper.get(Type.BOOLEAN, 0)); }; - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_POSITION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.MOVE_PLAYER_POS, new PacketHandlers() { @Override public void register() { map(Type.DOUBLE); // 0 - X @@ -462,7 +462,7 @@ public class PlayerPackets1_9 { handler(onGroundHandler); } }); - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_POSITION_AND_ROTATION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.MOVE_PLAYER_POS_ROT, new PacketHandlers() { @Override public void register() { map(Type.DOUBLE); // 0 - X @@ -474,7 +474,7 @@ public class PlayerPackets1_9 { handler(onGroundHandler); } }); - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_ROTATION, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.MOVE_PLAYER_ROT, new PacketHandlers() { @Override public void register() { map(Type.FLOAT); // 0 - Yaw @@ -483,7 +483,7 @@ public class PlayerPackets1_9 { handler(onGroundHandler); } }); - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_MOVEMENT, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.MOVE_PLAYER_STATUS_ONLY, new PacketHandlers() { @Override public void register() { map(Type.BOOLEAN); // 0 - Ground diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/SpawnPackets1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/SpawnPackets1_9.java index 3b6533866..90416ecdd 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/SpawnPackets1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/SpawnPackets1_9.java @@ -49,7 +49,7 @@ public class SpawnPackets1_9 { }; public static void register(Protocol1_8To1_9 protocol) { - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -104,7 +104,7 @@ public class SpawnPackets1_9 { int typeID = wrapper.get(Type.BYTE, 0); if (EntityTypes1_10.getTypeFromId(typeID, true) == EntityTypes1_10.EntityType.SPLASH_POTION) { // Convert this to meta data, woo! - PacketWrapper metaPacket = wrapper.create(ClientboundPackets1_9.ENTITY_METADATA, wrapper1 -> { + PacketWrapper metaPacket = wrapper.create(ClientboundPackets1_9.SET_ENTITY_DATA, wrapper1 -> { wrapper1.write(Type.VAR_INT, entityID); List meta = new ArrayList<>(); Item item = new DataItem(373, (byte) 1, (short) data, null); // Potion @@ -123,7 +123,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_EXPERIENCE_ORB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_EXPERIENCE_ORB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -143,7 +143,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_GLOBAL_ENTITY, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_GLOBAL_ENTITY, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -162,7 +162,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_MOB, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_MOB, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -216,7 +216,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_PAINTING, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_PAINTING, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -239,7 +239,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.SPAWN_PLAYER, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.ADD_PLAYER, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // 0 - Entity ID @@ -263,7 +263,7 @@ public class SpawnPackets1_9 { handler(wrapper -> { short item = wrapper.read(Type.SHORT); if (item != 0) { - PacketWrapper packet = PacketWrapper.create(ClientboundPackets1_9.ENTITY_EQUIPMENT, null, wrapper.user()); + PacketWrapper packet = PacketWrapper.create(ClientboundPackets1_9.SET_EQUIPPED_ITEM, null, wrapper.user()); packet.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0)); packet.write(Type.VAR_INT, 0); packet.write(Type.ITEM1_8, new DataItem(item, (byte) 1, (short) 0, null)); @@ -295,7 +295,7 @@ public class SpawnPackets1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.DESTROY_ENTITIES, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.REMOVE_ENTITIES, new PacketHandlers() { @Override public void register() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/WorldPacketRewriter1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/WorldPacketRewriter1_9.java index dd4cc40b4..cfb8f78d9 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/WorldPacketRewriter1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/rewriter/WorldPacketRewriter1_9.java @@ -65,7 +65,7 @@ public class WorldPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.EFFECT, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.LEVEL_EVENT, new PacketHandlers() { @Override public void register() { map(Type.INT); // 0 - Effect ID @@ -91,7 +91,7 @@ public class WorldPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.NAMED_SOUND, new PacketHandlers() { + protocol.registerClientbound(ClientboundPackets1_8.CUSTOM_SOUND, new PacketHandlers() { @Override public void register() { map(Type.STRING); // 0 - Sound Name @@ -123,7 +123,7 @@ public class WorldPacketRewriter1_9 { } }); - protocol.registerClientbound(ClientboundPackets1_8.CHUNK_DATA, wrapper -> { + protocol.registerClientbound(ClientboundPackets1_8.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); ClientChunks clientChunks = wrapper.user().get(ClientChunks.class); Chunk chunk = wrapper.read(ChunkType1_8.forEnvironment(clientWorld.getEnvironment())); @@ -132,7 +132,7 @@ public class WorldPacketRewriter1_9 { // Check if the chunk should be handled as an unload packet if (chunk.isFullChunk() && chunk.getBitmask() == 0) { - wrapper.setPacketType(ClientboundPackets1_9.UNLOAD_CHUNK); + wrapper.setPacketType(ClientboundPackets1_9.FORGET_LEVEL_CHUNK); wrapper.write(Type.INT, chunk.getX()); wrapper.write(Type.INT, chunk.getZ()); @@ -148,7 +148,7 @@ public class WorldPacketRewriter1_9 { int chunkX = chunk.getX() + face.modX(); int chunkZ = chunk.getZ() + face.modZ(); if (!clientChunks.getLoadedChunks().contains(ClientChunks.toLong(chunkX, chunkZ))) { - PacketWrapper unloadChunk = wrapper.create(ClientboundPackets1_9.UNLOAD_CHUNK); + PacketWrapper unloadChunk = wrapper.create(ClientboundPackets1_9.FORGET_LEVEL_CHUNK); unloadChunk.write(Type.INT, chunkX); unloadChunk.write(Type.INT, chunkZ); unloadChunk.send(Protocol1_8To1_9.class); @@ -167,7 +167,7 @@ public class WorldPacketRewriter1_9 { int chunkX = chunk.getX() + face.modX(); int chunkZ = chunk.getZ() + face.modZ(); if (!clientChunks.getLoadedChunks().contains(ClientChunks.toLong(chunkX, chunkZ))) { - PacketWrapper emptyChunk = wrapper.create(ClientboundPackets1_9.CHUNK_DATA); + PacketWrapper emptyChunk = wrapper.create(ClientboundPackets1_9.LEVEL_CHUNK); Chunk c = new BaseChunk(chunkX, chunkZ, true, false, 0, new ChunkSection[16], new int[256], new ArrayList<>()); emptyChunk.write(chunkType, c); emptyChunk.send(Protocol1_8To1_9.class); @@ -186,7 +186,7 @@ public class WorldPacketRewriter1_9 { Type chunkType = ChunkType1_9_1.forEnvironment(clientWorld.getEnvironment()); // Split into multiple chunk packets for (Chunk chunk : chunks) { - PacketWrapper chunkData = wrapper.create(ClientboundPackets1_9.CHUNK_DATA); + PacketWrapper chunkData = wrapper.create(ClientboundPackets1_9.LEVEL_CHUNK); chunkData.write(chunkType, chunk); chunkData.send(Protocol1_8To1_9.class); @@ -198,7 +198,7 @@ public class WorldPacketRewriter1_9 { int chunkX = chunk.getX() + face.modX(); int chunkZ = chunk.getZ() + face.modZ(); if (!clientChunks.getLoadedChunks().contains(ClientChunks.toLong(chunkX, chunkZ))) { - PacketWrapper emptyChunk = wrapper.create(ClientboundPackets1_9.CHUNK_DATA); + PacketWrapper emptyChunk = wrapper.create(ClientboundPackets1_9.LEVEL_CHUNK); Chunk c = new BaseChunk(chunkX, chunkZ, true, false, 0, new ChunkSection[16], new int[256], new ArrayList<>()); emptyChunk.write(chunkType, c); emptyChunk.send(Protocol1_8To1_9.class); @@ -245,7 +245,7 @@ public class WorldPacketRewriter1_9 { /* Incoming Packets */ - protocol.registerServerbound(ServerboundPackets1_9.UPDATE_SIGN, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.SIGN_UPDATE, new PacketHandlers() { @Override public void register() { map(Type.POSITION1_8); // 0 - Sign Position @@ -258,7 +258,7 @@ public class WorldPacketRewriter1_9 { } }); - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_DIGGING, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.PLAYER_ACTION, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // Action @@ -288,7 +288,7 @@ public class WorldPacketRewriter1_9 { int hand = wrapper.read(Type.VAR_INT); // Wipe the input buffer wrapper.clearInputBuffer(); - wrapper.setPacketType(ServerboundPackets1_8.PLAYER_BLOCK_PLACEMENT); + wrapper.setPacketType(ServerboundPackets1_8.USE_ITEM_ON); wrapper.write(Type.POSITION1_8, new Position(-1, (short) -1, -1)); wrapper.write(Type.UNSIGNED_BYTE, (short) 255); // Write item in hand @@ -339,7 +339,7 @@ public class WorldPacketRewriter1_9 { wrapper.write(Type.UNSIGNED_BYTE, (short) 0); }); - protocol.registerServerbound(ServerboundPackets1_9.PLAYER_BLOCK_PLACEMENT, new PacketHandlers() { + protocol.registerServerbound(ServerboundPackets1_9.USE_ITEM_ON, new PacketHandlers() { @Override public void register() { map(Type.POSITION1_8); // 0 - Position diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/storage/EntityTracker1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/storage/EntityTracker1_9.java index f2b57f6f2..3cda27c64 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/storage/EntityTracker1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_8to1_9/storage/EntityTracker1_9.java @@ -86,7 +86,7 @@ public class EntityTracker1_9 extends EntityTrackerBase { } public void setSecondHand(int entityID, Item item) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_EQUIPMENT, null, user()); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.SET_EQUIPPED_ITEM, null, user()); wrapper.write(Type.VAR_INT, entityID); wrapper.write(Type.VAR_INT, 1); // slot wrapper.write(Type.ITEM1_8, this.itemInSecondHand = item); @@ -212,7 +212,7 @@ public class EntityTracker1_9 extends EntityTrackerBase { if (!knownHolograms.contains(entityId)) { knownHolograms.add(entityId); // Send movement - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_POSITION, null, user()); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.MOVE_ENTITY_POS, null, user()); wrapper.write(Type.VAR_INT, entityId); wrapper.write(Type.SHORT, (short) 0); wrapper.write(Type.SHORT, (short) (128D * (Via.getConfig().getHologramYOffset() * 32D))); @@ -272,7 +272,7 @@ public class EntityTracker1_9 extends EntityTrackerBase { } public void sendTeamPacket(boolean add, boolean now) { - PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.TEAMS, null, user()); + PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.SET_PLAYER_TEAM, null, user()); wrapper.write(Type.STRING, "viaversion"); // Use viaversion as name if (add) { // add diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_1to1_9_3/Protocol1_9_1To1_9_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_1to1_9_3/Protocol1_9_1To1_9_3.java index 670742ffc..0ba5083ca 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_1to1_9_3/Protocol1_9_1To1_9_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_1to1_9_3/Protocol1_9_1To1_9_3.java @@ -86,7 +86,7 @@ public class Protocol1_9_1To1_9_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_9.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); Chunk chunk = wrapper.read(ChunkType1_9_1.forEnvironment(clientWorld.getEnvironment())); @@ -112,7 +112,7 @@ public class Protocol1_9_1To1_9_3 extends AbstractProtocol { + registerClientbound(ClientboundPackets1_9_3.LEVEL_CHUNK, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); Chunk chunk = wrapper.passthrough(ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment())); @@ -205,7 +205,7 @@ public class Protocol1_9_3To1_10 extends AbstractProtocol { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_3to1_10/rewriter/ItemPacketRewriter1_10.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_3to1_10/rewriter/ItemPacketRewriter1_10.java index d1724dea1..1dcfd704e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_3to1_10/rewriter/ItemPacketRewriter1_10.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_9_3to1_10/rewriter/ItemPacketRewriter1_10.java @@ -33,7 +33,7 @@ public class ItemPacketRewriter1_10 extends ItemRewriter soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_20_5.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_20_5.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_5.SOUND_ENTITY); - new StatisticsRewriter<>(this).register(ClientboundPackets1_20_5.STATISTICS); - new AttributeRewriter<>(this).register1_20_5(ClientboundPackets1_20_5.ENTITY_PROPERTIES); + new StatisticsRewriter<>(this).register(ClientboundPackets1_20_5.AWARD_STATS); + new AttributeRewriter<>(this).register1_20_5(ClientboundPackets1_20_5.UPDATE_ATTRIBUTES); // Uncomment if an existing type changed serialization format. Mappings for argument type keys can also be defined in mapping files /*final CommandRewriter1_19_4 commandRewriter = new CommandRewriter1_19_4(this) { diff --git a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java index b1e00af18..705c9ef8c 100644 --- a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java +++ b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java @@ -43,29 +43,29 @@ public final class BlockItemPacketRewriter1_99 extends StructuredItemRewriter blockRewriter = BlockRewriter.for1_20_2(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_20_5.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_20_5.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_5.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_20_5.EFFECT, 1010, 2001); - blockRewriter.registerChunkData1_19(ClientboundPackets1_20_5.CHUNK_DATA, ChunkType1_20_2::new); + blockRewriter.registerBlockAction(ClientboundPackets1_20_5.BLOCK_EVENT); + blockRewriter.registerBlockChange(ClientboundPackets1_20_5.BLOCK_UPDATE); + blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_5.SECTION_BLOCKS_UPDATE); + blockRewriter.registerEffect(ClientboundPackets1_20_5.LEVEL_EVENT, 1010, 2001); + blockRewriter.registerChunkData1_19(ClientboundPackets1_20_5.LEVEL_CHUNK_WITH_LIGHT, ChunkType1_20_2::new); blockRewriter.registerBlockEntityData(ClientboundPackets1_20_5.BLOCK_ENTITY_DATA); // Registers item id changes // Other places using item ids are: Entity metadata, tags, statistics, effect // registerOpenWindow(ClientboundPackets1_20_5.OPEN_WINDOW); - If a new container type was added registerSetCooldown(ClientboundPackets1_20_5.COOLDOWN); - registerWindowItems1_17_1(ClientboundPackets1_20_5.WINDOW_ITEMS); - registerSetSlot1_17_1(ClientboundPackets1_20_5.SET_SLOT); - registerAdvancements1_20_3(ClientboundPackets1_20_5.ADVANCEMENTS); - registerEntityEquipmentArray(ClientboundPackets1_20_5.ENTITY_EQUIPMENT); - registerClickWindow1_17_1(ServerboundPackets1_20_5.CLICK_WINDOW); - registerTradeList1_20_5(ClientboundPackets1_20_5.TRADE_LIST, Types1_20_5.ITEM_COST, Types1_20_5.ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST); - registerCreativeInvAction(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION); - registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.WINDOW_PROPERTY); - registerSpawnParticle1_20_5(ClientboundPackets1_20_5.SPAWN_PARTICLE, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); - registerExplosion(ClientboundPackets1_20_5.EXPLOSION, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); // Rewrites the included sound and particles + registerWindowItems1_17_1(ClientboundPackets1_20_5.CONTAINER_SET_CONTENT); + registerSetSlot1_17_1(ClientboundPackets1_20_5.CONTAINER_SET_SLOT); + registerAdvancements1_20_3(ClientboundPackets1_20_5.UPDATE_ADVANCEMENTS); + registerEntityEquipmentArray(ClientboundPackets1_20_5.SET_EQUIPMENT); + registerClickWindow1_17_1(ServerboundPackets1_20_5.CONTAINER_CLICK); + registerTradeList1_20_5(ClientboundPackets1_20_5.MERCHANT_OFFERS, Types1_20_5.ITEM_COST, Types1_20_5.ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST); + registerCreativeInvAction(ServerboundPackets1_20_5.SET_CREATIVE_MODE_SLOT); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.CONTAINER_SET_DATA); + registerSpawnParticle1_20_5(ClientboundPackets1_20_5.LEVEL_PARTICLES, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); + registerExplosion(ClientboundPackets1_20_5.EXPLODE, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); // Rewrites the included sound and particles - new RecipeRewriter1_20_3<>(protocol).register1_20_5(ClientboundPackets1_20_5.DECLARE_RECIPES); + new RecipeRewriter1_20_3<>(protocol).register1_20_5(ClientboundPackets1_20_5.UPDATE_RECIPES); // OR do this if serialization of recipes changed and override the relevant method // Add new serializers to RecipeRewriter, or extend the last one for changes // new RecipeRewriter1_20_3(this) {}.register1_20_5(ClientboundPackets1_20_5.DECLARE_RECIPES); diff --git a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java index 5005e7711..d027b9b29 100644 --- a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java +++ b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java @@ -40,8 +40,8 @@ public final class EntityPacketRewriter1_99 extends EntityRewriter { + filter().type(EntityTypes1_20_5.ABSTRACT_MINECART).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); });