Packet and entity type renames

Use Mojang mapped names for packet types to be consistent with functionality and easy to look up
This commit is contained in:
Nassim Jahnke 2024-05-11 16:08:02 +02:00
parent e965e97139
commit 501f65e216
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
149 changed files with 3497 additions and 3496 deletions

View File

@ -43,26 +43,26 @@ public enum EntityTypes1_14 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -75,61 +75,61 @@ public enum EntityTypes1_14 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // 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), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -147,25 +147,25 @@ public enum EntityTypes1_14 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -197,12 +197,12 @@ public enum EntityTypes1_14 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -43,26 +43,26 @@ public enum EntityTypes1_15 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -75,61 +75,61 @@ public enum EntityTypes1_15 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // 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), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -148,25 +148,25 @@ public enum EntityTypes1_15 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -198,12 +198,12 @@ public enum EntityTypes1_15 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -43,26 +43,26 @@ public enum EntityTypes1_16 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -75,61 +75,61 @@ public enum EntityTypes1_16 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // 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), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -150,25 +150,25 @@ public enum EntityTypes1_16 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -202,12 +202,12 @@ public enum EntityTypes1_16 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -43,26 +43,26 @@ public enum EntityTypes1_16_2 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -75,61 +75,61 @@ public enum EntityTypes1_16_2 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // 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), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -150,25 +150,25 @@ public enum EntityTypes1_16_2 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -205,12 +205,12 @@ public enum EntityTypes1_16_2 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -44,27 +44,27 @@ public enum EntityTypes1_17 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -77,63 +77,63 @@ public enum EntityTypes1_17 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // 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), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -156,25 +156,25 @@ public enum EntityTypes1_17 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -211,12 +211,12 @@ public enum EntityTypes1_17 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -44,27 +44,27 @@ public enum EntityTypes1_19 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -77,66 +77,66 @@ public enum EntityTypes1_19 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHEST_BOAT(BOAT), CHEST_BOAT(BOAT),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // Pathfinder mobs and its subclasses
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), PATHFINDER_MOB(MOB, null),
ALLAY(ABSTRACT_CREATURE), ALLAY(PATHFINDER_MOB),
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), ABSTRACT_GOLEM(PATHFINDER_MOB, null),
SNOW_GOLEM(ABSTRACT_GOLEM), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
TADPOLE(ABSTRACT_FISHES), TADPOLE(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -160,25 +160,25 @@ public enum EntityTypes1_19 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
SKELETON_HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE),
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -216,12 +216,12 @@ public enum EntityTypes1_19 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -44,27 +44,27 @@ public enum EntityTypes1_19_3 implements EntityType {
LIGHTNING_BOLT(ENTITY), LIGHTNING_BOLT(ENTITY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -77,66 +77,66 @@ public enum EntityTypes1_19_3 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHEST_BOAT(BOAT), CHEST_BOAT(BOAT),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // Pathfinder mobs and its subclasses
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), PATHFINDER_MOB(MOB, null),
ALLAY(ABSTRACT_CREATURE), ALLAY(PATHFINDER_MOB),
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), ABSTRACT_GOLEM(PATHFINDER_MOB, null),
SNOW_GOLEM(ABSTRACT_GOLEM), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
TADPOLE(ABSTRACT_FISHES), TADPOLE(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -160,11 +160,11 @@ public enum EntityTypes1_19_3 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
@ -172,14 +172,14 @@ public enum EntityTypes1_19_3 implements EntityType {
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CAMEL(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -217,12 +217,12 @@ public enum EntityTypes1_19_3 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -50,27 +50,27 @@ public enum EntityTypes1_19_4 implements EntityType {
TEXT_DISPLAY(DISPLAY), TEXT_DISPLAY(DISPLAY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -83,66 +83,66 @@ public enum EntityTypes1_19_4 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHEST_BOAT(BOAT), CHEST_BOAT(BOAT),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // Pathfinder mobs and its subclasses
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), PATHFINDER_MOB(MOB, null),
ALLAY(ABSTRACT_CREATURE), ALLAY(PATHFINDER_MOB),
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), ABSTRACT_GOLEM(PATHFINDER_MOB, null),
SNOW_GOLEM(ABSTRACT_GOLEM), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
TADPOLE(ABSTRACT_FISHES), TADPOLE(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -167,11 +167,11 @@ public enum EntityTypes1_19_4 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
@ -179,14 +179,14 @@ public enum EntityTypes1_19_4 implements EntityType {
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CAMEL(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -224,12 +224,12 @@ public enum EntityTypes1_19_4 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -50,28 +50,28 @@ public enum EntityTypes1_20_3 implements EntityType {
TEXT_DISPLAY(DISPLAY), TEXT_DISPLAY(DISPLAY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
WIND_CHARGE(PROJECTILE_ABSTRACT), WIND_CHARGE(PROJECTILE),
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -84,66 +84,66 @@ public enum EntityTypes1_20_3 implements EntityType {
VEHICLE(ENTITY, null), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHEST_BOAT(BOAT), CHEST_BOAT(BOAT),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // Pathfinder mobs and its subclasses
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), PATHFINDER_MOB(MOB, null),
ALLAY(ABSTRACT_CREATURE), ALLAY(PATHFINDER_MOB),
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), ABSTRACT_GOLEM(PATHFINDER_MOB, null),
SNOW_GOLEM(ABSTRACT_GOLEM), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
TADPOLE(ABSTRACT_FISHES), TADPOLE(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -168,11 +168,11 @@ public enum EntityTypes1_20_3 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
@ -180,14 +180,14 @@ public enum EntityTypes1_20_3 implements EntityType {
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CAMEL(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -226,12 +226,12 @@ public enum EntityTypes1_20_3 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -51,27 +51,27 @@ public enum EntityTypes1_20_5 implements EntityType {
TEXT_DISPLAY(DISPLAY), TEXT_DISPLAY(DISPLAY),
// Hanging entities // Hanging entities
ABSTRACT_HANGING(ENTITY, null), HANGING_ENTITY(ENTITY, null),
LEASH_KNOT(ABSTRACT_HANGING), LEASH_KNOT(HANGING_ENTITY),
PAINTING(ABSTRACT_HANGING), PAINTING(HANGING_ENTITY),
ITEM_FRAME(ABSTRACT_HANGING), ITEM_FRAME(HANGING_ENTITY),
GLOW_ITEM_FRAME(ITEM_FRAME), GLOW_ITEM_FRAME(ITEM_FRAME),
// Projectiles // Projectiles
PROJECTILE_ABSTRACT(ENTITY, null), // Not actually its own abstract type, but useful for categorizing PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
SNOWBALL(PROJECTILE_ABSTRACT), SNOWBALL(PROJECTILE),
ENDER_PEARL(PROJECTILE_ABSTRACT), ENDER_PEARL(PROJECTILE),
EGG(PROJECTILE_ABSTRACT), EGG(PROJECTILE),
POTION(PROJECTILE_ABSTRACT), POTION(PROJECTILE),
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE),
FIREWORK_ROCKET(PROJECTILE_ABSTRACT), FIREWORK_ROCKET(PROJECTILE),
LLAMA_SPIT(PROJECTILE_ABSTRACT), LLAMA_SPIT(PROJECTILE),
SHULKER_BULLET(PROJECTILE_ABSTRACT), SHULKER_BULLET(PROJECTILE),
FISHING_BOBBER(PROJECTILE_ABSTRACT), FISHING_BOBBER(PROJECTILE),
WITHER_SKULL(PROJECTILE_ABSTRACT), WITHER_SKULL(PROJECTILE),
DRAGON_FIREBALL(PROJECTILE_ABSTRACT), // Doesn't actually inherit fireball DRAGON_FIREBALL(PROJECTILE), // Doesn't actually inherit fireball
ABSTRACT_ARROW(PROJECTILE_ABSTRACT, null), ABSTRACT_ARROW(PROJECTILE, null),
ARROW(ABSTRACT_ARROW), ARROW(ABSTRACT_ARROW),
SPECTRAL_ARROW(ABSTRACT_ARROW), SPECTRAL_ARROW(ABSTRACT_ARROW),
TRIDENT(ABSTRACT_ARROW), TRIDENT(ABSTRACT_ARROW),
@ -80,7 +80,7 @@ public enum EntityTypes1_20_5 implements EntityType {
FIREBALL(ABSTRACT_FIREBALL), FIREBALL(ABSTRACT_FIREBALL),
SMALL_FIREBALL(ABSTRACT_FIREBALL), SMALL_FIREBALL(ABSTRACT_FIREBALL),
ABSTRACT_WIND_CHARGE(PROJECTILE_ABSTRACT, null), ABSTRACT_WIND_CHARGE(PROJECTILE, null),
WIND_CHARGE(ABSTRACT_WIND_CHARGE), WIND_CHARGE(ABSTRACT_WIND_CHARGE),
BREEZE_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), VEHICLE(ENTITY, null),
BOAT(VEHICLE), BOAT(VEHICLE),
MINECART_ABSTRACT(VEHICLE, null), ABSTRACT_MINECART(VEHICLE, null),
MINECART(MINECART_ABSTRACT), MINECART(ABSTRACT_MINECART),
FURNACE_MINECART(MINECART_ABSTRACT), FURNACE_MINECART(ABSTRACT_MINECART),
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT), COMMAND_BLOCK_MINECART(ABSTRACT_MINECART),
TNT_MINECART(MINECART_ABSTRACT), TNT_MINECART(ABSTRACT_MINECART),
SPAWNER_MINECART(MINECART_ABSTRACT), SPAWNER_MINECART(ABSTRACT_MINECART),
CHEST_BOAT(BOAT), CHEST_BOAT(BOAT),
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null), ABSTRACT_MINECART_CONTAINER(ABSTRACT_MINECART, null),
CHEST_MINECART(CHESTED_MINECART_ABSTRACT), CHEST_MINECART(ABSTRACT_MINECART_CONTAINER),
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT), HOPPER_MINECART(ABSTRACT_MINECART_CONTAINER),
// Living entities as a larger subclass // Living entities as a larger subclass
LIVINGENTITY(ENTITY, null), LIVING_ENTITY(ENTITY, null),
ARMOR_STAND(LIVINGENTITY), ARMOR_STAND(LIVING_ENTITY),
PLAYER(LIVINGENTITY), PLAYER(LIVING_ENTITY),
// Mobs as a larger subclass // Mobs as a larger subclass
ABSTRACT_INSENTIENT(LIVINGENTITY, null), MOB(LIVING_ENTITY, null),
ENDER_DRAGON(ABSTRACT_INSENTIENT), ENDER_DRAGON(MOB),
SLIME(ABSTRACT_INSENTIENT), SLIME(MOB),
MAGMA_CUBE(SLIME), MAGMA_CUBE(SLIME),
// Ambient mobs // Ambient mobs
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null), AMBIENT_CREATURE(MOB, null),
BAT(ABSTRACT_AMBIENT), BAT(AMBIENT_CREATURE),
// Flying mobs // Flying mobs
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null), FLYING_MOB(MOB, null),
GHAST(ABSTRACT_FLYING), GHAST(FLYING_MOB),
PHANTOM(ABSTRACT_FLYING), PHANTOM(FLYING_MOB),
// Pathfinder mobs and its subclasses // Pathfinder mobs and its subclasses
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null), PATHFINDER_MOB(MOB, null),
ALLAY(ABSTRACT_CREATURE), ALLAY(PATHFINDER_MOB),
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null), ABSTRACT_GOLEM(PATHFINDER_MOB, null),
SNOW_GOLEM(ABSTRACT_GOLEM), SNOW_GOLEM(ABSTRACT_GOLEM),
IRON_GOLEM(ABSTRACT_GOLEM), IRON_GOLEM(ABSTRACT_GOLEM),
SHULKER(ABSTRACT_GOLEM), SHULKER(ABSTRACT_GOLEM),
// Water mobs // Water mobs
ABSTRACT_WATERMOB(ABSTRACT_CREATURE, null), WATER_ANIMAL(PATHFINDER_MOB, null),
DOLPHIN(ABSTRACT_WATERMOB), DOLPHIN(WATER_ANIMAL),
SQUID(ABSTRACT_WATERMOB), SQUID(WATER_ANIMAL),
GLOW_SQUID(SQUID), GLOW_SQUID(SQUID),
ABSTRACT_FISHES(ABSTRACT_WATERMOB, null), ABSTRACT_FISH(WATER_ANIMAL, null),
PUFFERFISH(ABSTRACT_FISHES), PUFFERFISH(ABSTRACT_FISH),
TADPOLE(ABSTRACT_FISHES), TADPOLE(ABSTRACT_FISH),
ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISHES, null), ABSTRACT_SCHOOLING_FISH(ABSTRACT_FISH, null),
COD(ABSTRACT_SCHOOLING_FISH), COD(ABSTRACT_SCHOOLING_FISH),
SALMON(ABSTRACT_SCHOOLING_FISH), SALMON(ABSTRACT_SCHOOLING_FISH),
TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH), TROPICAL_FISH(ABSTRACT_SCHOOLING_FISH),
// Ageable mobs and (tamable) animals // Ageable mobs and (tamable) animals
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null), ABSTRACT_AGEABLE(PATHFINDER_MOB, null),
ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null), ABSTRACT_VILLAGER(ABSTRACT_AGEABLE, null),
VILLAGER(ABSTRACT_VILLAGER), VILLAGER(ABSTRACT_VILLAGER),
WANDERING_TRADER(ABSTRACT_VILLAGER), WANDERING_TRADER(ABSTRACT_VILLAGER),
@ -173,11 +173,11 @@ public enum EntityTypes1_20_5 implements EntityType {
COW(ABSTRACT_ANIMAL), COW(ABSTRACT_ANIMAL),
MOOSHROOM(COW), MOOSHROOM(COW),
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null), TAMABLE_ANIMAL(ABSTRACT_ANIMAL, null),
CAT(ABSTRACT_TAMEABLE_ANIMAL), CAT(TAMABLE_ANIMAL),
OCELOT(ABSTRACT_TAMEABLE_ANIMAL), OCELOT(TAMABLE_ANIMAL),
WOLF(ABSTRACT_TAMEABLE_ANIMAL), WOLF(TAMABLE_ANIMAL),
PARROT(ABSTRACT_TAMEABLE_ANIMAL), PARROT(TAMABLE_ANIMAL),
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null), ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
HORSE(ABSTRACT_HORSE), HORSE(ABSTRACT_HORSE),
@ -185,14 +185,14 @@ public enum EntityTypes1_20_5 implements EntityType {
ZOMBIE_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE),
CAMEL(ABSTRACT_HORSE), CAMEL(ABSTRACT_HORSE),
CHESTED_HORSE(ABSTRACT_HORSE, null), ABSTRACT_CHESTED_HORSE(ABSTRACT_HORSE, null),
DONKEY(CHESTED_HORSE), DONKEY(ABSTRACT_CHESTED_HORSE),
MULE(CHESTED_HORSE), MULE(ABSTRACT_CHESTED_HORSE),
LLAMA(CHESTED_HORSE), LLAMA(ABSTRACT_CHESTED_HORSE),
TRADER_LLAMA(LLAMA), TRADER_LLAMA(LLAMA),
// Monsters // Monsters
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null), ABSTRACT_MONSTER(PATHFINDER_MOB, null),
BLAZE(ABSTRACT_MONSTER), BLAZE(ABSTRACT_MONSTER),
CREEPER(ABSTRACT_MONSTER), CREEPER(ABSTRACT_MONSTER),
ENDERMITE(ABSTRACT_MONSTER), ENDERMITE(ABSTRACT_MONSTER),
@ -232,12 +232,12 @@ public enum EntityTypes1_20_5 implements EntityType {
WITCH(ABSTRACT_RAIDER), WITCH(ABSTRACT_RAIDER),
RAVAGER(ABSTRACT_RAIDER), RAVAGER(ABSTRACT_RAIDER),
ABSTRACT_ILLAGER_BASE(ABSTRACT_RAIDER, null), ABSTRACT_ILLAGER(ABSTRACT_RAIDER, null),
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null), SPELLCASTER_ILLAGER(ABSTRACT_ILLAGER, null),
VINDICATOR(ABSTRACT_ILLAGER_BASE), VINDICATOR(ABSTRACT_ILLAGER),
PILLAGER(ABSTRACT_ILLAGER_BASE), PILLAGER(ABSTRACT_ILLAGER),
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER), EVOKER(SPELLCASTER_ILLAGER),
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER); ILLUSIONER(SPELLCASTER_ILLAGER);
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values()); private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
private final EntityType parent; private final EntityType parent;

View File

@ -59,7 +59,7 @@ public class ArmorListener extends ViaBukkitListener {
armor += ArmorType.findById(stack.getTypeId()).getArmorPoints(); 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.VAR_INT, player.getEntityId()); // Player ID
wrapper.write(Type.INT, 1); // only 1 property wrapper.write(Type.INT, 1); // only 1 property
wrapper.write(Type.STRING, "generic.armor"); wrapper.write(Type.STRING, "generic.armor");

View File

@ -59,7 +59,7 @@ public class DeathListener extends ViaBukkitListener {
// If online // If online
UserConnection userConnection = getUserConnection(p); UserConnection userConnection = getUserConnection(p);
if (userConnection != null) { if (userConnection != null) {
PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.COMBAT_EVENT, userConnection); PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.PLAYER_COMBAT, userConnection);
try { try {
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID

View File

@ -55,7 +55,7 @@ public class EntityToggleGlideListener extends ViaBukkitListener {
// Cancelling can only be done by updating the player's metadata // Cancelling can only be done by updating the player's metadata
if (event.isGliding() && event.isCancelled()) { 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()); packet.write(Type.VAR_INT, player.getEntityId());
byte bitmask = 0; byte bitmask = 0;

View File

@ -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. // 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)) { if (user.getProtocolInfo().getPipeline().contains(Protocol1_8To1_9.class)) {
for (UUID uuid : storage.getBossbar()) { 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.UUID, uuid);
wrapper.write(Type.VAR_INT, 1); // remove wrapper.write(Type.VAR_INT, 1); // remove
wrapper.send(Protocol1_8To1_9.class); wrapper.send(Protocol1_8To1_9.class);

View File

@ -48,7 +48,7 @@ public class ElytraPatch implements Listener {
EntityTracker1_9 tracker = user.getEntityTracker(Protocol1_8To1_9.class); EntityTracker1_9 tracker = user.getEntityTracker(Protocol1_8To1_9.class);
int entityId = tracker.getProvidedEntityId(); 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(Type.VAR_INT, entityId);
wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0))); wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));

View File

@ -241,7 +241,7 @@ public class CommonBoss implements BossBar {
private PacketWrapper getPacket(UpdateAction action, UserConnection connection) { private PacketWrapper getPacket(UpdateAction action, UserConnection connection) {
try { 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.UUID, uuid);
wrapper.write(Type.VAR_INT, action.getId()); wrapper.write(Type.VAR_INT, action.getId());
switch (action) { switch (action) {

View File

@ -61,7 +61,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
protected void registerPackets() { protected void registerPackets() {
super.registerPackets(); super.registerPackets();
registerClientbound(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.ADD_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id map(Type.VAR_INT); // 0 - Entity id
@ -73,7 +73,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
registerClientbound(ClientboundPackets1_9_3.SPAWN_MOB, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.ADD_MOB, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -109,7 +109,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
new SoundRewriter<>(this, this::getNewSoundId).registerSound(ClientboundPackets1_9_3.SOUND); new SoundRewriter<>(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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Collected entity id map(Type.VAR_INT); // 0 - Collected entity id
@ -121,9 +121,9 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
entityRewriter.registerMetadataRewriter(ClientboundPackets1_9_3.ENTITY_METADATA, Types1_9.METADATA_LIST); entityRewriter.registerMetadataRewriter(ClientboundPackets1_9_3.SET_ENTITY_DATA, Types1_9.METADATA_LIST);
registerClientbound(ClientboundPackets1_9_3.ENTITY_TELEPORT, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.TELEPORT_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id map(Type.VAR_INT); // 0 - Entity id
@ -148,9 +148,9 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
entityRewriter.registerRemoveEntities(ClientboundPackets1_9_3.DESTROY_ENTITIES); entityRewriter.registerRemoveEntities(ClientboundPackets1_9_3.REMOVE_ENTITIES);
registerClientbound(ClientboundPackets1_9_3.TITLE, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.SET_TITLES, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Action map(Type.VAR_INT); // 0 - Action
@ -166,7 +166,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
registerClientbound(ClientboundPackets1_9_3.BLOCK_ACTION, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.BLOCK_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_8); // 0 - Position map(Type.POSITION1_8); // 0 - Position
@ -208,7 +208,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
registerClientbound(ClientboundPackets1_9_3.CHUNK_DATA, wrapper -> { registerClientbound(ClientboundPackets1_9_3.LEVEL_CHUNK, wrapper -> {
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
Chunk chunk = wrapper.passthrough(ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment())); Chunk chunk = wrapper.passthrough(ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment()));
@ -230,7 +230,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
registerClientbound(ClientboundPackets1_9_3.JOIN_GAME, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // 0 - Entity ID map(Type.INT); // 0 - Entity ID
@ -255,7 +255,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
this.registerClientbound(ClientboundPackets1_9_3.EFFECT, new PacketHandlers() { this.registerClientbound(ClientboundPackets1_9_3.LEVEL_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
this.map(Type.INT); //effectID this.map(Type.INT); //effectID
@ -288,7 +288,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
INCOMING PACKETS INCOMING PACKETS
*/ */
registerServerbound(ServerboundPackets1_9_3.PLAYER_BLOCK_PLACEMENT, new PacketHandlers() { registerServerbound(ServerboundPackets1_9_3.USE_ITEM_ON, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_8); // 0 - Location map(Type.POSITION1_8); // 0 - Location
@ -301,7 +301,7 @@ public class Protocol1_10To1_11 extends AbstractProtocol<ClientboundPackets1_9_3
} }
}); });
registerServerbound(ServerboundPackets1_9_3.CHAT_MESSAGE, new PacketHandlers() { registerServerbound(ServerboundPackets1_9_3.CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Message map(Type.STRING); // 0 - Message

View File

@ -113,7 +113,7 @@ public class MetadataRewriter1_11To1_10 extends EntityRewriter<ClientboundPacket
int entityId = event.entityId(); int entityId = event.entityId();
if (tracker.addHologram(entityId)) { if (tracker.addHologram(entityId)) {
// Send movement // Send movement
PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9_3.ENTITY_POSITION, null, event.user()); PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9_3.MOVE_ENTITY_POS, null, event.user());
wrapper.write(Type.VAR_INT, entityId); wrapper.write(Type.VAR_INT, entityId);
wrapper.write(Type.SHORT, (short) 0); wrapper.write(Type.SHORT, (short) 0);
wrapper.write(Type.SHORT, (short) (128D * (-Via.getConfig().getHologramYOffset() * 32D))); wrapper.write(Type.SHORT, (short) (128D * (-Via.getConfig().getHologramYOffset() * 32D)));

View File

@ -35,12 +35,12 @@ public class ItemPacketRewriter1_11 extends ItemRewriter<ClientboundPackets1_9_3
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetSlot(ClientboundPackets1_9_3.SET_SLOT); registerSetSlot(ClientboundPackets1_9_3.CONTAINER_SET_SLOT);
registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_9_3.CONTAINER_SET_CONTENT);
registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT); registerEntityEquipment(ClientboundPackets1_9_3.SET_EQUIPPED_ITEM);
// Plugin message Packet -> Trading // Plugin message Packet -> Trading
protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_9_3.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Channel map(Type.STRING); // 0 - Channel
@ -67,8 +67,8 @@ public class ItemPacketRewriter1_11 extends ItemRewriter<ClientboundPackets1_9_3
} }
}); });
registerClickWindow(ServerboundPackets1_9_3.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_9_3.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_9_3.SET_CREATIVE_MODE_SLOT);
} }
@Override @Override

View File

@ -64,7 +64,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
protected void registerPackets() { protected void registerPackets() {
super.registerPackets(); super.registerPackets();
registerClientbound(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.ADD_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id map(Type.VAR_INT); // 0 - Entity id
@ -76,7 +76,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
} }
}); });
registerClientbound(ClientboundPackets1_9_3.SPAWN_MOB, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.ADD_MOB, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -98,7 +98,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
} }
}); });
registerClientbound(ClientboundPackets1_9_3.CHAT_MESSAGE, wrapper -> { registerClientbound(ClientboundPackets1_9_3.CHAT, wrapper -> {
if (!Via.getConfig().is1_12NBTArrayFix()) return; if (!Via.getConfig().is1_12NBTArrayFix()) return;
final JsonElement element = wrapper.passthrough(Type.COMPONENT); final JsonElement element = wrapper.passthrough(Type.COMPONENT);
TranslateRewriter.toClient(wrapper.user(), element); TranslateRewriter.toClient(wrapper.user(), element);
@ -107,7 +107,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
wrapper.set(Type.COMPONENT, 0, element); wrapper.set(Type.COMPONENT, 0, element);
}); });
registerClientbound(ClientboundPackets1_9_3.CHUNK_DATA, wrapper -> { registerClientbound(ClientboundPackets1_9_3.LEVEL_CHUNK, wrapper -> {
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
ChunkType1_9_3 type = ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment()); ChunkType1_9_3 type = ChunkType1_9_3.forEnvironment(clientWorld.getEnvironment());
@ -137,10 +137,10 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
} }
}); });
metadataRewriter.registerRemoveEntities(ClientboundPackets1_9_3.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_9_3.REMOVE_ENTITIES);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_9_3.ENTITY_METADATA, Types1_12.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_9_3.SET_ENTITY_DATA, Types1_12.METADATA_LIST);
registerClientbound(ClientboundPackets1_9_3.JOIN_GAME, new PacketHandlers() { registerClientbound(ClientboundPackets1_9_3.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); map(Type.INT);
@ -154,7 +154,7 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
// Reset recipes // Reset recipes
if (user.getProtocolInfo().protocolVersion().newerThanOrEqualTo(ProtocolVersion.v1_13)) { if (user.getProtocolInfo().protocolVersion().newerThanOrEqualTo(ProtocolVersion.v1_13)) {
wrapper.create(ClientboundPackets1_13.DECLARE_RECIPES, packetWrapper -> 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); .scheduleSend(Protocol1_12_2To1_13.class);
} }
}); });
@ -176,10 +176,10 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
// New packet at 0x01 // New packet at 0x01
cancelServerbound(ServerboundPackets1_12.PREPARE_CRAFTING_GRID); cancelServerbound(ServerboundPackets1_12.CRAFTING_RECIPE_PLACEMENT);
// Client Settings (max length changed) // Client Settings (max length changed)
registerServerbound(ServerboundPackets1_12.CLIENT_SETTINGS, new PacketHandlers() { registerServerbound(ServerboundPackets1_12.CLIENT_INFORMATION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Locale map(Type.STRING); // 0 - Locale
@ -207,10 +207,10 @@ public class Protocol1_11_1To1_12 extends AbstractProtocol<ClientboundPackets1_9
}); });
// New packet at 0x17 // New packet at 0x17
cancelServerbound(ServerboundPackets1_12.RECIPE_BOOK_DATA); cancelServerbound(ServerboundPackets1_12.RECIPE_BOOK_UPDATE);
// New packet 0x19 // New packet 0x19
cancelServerbound(ServerboundPackets1_12.ADVANCEMENT_TAB); cancelServerbound(ServerboundPackets1_12.SEEN_ADVANCEMENTS);
} }
private int getNewSoundId(int id) { private int getNewSoundId(int id) {

View File

@ -21,85 +21,85 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_12 implements ClientboundPacketType { public enum ClientboundPackets1_12 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
TAB_COMPLETE, // 0x0E COMMAND_SUGGESTIONS, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
MULTI_BLOCK_CHANGE, // 0x10 CHUNK_BLOCKS_UPDATE, // 0x10
WINDOW_CONFIRMATION, // 0x11 CONTAINER_ACK, // 0x11
CLOSE_WINDOW, // 0x12 CONTAINER_CLOSE, // 0x12
OPEN_WINDOW, // 0x13 OPEN_SCREEN, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
KEEP_ALIVE, // 0x1F KEEP_ALIVE, // 0x1F
CHUNK_DATA, // 0x20 LEVEL_CHUNK, // 0x20
EFFECT, // 0x21 LEVEL_EVENT, // 0x21
SPAWN_PARTICLE, // 0x22 LEVEL_PARTICLES, // 0x22
JOIN_GAME, // 0x23 LOGIN, // 0x23
MAP_DATA, // 0x24 MAP_ITEM_DATA, // 0x24
ENTITY_MOVEMENT, // 0x25 MOVE_ENTITY, // 0x25
ENTITY_POSITION, // 0x26 MOVE_ENTITY_POS, // 0x26
ENTITY_POSITION_AND_ROTATION, // 0x27 MOVE_ENTITY_POS_ROT, // 0x27
ENTITY_ROTATION, // 0x28 MOVE_ENTITY_ROT, // 0x28
VEHICLE_MOVE, // 0x29 MOVE_VEHICLE, // 0x29
OPEN_SIGN_EDITOR, // 0x2A OPEN_SIGN_EDITOR, // 0x2A
PLAYER_ABILITIES, // 0x2B PLAYER_ABILITIES, // 0x2B
COMBAT_EVENT, // 0x2C PLAYER_COMBAT, // 0x2C
PLAYER_INFO, // 0x2D PLAYER_INFO, // 0x2D
PLAYER_POSITION, // 0x2E PLAYER_POSITION, // 0x2E
USE_BED, // 0x2F PLAYER_SLEEP, // 0x2F
UNLOCK_RECIPES, // 0x30 RECIPE, // 0x30
DESTROY_ENTITIES, // 0x31 REMOVE_ENTITIES, // 0x31
REMOVE_ENTITY_EFFECT, // 0x32 REMOVE_MOB_EFFECT, // 0x32
RESOURCE_PACK, // 0x33 RESOURCE_PACK, // 0x33
RESPAWN, // 0x34 RESPAWN, // 0x34
ENTITY_HEAD_LOOK, // 0x35 ROTATE_HEAD, // 0x35
SELECT_ADVANCEMENTS_TAB, // 0x36 SELECT_ADVANCEMENTS_TAB, // 0x36
WORLD_BORDER, // 0x37 SET_BORDER, // 0x37
CAMERA, // 0x38 SET_CAMERA, // 0x38
HELD_ITEM_CHANGE, // 0x39 SET_CARRIED_ITEM, // 0x39
DISPLAY_SCOREBOARD, // 0x3A SET_DISPLAY_OBJECTIVE, // 0x3A
ENTITY_METADATA, // 0x3B SET_ENTITY_DATA, // 0x3B
ATTACH_ENTITY, // 0x3C SET_ENTITY_LINK, // 0x3C
ENTITY_VELOCITY, // 0x3D SET_ENTITY_MOTION, // 0x3D
ENTITY_EQUIPMENT, // 0x3E SET_EQUIPPED_ITEM, // 0x3E
SET_EXPERIENCE, // 0x3F SET_EXPERIENCE, // 0x3F
UPDATE_HEALTH, // 0x40 SET_HEALTH, // 0x40
SCOREBOARD_OBJECTIVE, // 0x41 SET_OBJECTIVE, // 0x41
SET_PASSENGERS, // 0x42 SET_PASSENGERS, // 0x42
TEAMS, // 0x43 SET_PLAYER_TEAM, // 0x43
UPDATE_SCORE, // 0x44 SET_SCORE, // 0x44
SPAWN_POSITION, // 0x45 SET_DEFAULT_SPAWN_POSITION, // 0x45
TIME_UPDATE, // 0x46 SET_TIME, // 0x46
TITLE, // 0x47 SET_TITLES, // 0x47
SOUND, // 0x48 SOUND, // 0x48
TAB_LIST, // 0x49 TAB_LIST, // 0x49
COLLECT_ITEM, // 0x4A TAKE_ITEM_ENTITY, // 0x4A
ENTITY_TELEPORT, // 0x4B TELEPORT_ENTITY, // 0x4B
ADVANCEMENTS, // 0x4C UPDATE_ADVANCEMENTS, // 0x4C
ENTITY_PROPERTIES, // 0x4D UPDATE_ATTRIBUTES, // 0x4D
ENTITY_EFFECT; // 0x4E UPDATE_MOB_EFFECT; // 0x4E
@Override @Override
public int getId() { public int getId() {

View File

@ -21,38 +21,38 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_12 implements ServerboundPacketType { public enum ServerboundPackets1_12 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
PREPARE_CRAFTING_GRID, // 0x01 CRAFTING_RECIPE_PLACEMENT, // 0x01
TAB_COMPLETE, // 0x02 COMMAND_SUGGESTION, // 0x02
CHAT_MESSAGE, // 0x03 CHAT, // 0x03
CLIENT_STATUS, // 0x04 CLIENT_COMMAND, // 0x04
CLIENT_SETTINGS, // 0x05 CLIENT_INFORMATION, // 0x05
WINDOW_CONFIRMATION, // 0x06 CONTAINER_ACK, // 0x06
CLICK_WINDOW_BUTTON, // 0x07 CONTAINER_BUTTON_CLICK, // 0x07
CLICK_WINDOW, // 0x08 CONTAINER_CLICK, // 0x08
CLOSE_WINDOW, // 0x09 CONTAINER_CLOSE, // 0x09
PLUGIN_MESSAGE, // 0x0A CUSTOM_PAYLOAD, // 0x0A
INTERACT_ENTITY, // 0x0B INTERACT, // 0x0B
KEEP_ALIVE, // 0x0C KEEP_ALIVE, // 0x0C
PLAYER_MOVEMENT, // 0x0D MOVE_PLAYER_STATUS_ONLY, // 0x0D
PLAYER_POSITION, // 0x0E MOVE_PLAYER_POS, // 0x0E
PLAYER_POSITION_AND_ROTATION, // 0x0F MOVE_PLAYER_POS_ROT, // 0x0F
PLAYER_ROTATION, // 0x10 MOVE_PLAYER_ROT, // 0x10
VEHICLE_MOVE, // 0x11 MOVE_VEHICLE, // 0x11
STEER_BOAT, // 0x12 PADDLE_BOAT, // 0x12
PLAYER_ABILITIES, // 0x13 PLAYER_ABILITIES, // 0x13
PLAYER_DIGGING, // 0x14 PLAYER_ACTION, // 0x14
ENTITY_ACTION, // 0x15 PLAYER_COMMAND, // 0x15
STEER_VEHICLE, // 0x16 PLAYER_INPUT, // 0x16
RECIPE_BOOK_DATA, // 0x17 RECIPE_BOOK_UPDATE, // 0x17
RESOURCE_PACK_STATUS, // 0x18 RESOURCE_PACK, // 0x18
ADVANCEMENT_TAB, // 0x19 SEEN_ADVANCEMENTS, // 0x19
HELD_ITEM_CHANGE, // 0x1A SET_CARRIED_ITEM, // 0x1A
CREATIVE_INVENTORY_ACTION, // 0x1B SET_CREATIVE_MODE_SLOT, // 0x1B
UPDATE_SIGN, // 0x1C SIGN_UPDATE, // 0x1C
ANIMATION, // 0x1D SWING, // 0x1D
SPECTATE, // 0x1E TELEPORT_TO_ENTITY, // 0x1E
PLAYER_BLOCK_PLACEMENT, // 0x1F USE_ITEM_ON, // 0x1F
USE_ITEM; // 0x20 USE_ITEM; // 0x20
@Override @Override

View File

@ -37,12 +37,12 @@ public class ItemPacketRewriter1_12 extends ItemRewriter<ClientboundPackets1_9_3
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetSlot(ClientboundPackets1_9_3.SET_SLOT); registerSetSlot(ClientboundPackets1_9_3.CONTAINER_SET_SLOT);
registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_9_3.CONTAINER_SET_CONTENT);
registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT); registerEntityEquipment(ClientboundPackets1_9_3.SET_EQUIPPED_ITEM);
// Plugin message -> Trading // Plugin message -> Trading
protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_9_3.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Channel map(Type.STRING); // 0 - Channel
@ -71,7 +71,7 @@ public class ItemPacketRewriter1_12 extends ItemRewriter<ClientboundPackets1_9_3
}); });
protocol.registerServerbound(ServerboundPackets1_12.CLICK_WINDOW, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_12.CONTAINER_CLICK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -108,7 +108,7 @@ public class ItemPacketRewriter1_12 extends ItemRewriter<ClientboundPackets1_9_3
} }
); );
registerCreativeInvAction(ServerboundPackets1_12.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_12.SET_CREATIVE_MODE_SLOT);
} }
@Override @Override

View File

@ -33,7 +33,7 @@ public class ItemPacketRewriter1_11_1 extends ItemRewriter<ClientboundPackets1_9
@Override @Override
public void registerPackets() { public void registerPackets() {
registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_9_3.SET_CREATIVE_MODE_SLOT);
} }
@Override @Override

View File

@ -126,7 +126,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
public static final PacketHandler SEND_DECLARE_COMMANDS_AND_TAGS = public static final PacketHandler SEND_DECLARE_COMMANDS_AND_TAGS =
w -> { w -> {
// Send fake declare commands // Send fake declare commands
w.create(ClientboundPackets1_13.DECLARE_COMMANDS, wrapper -> { w.create(ClientboundPackets1_13.COMMANDS, wrapper -> {
wrapper.write(Type.VAR_INT, 2); // Size wrapper.write(Type.VAR_INT, 2); // Size
// Write root node // Write root node
wrapper.write(Type.BYTE, (byte) 0); // Mark as command wrapper.write(Type.BYTE, (byte) 0); // Mark as command
@ -145,7 +145,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}).scheduleSend(Protocol1_12_2To1_13.class); }).scheduleSend(Protocol1_12_2To1_13.class);
// Send tags packet // Send tags packet
w.create(ClientboundPackets1_13.TAGS, wrapper -> { w.create(ClientboundPackets1_13.UPDATE_TAGS, wrapper -> {
wrapper.write(Type.VAR_INT, MAPPINGS.getBlockTags().size()); // block tags wrapper.write(Type.VAR_INT, MAPPINGS.getBlockTags().size()); // block tags
for (Map.Entry<String, int[]> tag : MAPPINGS.getBlockTags().entrySet()) { for (Map.Entry<String, int[]> tag : MAPPINGS.getBlockTags().entrySet()) {
wrapper.write(Type.STRING, tag.getKey()); wrapper.write(Type.STRING, tag.getKey());
@ -200,7 +200,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
// New packet 0x04 - Login Plugin Message // New packet 0x04 - Login Plugin Message
// Statistics // Statistics
registerClientbound(ClientboundPackets1_12_1.STATISTICS, wrapper -> { registerClientbound(ClientboundPackets1_12_1.AWARD_STATS, wrapper -> {
int size = wrapper.read(Type.VAR_INT); int size = wrapper.read(Type.VAR_INT);
List<StatisticData> remappedStats = new ArrayList<>(); List<StatisticData> remappedStats = new ArrayList<>();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -246,10 +246,10 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
componentRewriter.registerBossBar(ClientboundPackets1_12_1.BOSSBAR); componentRewriter.registerBossBar(ClientboundPackets1_12_1.BOSS_EVENT);
componentRewriter.registerComponentPacket(ClientboundPackets1_12_1.CHAT_MESSAGE); componentRewriter.registerComponentPacket(ClientboundPackets1_12_1.CHAT);
registerClientbound(ClientboundPackets1_12_1.TAB_COMPLETE, wrapper -> { registerClientbound(ClientboundPackets1_12_1.COMMAND_SUGGESTIONS, wrapper -> {
wrapper.write(Type.VAR_INT, wrapper.user().get(TabCompleteTracker.class).getTransactionId()); wrapper.write(Type.VAR_INT, wrapper.user().get(TabCompleteTracker.class).getTransactionId());
String input = wrapper.user().get(TabCompleteTracker.class).getInput(); String input = wrapper.user().get(TabCompleteTracker.class).getInput();
@ -282,7 +282,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_12_1.OPEN_WINDOW, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.OPEN_SCREEN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Id map(Type.UNSIGNED_BYTE); // Id
@ -324,7 +324,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
componentRewriter.registerComponentPacket(ClientboundPackets1_12_1.DISCONNECT); componentRewriter.registerComponentPacket(ClientboundPackets1_12_1.DISCONNECT);
registerClientbound(ClientboundPackets1_12_1.EFFECT, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.LEVEL_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Effect Id map(Type.INT); // Effect Id
@ -344,7 +344,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_12_1.CRAFT_RECIPE_RESPONSE, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.PLACE_GHOST_RECIPE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.BYTE); map(Type.BYTE);
@ -352,9 +352,9 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
componentRewriter.registerCombatEvent(ClientboundPackets1_12_1.COMBAT_EVENT); componentRewriter.registerCombatEvent(ClientboundPackets1_12_1.PLAYER_COMBAT);
registerClientbound(ClientboundPackets1_12_1.MAP_DATA, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.MAP_ITEM_DATA, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Map id map(Type.VAR_INT); // 0 - Map id
@ -375,7 +375,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
} }
}); });
registerClientbound(ClientboundPackets1_12_1.UNLOCK_RECIPES, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.RECIPE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // action map(Type.VAR_INT); // action
@ -396,7 +396,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
wrapper.write(Type.STRING_ARRAY, stringIds); wrapper.write(Type.STRING_ARRAY, stringIds);
} }
if (action == 0) { if (action == 0) {
wrapper.create(ClientboundPackets1_13.DECLARE_RECIPES, w -> 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<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_12_1.SCOREBOARD_OBJECTIVE, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.SET_OBJECTIVE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Objective name map(Type.STRING); // 0 - Objective name
@ -439,7 +439,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_12_1.TEAMS, new PacketHandlers() { registerClientbound(ClientboundPackets1_12_1.SET_PLAYER_TEAM, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Team Name map(Type.STRING); // 0 - Team Name
@ -489,13 +489,13 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_12_1.UPDATE_SCORE, wrapper -> { registerClientbound(ClientboundPackets1_12_1.SET_SCORE, wrapper -> {
String displayName = wrapper.read(Type.STRING); // Display Name String displayName = wrapper.read(Type.STRING); // Display Name
displayName = rewriteTeamMemberName(displayName); displayName = rewriteTeamMemberName(displayName);
wrapper.write(Type.STRING, displayName); wrapper.write(Type.STRING, displayName);
}); });
componentRewriter.registerTitle(ClientboundPackets1_12_1.TITLE); componentRewriter.registerTitle(ClientboundPackets1_12_1.SET_TITLES);
// New 0x4C - Stop Sound // New 0x4C - Stop Sound
@ -506,7 +506,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
componentRewriter.processText(wrapper.user(), wrapper.passthrough(Type.COMPONENT)); componentRewriter.processText(wrapper.user(), wrapper.passthrough(Type.COMPONENT));
}); });
registerClientbound(ClientboundPackets1_12_1.ADVANCEMENTS, wrapper -> { registerClientbound(ClientboundPackets1_12_1.UPDATE_ADVANCEMENTS, wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear wrapper.passthrough(Type.BOOLEAN); // Reset/clear
int size = wrapper.passthrough(Type.VAR_INT); // Mapping size int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
@ -545,10 +545,10 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
cancelServerbound(State.LOGIN, ServerboundLoginPackets.CUSTOM_QUERY_ANSWER.getId()); cancelServerbound(State.LOGIN, ServerboundLoginPackets.CUSTOM_QUERY_ANSWER.getId());
// New 0x01 - Query Block NBT // New 0x01 - Query Block NBT
cancelServerbound(ServerboundPackets1_13.QUERY_BLOCK_NBT); cancelServerbound(ServerboundPackets1_13.BLOCK_ENTITY_TAG_QUERY);
// Tab-Complete // Tab-Complete
registerServerbound(ServerboundPackets1_13.TAB_COMPLETE, new PacketHandlers() { registerServerbound(ServerboundPackets1_13.COMMAND_SUGGESTION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
handler(wrapper -> { handler(wrapper -> {
@ -584,7 +584,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x0A - Edit book -> Plugin Message // New 0x0A - Edit book -> 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); Item item = wrapper.read(Type.ITEM1_13);
boolean isSigning = wrapper.read(Type.BOOLEAN); boolean isSigning = wrapper.read(Type.BOOLEAN);
@ -595,14 +595,14 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x0C - Query Entity NBT // New 0x0C - Query Entity NBT
cancelServerbound(ServerboundPackets1_13.ENTITY_NBT_REQUEST); cancelServerbound(ServerboundPackets1_13.ENTITY_TAG_QUERY);
// New 0x15 - Pick Item -> Plugin Message // New 0x15 - Pick Item -> 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 wrapper.write(Type.STRING, "MC|PickItem"); // Channel
}); });
registerServerbound(ServerboundPackets1_13.CRAFT_RECIPE_REQUEST, new PacketHandlers() { registerServerbound(ServerboundPackets1_13.PLACE_RECIPE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.BYTE); // Window id map(Type.BYTE); // Window id
@ -620,7 +620,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerServerbound(ServerboundPackets1_13.RECIPE_BOOK_DATA, new PacketHandlers() { registerServerbound(ServerboundPackets1_13.RECIPE_BOOK_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Type map(Type.VAR_INT); // 0 - Type
@ -650,12 +650,12 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x1C - Name Item -> Plugin Message // New 0x1C - Name Item -> 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 wrapper.write(Type.STRING, "MC|ItemName"); // Channel
}); });
// New 0x1F - Select Trade -> Plugin Message // 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 @Override
public void register() { public void register() {
create(Type.STRING, "MC|TrSel"); // Channel create(Type.STRING, "MC|TrSel"); // Channel
@ -664,7 +664,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x20 - Set Beacon Effect -> Plugin Message // New 0x20 - Set Beacon Effect -> 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 @Override
public void register() { public void register() {
create(Type.STRING, "MC|Beacon"); // Channel create(Type.STRING, "MC|Beacon"); // Channel
@ -674,7 +674,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x22 - Update Command Block -> Plugin Message // New 0x22 - Update Command Block -> 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 @Override
public void register() { public void register() {
create(Type.STRING, "MC|AutoCmd"); // Channel create(Type.STRING, "MC|AutoCmd"); // Channel
@ -697,7 +697,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
}); });
// New 0x23 - Update Command Block Minecart -> Plugin Message // New 0x23 - Update Command Block Minecart -> 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 @Override
public void register() { public void register() {
handler(wrapper -> { handler(wrapper -> {
@ -711,7 +711,7 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol<ClientboundPackets1_1
// 0x1B -> 0x24 in InventoryPackets // 0x1B -> 0x24 in InventoryPackets
// New 0x25 - Update Structure Block -> Message Channel // 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 @Override
public void register() { public void register() {
create(Type.STRING, "MC|Struct"); // Channel create(Type.STRING, "MC|Struct"); // Channel

View File

@ -88,7 +88,7 @@ public final class ConnectionData {
updateBlockStorage(user, pos.x(), pos.y(), pos.z(), newBlockState); 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.POSITION1_8, pos);
blockUpdatePacket.write(Type.VAR_INT, newBlockState); blockUpdatePacket.write(Type.VAR_INT, newBlockState);
blockUpdatePacket.send(Protocol1_12_2To1_13.class); blockUpdatePacket.send(Protocol1_12_2To1_13.class);
@ -719,7 +719,7 @@ public final class ConnectionData {
} }
if (!updates.isEmpty()) { 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, chunkX + chunkDeltaX);
wrapper.write(Type.INT, chunkZ + chunkDeltaZ); wrapper.write(Type.INT, chunkZ + chunkDeltaZ);
wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(EMPTY_RECORDS)); wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(EMPTY_RECORDS));

View File

@ -21,92 +21,92 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_13 implements ClientboundPacketType { public enum ClientboundPackets1_13 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E CHAT, // 0x0E
MULTI_BLOCK_CHANGE, // 0x0F CHUNK_BLOCKS_UPDATE, // 0x0F
TAB_COMPLETE, // 0x10 COMMAND_SUGGESTIONS, // 0x10
DECLARE_COMMANDS, // 0x11 COMMANDS, // 0x11
WINDOW_CONFIRMATION, // 0x12 CONTAINER_ACK, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
OPEN_WINDOW, // 0x14 OPEN_SCREEN, // 0x14
WINDOW_ITEMS, // 0x15 CONTAINER_SET_CONTENT, // 0x15
WINDOW_PROPERTY, // 0x16 CONTAINER_SET_DATA, // 0x16
SET_SLOT, // 0x17 CONTAINER_SET_SLOT, // 0x17
COOLDOWN, // 0x18 COOLDOWN, // 0x18
PLUGIN_MESSAGE, // 0x19 CUSTOM_PAYLOAD, // 0x19
NAMED_SOUND, // 0x1A CUSTOM_SOUND, // 0x1A
DISCONNECT, // 0x1B DISCONNECT, // 0x1B
ENTITY_STATUS, // 0x1C ENTITY_EVENT, // 0x1C
NBT_QUERY, // 0x1D TAG_QUERY, // 0x1D
EXPLOSION, // 0x1E EXPLODE, // 0x1E
UNLOAD_CHUNK, // 0x1F FORGET_LEVEL_CHUNK, // 0x1F
GAME_EVENT, // 0x20 GAME_EVENT, // 0x20
KEEP_ALIVE, // 0x21 KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22 LEVEL_CHUNK, // 0x22
EFFECT, // 0x23 LEVEL_EVENT, // 0x23
SPAWN_PARTICLE, // 0x24 LEVEL_PARTICLES, // 0x24
JOIN_GAME, // 0x25 LOGIN, // 0x25
MAP_DATA, // 0x26 MAP_ITEM_DATA, // 0x26
ENTITY_MOVEMENT, // 0x27 MOVE_ENTITY, // 0x27
ENTITY_POSITION, // 0x28 MOVE_ENTITY_POS, // 0x28
ENTITY_POSITION_AND_ROTATION, // 0x29 MOVE_ENTITY_POS_ROT, // 0x29
ENTITY_ROTATION, // 0x2A MOVE_ENTITY_ROT, // 0x2A
VEHICLE_MOVE, // 0x2B MOVE_VEHICLE, // 0x2B
OPEN_SIGN_EDITOR, // 0x2C OPEN_SIGN_EDITOR, // 0x2C
CRAFT_RECIPE_RESPONSE, // 0x2D PLACE_GHOST_RECIPE, // 0x2D
PLAYER_ABILITIES, // 0x2E PLAYER_ABILITIES, // 0x2E
COMBAT_EVENT, // 0x2F PLAYER_COMBAT, // 0x2F
PLAYER_INFO, // 0x30 PLAYER_INFO, // 0x30
FACE_PLAYER, // 0x31 PLAYER_LOOK_AT, // 0x31
PLAYER_POSITION, // 0x32 PLAYER_POSITION, // 0x32
USE_BED, // 0x33 PLAYER_SLEEP, // 0x33
UNLOCK_RECIPES, // 0x34 RECIPE, // 0x34
DESTROY_ENTITIES, // 0x35 REMOVE_ENTITIES, // 0x35
REMOVE_ENTITY_EFFECT, // 0x36 REMOVE_MOB_EFFECT, // 0x36
RESOURCE_PACK, // 0x37 RESOURCE_PACK, // 0x37
RESPAWN, // 0x38 RESPAWN, // 0x38
ENTITY_HEAD_LOOK, // 0x39 ROTATE_HEAD, // 0x39
SELECT_ADVANCEMENTS_TAB, // 0x3A SELECT_ADVANCEMENTS_TAB, // 0x3A
WORLD_BORDER, // 0x3B SET_BORDER, // 0x3B
CAMERA, // 0x3C SET_CAMERA, // 0x3C
HELD_ITEM_CHANGE, // 0x3D SET_CARRIED_ITEM, // 0x3D
DISPLAY_SCOREBOARD, // 0x3E SET_DISPLAY_OBJECTIVE, // 0x3E
ENTITY_METADATA, // 0x3F SET_ENTITY_DATA, // 0x3F
ATTACH_ENTITY, // 0x40 SET_ENTITY_LINK, // 0x40
ENTITY_VELOCITY, // 0x41 SET_ENTITY_MOTION, // 0x41
ENTITY_EQUIPMENT, // 0x42 SET_EQUIPPED_ITEM, // 0x42
SET_EXPERIENCE, // 0x43 SET_EXPERIENCE, // 0x43
UPDATE_HEALTH, // 0x44 SET_HEALTH, // 0x44
SCOREBOARD_OBJECTIVE, // 0x45 SET_OBJECTIVE, // 0x45
SET_PASSENGERS, // 0x46 SET_PASSENGERS, // 0x46
TEAMS, // 0x47 SET_PLAYER_TEAM, // 0x47
UPDATE_SCORE, // 0x48 SET_SCORE, // 0x48
SPAWN_POSITION, // 0x49 SET_DEFAULT_SPAWN_POSITION, // 0x49
TIME_UPDATE, // 0x4A SET_TIME, // 0x4A
TITLE, // 0x4B SET_TITLES, // 0x4B
STOP_SOUND, // 0x4C STOP_SOUND, // 0x4C
SOUND, // 0x4D SOUND, // 0x4D
TAB_LIST, // 0x4E TAB_LIST, // 0x4E
COLLECT_ITEM, // 0x4F TAKE_ITEM_ENTITY, // 0x4F
ENTITY_TELEPORT, // 0x50 TELEPORT_ENTITY, // 0x50
ADVANCEMENTS, // 0x51 UPDATE_ADVANCEMENTS, // 0x51
ENTITY_PROPERTIES, // 0x52 UPDATE_ATTRIBUTES, // 0x52
ENTITY_EFFECT, // 0x53 UPDATE_MOB_EFFECT, // 0x53
DECLARE_RECIPES, // 0x54 UPDATE_RECIPES, // 0x54
TAGS; // 0x55 UPDATE_TAGS; // 0x55
@Override @Override
public int getId() { public int getId() {

View File

@ -21,48 +21,48 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_13 implements ServerboundPacketType { public enum ServerboundPackets1_13 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
CHAT_MESSAGE, // 0x02 CHAT, // 0x02
CLIENT_STATUS, // 0x03 CLIENT_COMMAND, // 0x03
CLIENT_SETTINGS, // 0x04 CLIENT_INFORMATION, // 0x04
TAB_COMPLETE, // 0x05 COMMAND_SUGGESTION, // 0x05
WINDOW_CONFIRMATION, // 0x06 CONTAINER_ACK, // 0x06
CLICK_WINDOW_BUTTON, // 0x07 CONTAINER_BUTTON_CLICK, // 0x07
CLICK_WINDOW, // 0x08 CONTAINER_CLICK, // 0x08
CLOSE_WINDOW, // 0x09 CONTAINER_CLOSE, // 0x09
PLUGIN_MESSAGE, // 0x0A CUSTOM_PAYLOAD, // 0x0A
EDIT_BOOK, // 0x0B EDIT_BOOK, // 0x0B
ENTITY_NBT_REQUEST, // 0x0C ENTITY_TAG_QUERY, // 0x0C
INTERACT_ENTITY, // 0x0D INTERACT, // 0x0D
KEEP_ALIVE, // 0x0E KEEP_ALIVE, // 0x0E
PLAYER_MOVEMENT, // 0x0F MOVE_PLAYER_STATUS_ONLY, // 0x0F
PLAYER_POSITION, // 0x10 MOVE_PLAYER_POS, // 0x10
PLAYER_POSITION_AND_ROTATION, // 0x11 MOVE_PLAYER_POS_ROT, // 0x11
PLAYER_ROTATION, // 0x12 MOVE_PLAYER_ROT, // 0x12
VEHICLE_MOVE, // 0x13 MOVE_VEHICLE, // 0x13
STEER_BOAT, // 0x14 PADDLE_BOAT, // 0x14
PICK_ITEM, // 0x15 PICK_ITEM, // 0x15
CRAFT_RECIPE_REQUEST, // 0x16 PLACE_RECIPE, // 0x16
PLAYER_ABILITIES, // 0x17 PLAYER_ABILITIES, // 0x17
PLAYER_DIGGING, // 0x18 PLAYER_ACTION, // 0x18
ENTITY_ACTION, // 0x19 PLAYER_COMMAND, // 0x19
STEER_VEHICLE, // 0x1A PLAYER_INPUT, // 0x1A
RECIPE_BOOK_DATA, // 0x1B RECIPE_BOOK_UPDATE, // 0x1B
RENAME_ITEM, // 0x1C RENAME_ITEM, // 0x1C
RESOURCE_PACK_STATUS, // 0x1D RESOURCE_PACK, // 0x1D
ADVANCEMENT_TAB, // 0x1E SEEN_ADVANCEMENTS, // 0x1E
SELECT_TRADE, // 0x1F SELECT_TRADE, // 0x1F
SET_BEACON_EFFECT, // 0x20 SET_BEACON, // 0x20
HELD_ITEM_CHANGE, // 0x21 SET_CARRIED_ITEM, // 0x21
UPDATE_COMMAND_BLOCK, // 0x22 SET_COMMAND_BLOCK, // 0x22
UPDATE_COMMAND_BLOCK_MINECART, // 0x23 SET_COMMAND_MINECART, // 0x23
CREATIVE_INVENTORY_ACTION, // 0x24 SET_CREATIVE_MODE_SLOT, // 0x24
UPDATE_STRUCTURE_BLOCK, // 0x25 SET_STRUCTURE_BLOCK, // 0x25
UPDATE_SIGN, // 0x26 SIGN_UPDATE, // 0x26
ANIMATION, // 0x27 SWING, // 0x27
SPECTATE, // 0x28 TELEPORT_TO_ENTITY, // 0x28
PLAYER_BLOCK_PLACEMENT, // 0x29 USE_ITEM_ON, // 0x29
USE_ITEM; // 0x2A USE_ITEM; // 0x2A
@Override @Override

View File

@ -79,7 +79,7 @@ public class BlockEntityProvider implements Provider {
} }
private void sendBlockChange(UserConnection user, Position position, int blockId) { 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.POSITION1_8, position);
wrapper.write(Type.VAR_INT, blockId); wrapper.write(Type.VAR_INT, blockId);

View File

@ -33,7 +33,7 @@ public class EntityPacketRewriter1_13 {
public static void register(Protocol1_12_2To1_13 protocol) { public static void register(Protocol1_12_2To1_13 protocol) {
MetadataRewriter1_13To1_12_2 metadataRewriter = protocol.get(MetadataRewriter1_13To1_12_2.class); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -151,7 +151,7 @@ public class EntityPacketRewriter1_13 {
} }
}); });
metadataRewriter.registerRemoveEntities(ClientboundPackets1_12_1.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_12_1.REMOVE_ENTITIES);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_12_1.ENTITY_METADATA, Types1_12.METADATA_LIST, Types1_13.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_12_1.SET_ENTITY_DATA, Types1_12.METADATA_LIST, Types1_13.METADATA_LIST);
} }
} }

View File

@ -56,7 +56,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
@Override @Override
public void registerPackets() { public void registerPackets() {
protocol.registerClientbound(ClientboundPackets1_12_1.SET_SLOT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.CONTAINER_SET_SLOT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -66,7 +66,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
handler(wrapper -> handleItemToClient(wrapper.user(), wrapper.get(Type.ITEM1_13, 0))); handler(wrapper -> 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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -80,7 +80,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
}); });
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.WINDOW_PROPERTY, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.CONTAINER_SET_DATA, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Window id map(Type.UNSIGNED_BYTE); // Window id
@ -97,7 +97,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
}); });
// Plugin message Packet -> Trading // Plugin message Packet -> Trading
protocol.registerClientbound(ClientboundPackets1_12_1.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // 0 - Channel map(Type.STRING); // 0 - Channel
@ -195,7 +195,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.ENTITY_EQUIPMENT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.SET_EQUIPPED_ITEM, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -207,7 +207,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
}); });
protocol.registerServerbound(ServerboundPackets1_13.CLICK_WINDOW, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_13.CONTAINER_CLICK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -221,7 +221,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
} }
}); });
protocol.registerServerbound(ServerboundPackets1_13.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_13.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Channel map(Type.STRING); // Channel
@ -253,7 +253,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
} }
}); });
protocol.registerServerbound(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_13.SET_CREATIVE_MODE_SLOT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.SHORT); // 0 - Slot map(Type.SHORT); // 0 - Slot

View File

@ -77,7 +77,7 @@ public class WorldPacketRewriter1_13 {
public static void register(Protocol1_12_2To1_13 protocol) { public static void register(Protocol1_12_2To1_13 protocol) {
// Outgoing packets // Outgoing packets
protocol.registerClientbound(ClientboundPackets1_12_1.SPAWN_PAINTING, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.ADD_PAINTING, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -127,7 +127,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.BLOCK_ACTION, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.BLOCK_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_8); // Location map(Type.POSITION1_8); // Location
@ -162,7 +162,7 @@ public class WorldPacketRewriter1_13 {
blockId = blockId - 219 + 483; blockId = blockId - 219 + 483;
if (blockId == 73) { // Note block if (blockId == 73) { // Note block
PacketWrapper blockChange = wrapper.create(ClientboundPackets1_13.BLOCK_CHANGE); PacketWrapper blockChange = wrapper.create(ClientboundPackets1_13.BLOCK_UPDATE);
blockChange.write(Type.POSITION1_8, pos); blockChange.write(Type.POSITION1_8, pos);
blockChange.write(Type.VAR_INT, 249 + (action * 24 * 2) + (param * 2)); blockChange.write(Type.VAR_INT, 249 + (action * 24 * 2) + (param * 2));
blockChange.send(Protocol1_12_2To1_13.class); blockChange.send(Protocol1_12_2To1_13.class);
@ -172,7 +172,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.BLOCK_CHANGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.BLOCK_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_8); map(Type.POSITION1_8);
@ -199,7 +199,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.MULTI_BLOCK_CHANGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.CHUNK_BLOCKS_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // 0 - Chunk X map(Type.INT); // 0 - Chunk X
@ -257,7 +257,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.EXPLOSION, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.EXPLODE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
if (!Via.getConfig().isServersideBlockConnections()) { if (!Via.getConfig().isServersideBlockConnections()) {
@ -300,7 +300,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.UNLOAD_CHUNK, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.FORGET_LEVEL_CHUNK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
if (Via.getConfig().isServersideBlockConnections()) { if (Via.getConfig().isServersideBlockConnections()) {
@ -313,7 +313,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.NAMED_SOUND, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_12_1.CUSTOM_SOUND, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); map(Type.STRING);
@ -325,7 +325,7 @@ public class WorldPacketRewriter1_13 {
} }
}); });
protocol.registerClientbound(ClientboundPackets1_12_1.CHUNK_DATA, wrapper -> { protocol.registerClientbound(ClientboundPackets1_12_1.LEVEL_CHUNK, wrapper -> {
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
BlockStorage storage = wrapper.user().get(BlockStorage.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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Particle ID map(Type.INT); // 0 - Particle ID
@ -536,7 +536,7 @@ public class WorldPacketRewriter1_13 {
}); });
// Incoming Packets // 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); Position pos = wrapper.passthrough(Type.POSITION1_8);
wrapper.passthrough(Type.VAR_INT); // block face wrapper.passthrough(Type.VAR_INT); // block face
wrapper.passthrough(Type.VAR_INT); // hand wrapper.passthrough(Type.VAR_INT); // hand
@ -548,7 +548,7 @@ public class WorldPacketRewriter1_13 {
ConnectionData.markModified(wrapper.user(), pos); 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 int status = wrapper.passthrough(Type.VAR_INT); // Status
Position pos = wrapper.passthrough(Type.POSITION1_8); // Location Position pos = wrapper.passthrough(Type.POSITION1_8); // Location
wrapper.passthrough(Type.UNSIGNED_BYTE); // block face wrapper.passthrough(Type.UNSIGNED_BYTE); // block face

View File

@ -36,7 +36,7 @@ public class TabCompleteTracker implements StorableObject {
public void sendPacketToServer(UserConnection connection) { public void sendPacketToServer(UserConnection connection) {
if (lastTabComplete == null || timeToSend > System.currentTimeMillis()) return; 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.STRING, lastTabComplete);
wrapper.write(Type.BOOLEAN, false); wrapper.write(Type.BOOLEAN, false);
final Position playerLookTarget = Via.getManager().getProviders().get(PlayerLookTargetProvider.class).getPlayerLookTarget(connection); final Position playerLookTarget = Via.getManager().getProviders().get(PlayerLookTargetProvider.class).getPlayerLookTarget(connection);

View File

@ -31,6 +31,6 @@ public class Protocol1_12To1_12_1 extends AbstractProtocol<ClientboundPackets1_1
@Override @Override
protected void registerPackets() { protected void registerPackets() {
cancelServerbound(ServerboundPackets1_12_1.CRAFT_RECIPE_REQUEST); cancelServerbound(ServerboundPackets1_12_1.PLACE_RECIPE);
} }
} }

View File

@ -21,86 +21,86 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_12_1 implements ClientboundPacketType { public enum ClientboundPackets1_12_1 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
TAB_COMPLETE, // 0x0E COMMAND_SUGGESTIONS, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
MULTI_BLOCK_CHANGE, // 0x10 CHUNK_BLOCKS_UPDATE, // 0x10
WINDOW_CONFIRMATION, // 0x11 CONTAINER_ACK, // 0x11
CLOSE_WINDOW, // 0x12 CONTAINER_CLOSE, // 0x12
OPEN_WINDOW, // 0x13 OPEN_SCREEN, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
KEEP_ALIVE, // 0x1F KEEP_ALIVE, // 0x1F
CHUNK_DATA, // 0x20 LEVEL_CHUNK, // 0x20
EFFECT, // 0x21 LEVEL_EVENT, // 0x21
SPAWN_PARTICLE, // 0x22 LEVEL_PARTICLES, // 0x22
JOIN_GAME, // 0x23 LOGIN, // 0x23
MAP_DATA, // 0x24 MAP_ITEM_DATA, // 0x24
ENTITY_MOVEMENT, // 0x25 MOVE_ENTITY, // 0x25
ENTITY_POSITION, // 0x26 MOVE_ENTITY_POS, // 0x26
ENTITY_POSITION_AND_ROTATION, // 0x27 MOVE_ENTITY_POS_ROT, // 0x27
ENTITY_ROTATION, // 0x28 MOVE_ENTITY_ROT, // 0x28
VEHICLE_MOVE, // 0x29 MOVE_VEHICLE, // 0x29
OPEN_SIGN_EDITOR, // 0x2A OPEN_SIGN_EDITOR, // 0x2A
CRAFT_RECIPE_RESPONSE, // 0x2B PLACE_GHOST_RECIPE, // 0x2B
PLAYER_ABILITIES, // 0x2C PLAYER_ABILITIES, // 0x2C
COMBAT_EVENT, // 0x2D PLAYER_COMBAT, // 0x2D
PLAYER_INFO, // 0x2E PLAYER_INFO, // 0x2E
PLAYER_POSITION, // 0x2F PLAYER_POSITION, // 0x2F
USE_BED, // 0x30 PLAYER_SLEEP, // 0x30
UNLOCK_RECIPES, // 0x31 RECIPE, // 0x31
DESTROY_ENTITIES, // 0x32 REMOVE_ENTITIES, // 0x32
REMOVE_ENTITY_EFFECT, // 0x33 REMOVE_MOB_EFFECT, // 0x33
RESOURCE_PACK, // 0x34 RESOURCE_PACK, // 0x34
RESPAWN, // 0x35 RESPAWN, // 0x35
ENTITY_HEAD_LOOK, // 0x36 ROTATE_HEAD, // 0x36
SELECT_ADVANCEMENTS_TAB, // 0x37 SELECT_ADVANCEMENTS_TAB, // 0x37
WORLD_BORDER, // 0x38 SET_BORDER, // 0x38
CAMERA, // 0x39 SET_CAMERA, // 0x39
HELD_ITEM_CHANGE, // 0x3A SET_CARRIED_ITEM, // 0x3A
DISPLAY_SCOREBOARD, // 0x3B SET_DISPLAY_OBJECTIVE, // 0x3B
ENTITY_METADATA, // 0x3C SET_ENTITY_DATA, // 0x3C
ATTACH_ENTITY, // 0x3D SET_ENTITY_LINK, // 0x3D
ENTITY_VELOCITY, // 0x3E SET_ENTITY_MOTION, // 0x3E
ENTITY_EQUIPMENT, // 0x3F SET_EQUIPPED_ITEM, // 0x3F
SET_EXPERIENCE, // 0x40 SET_EXPERIENCE, // 0x40
UPDATE_HEALTH, // 0x41 SET_HEALTH, // 0x41
SCOREBOARD_OBJECTIVE, // 0x42 SET_OBJECTIVE, // 0x42
SET_PASSENGERS, // 0x43 SET_PASSENGERS, // 0x43
TEAMS, // 0x44 SET_PLAYER_TEAM, // 0x44
UPDATE_SCORE, // 0x45 SET_SCORE, // 0x45
SPAWN_POSITION, // 0x46 SET_DEFAULT_SPAWN_POSITION, // 0x46
TIME_UPDATE, // 0x47 SET_TIME, // 0x47
TITLE, // 0x48 SET_TITLES, // 0x48
SOUND, // 0x49 SOUND, // 0x49
TAB_LIST, // 0x4A TAB_LIST, // 0x4A
COLLECT_ITEM, // 0x4B TAKE_ITEM_ENTITY, // 0x4B
ENTITY_TELEPORT, // 0x4C TELEPORT_ENTITY, // 0x4C
ADVANCEMENTS, // 0x4D UPDATE_ADVANCEMENTS, // 0x4D
ENTITY_PROPERTIES, // 0x4E UPDATE_ATTRIBUTES, // 0x4E
ENTITY_EFFECT; // 0x4F UPDATE_MOB_EFFECT; // 0x4F
@Override @Override
public int getId() { public int getId() {

View File

@ -21,38 +21,38 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_12_1 implements ServerboundPacketType { public enum ServerboundPackets1_12_1 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
TAB_COMPLETE, // 0x01 COMMAND_SUGGESTION, // 0x01
CHAT_MESSAGE, // 0x02 CHAT, // 0x02
CLIENT_STATUS, // 0x03 CLIENT_COMMAND, // 0x03
CLIENT_SETTINGS, // 0x04 CLIENT_INFORMATION, // 0x04
WINDOW_CONFIRMATION, // 0x05 CONTAINER_ACK, // 0x05
CLICK_WINDOW_BUTTON, // 0x06 CONTAINER_BUTTON_CLICK, // 0x06
CLICK_WINDOW, // 0x07 CONTAINER_CLICK, // 0x07
CLOSE_WINDOW, // 0x08 CONTAINER_CLOSE, // 0x08
PLUGIN_MESSAGE, // 0x09 CUSTOM_PAYLOAD, // 0x09
INTERACT_ENTITY, // 0x0A INTERACT, // 0x0A
KEEP_ALIVE, // 0x0B KEEP_ALIVE, // 0x0B
PLAYER_MOVEMENT, // 0x0C MOVE_PLAYER_STATUS_ONLY, // 0x0C
PLAYER_POSITION, // 0x0D MOVE_PLAYER_POS, // 0x0D
PLAYER_POSITION_AND_ROTATION, // 0x0E MOVE_PLAYER_POS_ROT, // 0x0E
PLAYER_ROTATION, // 0x0F MOVE_PLAYER_ROT, // 0x0F
VEHICLE_MOVE, // 0x10 MOVE_VEHICLE, // 0x10
STEER_BOAT, // 0x11 PADDLE_BOAT, // 0x11
CRAFT_RECIPE_REQUEST, // 0x12 PLACE_RECIPE, // 0x12
PLAYER_ABILITIES, // 0x13 PLAYER_ABILITIES, // 0x13
PLAYER_DIGGING, // 0x14 PLAYER_ACTION, // 0x14
ENTITY_ACTION, // 0x15 PLAYER_COMMAND, // 0x15
STEER_VEHICLE, // 0x16 PLAYER_INPUT, // 0x16
RECIPE_BOOK_DATA, // 0x17 RECIPE_BOOK_UPDATE, // 0x17
RESOURCE_PACK_STATUS, // 0x18 RESOURCE_PACK, // 0x18
ADVANCEMENT_TAB, // 0x19 SEEN_ADVANCEMENTS, // 0x19
HELD_ITEM_CHANGE, // 0x1A SET_CARRIED_ITEM, // 0x1A
CREATIVE_INVENTORY_ACTION, // 0x1B SET_CREATIVE_MODE_SLOT, // 0x1B
UPDATE_SIGN, // 0x1C SIGN_UPDATE, // 0x1C
ANIMATION, // 0x1D SWING, // 0x1D
SPECTATE, // 0x1E TELEPORT_TO_ENTITY, // 0x1E
PLAYER_BLOCK_PLACEMENT, // 0x1F USE_ITEM_ON, // 0x1F
USE_ITEM; // 0x20 USE_ITEM; // 0x20
@Override @Override

View File

@ -46,7 +46,7 @@ public class Protocol1_13_1To1_13_2 extends AbstractProtocol<ClientboundPackets1
} }
}); });
registerClientbound(ClientboundPackets1_13.ADVANCEMENTS, wrapper -> { registerClientbound(ClientboundPackets1_13.UPDATE_ADVANCEMENTS, wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear wrapper.passthrough(Type.BOOLEAN); // Reset/clear
int size = wrapper.passthrough(Type.VAR_INT); // Mapping size int size = wrapper.passthrough(Type.VAR_INT); // Mapping size

View File

@ -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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID

View File

@ -27,7 +27,7 @@ import com.viaversion.viaversion.util.Key;
public class ItemPacketRewriter1_13_2 { public class ItemPacketRewriter1_13_2 {
public static void register(Protocol1_13_1To1_13_2 protocol) { 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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID 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 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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID 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 @Override
public void register() { public void register() {
map(Type.STRING); // Channel 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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); int recipesNo = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < recipesNo; i++) { for (int i = 0; i < recipesNo; i++) {
wrapper.passthrough(Type.STRING); // Id 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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID 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 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 @Override
public void register() { public void register() {
map(Type.SHORT); // 0 - Slot map(Type.SHORT); // 0 - Slot

View File

@ -25,7 +25,7 @@ import com.viaversion.viaversion.protocols.v1_13_1to1_13_2.Protocol1_13_1To1_13_
public class WorldPacketRewriter1_13_2 { public class WorldPacketRewriter1_13_2 {
public static void register(Protocol1_13_1To1_13_2 protocol) { 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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Particle ID map(Type.INT); // 0 - Particle ID

View File

@ -62,10 +62,10 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol<ClientboundPackets1_1
PlayerPackets1_14.register(this); PlayerPackets1_14.register(this);
new SoundRewriter<>(this).registerSound(ClientboundPackets1_13.SOUND); new SoundRewriter<>(this).registerSound(ClientboundPackets1_13.SOUND);
new StatisticsRewriter<>(this).register(ClientboundPackets1_13.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_13.AWARD_STATS);
ComponentRewriter<ClientboundPackets1_13> componentRewriter = new ComponentRewriter1_14<>(this); ComponentRewriter<ClientboundPackets1_13> componentRewriter = new ComponentRewriter1_14<>(this);
componentRewriter.registerComponentPacket(ClientboundPackets1_13.CHAT_MESSAGE); componentRewriter.registerComponentPacket(ClientboundPackets1_13.CHAT);
CommandRewriter<ClientboundPackets1_13> commandRewriter = new CommandRewriter<>(this) { CommandRewriter<ClientboundPackets1_13> commandRewriter = new CommandRewriter<>(this) {
@Override @Override
@ -76,9 +76,9 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol<ClientboundPackets1_1
return super.handleArgumentType(argumentType); return super.handleArgumentType(argumentType);
} }
}; };
commandRewriter.registerDeclareCommands(ClientboundPackets1_13.DECLARE_COMMANDS); commandRewriter.registerDeclareCommands(ClientboundPackets1_13.COMMANDS);
registerClientbound(ClientboundPackets1_13.TAGS, wrapper -> { registerClientbound(ClientboundPackets1_13.UPDATE_TAGS, wrapper -> {
int blockTagsSize = wrapper.read(Type.VAR_INT); int blockTagsSize = wrapper.read(Type.VAR_INT);
wrapper.write(Type.VAR_INT, blockTagsSize + 6); // block tags wrapper.write(Type.VAR_INT, blockTagsSize + 6); // block tags
for (int i = 0; i < blockTagsSize; i++) { for (int i = 0; i < blockTagsSize; i++) {
@ -134,11 +134,11 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol<ClientboundPackets1_1
}); });
// Set Difficulty packet added in 19w11a // Set Difficulty packet added in 19w11a
cancelServerbound(ServerboundPackets1_14.SET_DIFFICULTY); cancelServerbound(ServerboundPackets1_14.CHANGE_DIFFICULTY);
// Lock Difficulty packet added in 19w11a // Lock Difficulty packet added in 19w11a
cancelServerbound(ServerboundPackets1_14.LOCK_DIFFICULTY); cancelServerbound(ServerboundPackets1_14.LOCK_DIFFICULTY);
// Unknown packet added in 19w13a // Unknown packet added in 19w13a
cancelServerbound(ServerboundPackets1_14.UPDATE_JIGSAW_BLOCK); cancelServerbound(ServerboundPackets1_14.SET_JIGSAW_BLOCK);
} }
@Override @Override

View File

@ -46,16 +46,16 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter<ClientboundPack
registerMetaTypeHandler(Types1_14.META_TYPES.itemType, Types1_14.META_TYPES.blockStateType, Types1_14.META_TYPES.particleType); registerMetaTypeHandler(Types1_14.META_TYPES.itemType, Types1_14.META_TYPES.blockStateType, Types1_14.META_TYPES.particleType);
filter().type(EntityTypes1_14.ENTITY).addIndex(6); filter().type(EntityTypes1_14.ENTITY).addIndex(6);
filter().type(EntityTypes1_14.LIVINGENTITY).addIndex(12); filter().type(EntityTypes1_14.LIVING_ENTITY).addIndex(12);
filter().type(EntityTypes1_14.LIVINGENTITY).index(8).handler((event, meta) -> { filter().type(EntityTypes1_14.LIVING_ENTITY).index(8).handler((event, meta) -> {
float value = ((Number) meta.getValue()).floatValue(); float value = ((Number) meta.getValue()).floatValue();
if (Float.isNaN(value) && Via.getConfig().is1_14HealthNaNFix()) { if (Float.isNaN(value) && Via.getConfig().is1_14HealthNaNFix()) {
meta.setValue(1F); 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()); EntityTracker1_14 tracker = tracker(event.user());
int entityId = event.entityId(); int entityId = event.entityId();
tracker.setInsentientData(entityId, (byte) ((((Number) meta.getValue()).byteValue() & ~0x4) tracker.setInsentientData(entityId, (byte) ((((Number) meta.getValue()).byteValue() & ~0x4)
@ -93,7 +93,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter<ClientboundPack
} }
}); });
filter().type(EntityTypes1_14.MINECART_ABSTRACT).index(10).handler((event, meta) -> { filter().type(EntityTypes1_14.ABSTRACT_MINECART).index(10).handler((event, meta) -> {
int data = meta.value(); int data = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));
}); });
@ -111,7 +111,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter<ClientboundPack
armorItem = new DataItem(protocol.getMappingData().getNewItemId(729), (byte) 1, (short) 0, null); armorItem = new DataItem(protocol.getMappingData().getNewItemId(729), (byte) 1, (short) 0, null);
} }
PacketWrapper equipmentPacket = PacketWrapper.create(ClientboundPackets1_14.ENTITY_EQUIPMENT, null, event.user()); PacketWrapper equipmentPacket = PacketWrapper.create(ClientboundPackets1_14.SET_EQUIPPED_ITEM, null, event.user());
equipmentPacket.write(Type.VAR_INT, event.entityId()); equipmentPacket.write(Type.VAR_INT, event.entityId());
equipmentPacket.write(Type.VAR_INT, 4); equipmentPacket.write(Type.VAR_INT, 4);
equipmentPacket.write(Type.ITEM1_13_2, armorItem); equipmentPacket.write(Type.ITEM1_13_2, armorItem);
@ -148,7 +148,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter<ClientboundPack
event.cancel(); // "Is swinging arms" event.cancel(); // "Is swinging arms"
}); });
filter().type(EntityTypes1_14.ABSTRACT_ILLAGER_BASE).handler((event, meta) -> { filter().type(EntityTypes1_14.ABSTRACT_ILLAGER).handler((event, meta) -> {
if (event.index() == 14) { if (event.index() == 14) {
EntityTracker1_14 tracker = tracker(event.user()); EntityTracker1_14 tracker = tracker(event.user());
int entityId = event.entityId(); int entityId = event.entityId();

View File

@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_14 implements ClientboundPacketType { public enum ClientboundPackets1_14 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E CHAT, // 0x0E
MULTI_BLOCK_CHANGE, // 0x0F CHUNK_BLOCKS_UPDATE, // 0x0F
TAB_COMPLETE, // 0x10 COMMAND_SUGGESTIONS, // 0x10
DECLARE_COMMANDS, // 0x11 COMMANDS, // 0x11
WINDOW_CONFIRMATION, // 0x12 CONTAINER_ACK, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
KEEP_ALIVE, // 0x20 KEEP_ALIVE, // 0x20
CHUNK_DATA, // 0x21 LEVEL_CHUNK, // 0x21
EFFECT, // 0x22 LEVEL_EVENT, // 0x22
SPAWN_PARTICLE, // 0x23 LEVEL_PARTICLES, // 0x23
UPDATE_LIGHT, // 0x24 LIGHT_UPDATE, // 0x24
JOIN_GAME, // 0x25 LOGIN, // 0x25
MAP_DATA, // 0x26 MAP_ITEM_DATA, // 0x26
TRADE_LIST, // 0x27 MERCHANT_OFFERS, // 0x27
ENTITY_POSITION, // 0x28 MOVE_ENTITY_POS, // 0x28
ENTITY_POSITION_AND_ROTATION, // 0x29 MOVE_ENTITY_POS_ROT, // 0x29
ENTITY_ROTATION, // 0x2A MOVE_ENTITY_ROT, // 0x2A
ENTITY_MOVEMENT, // 0x2B MOVE_ENTITY, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
CRAFT_RECIPE_RESPONSE, // 0x30 PLACE_GHOST_RECIPE, // 0x30
PLAYER_ABILITIES, // 0x31 PLAYER_ABILITIES, // 0x31
COMBAT_EVENT, // 0x32 PLAYER_COMBAT, // 0x32
PLAYER_INFO, // 0x33 PLAYER_INFO, // 0x33
FACE_PLAYER, // 0x34 PLAYER_LOOK_AT, // 0x34
PLAYER_POSITION, // 0x35 PLAYER_POSITION, // 0x35
UNLOCK_RECIPES, // 0x36 RECIPE, // 0x36
DESTROY_ENTITIES, // 0x37 REMOVE_ENTITIES, // 0x37
REMOVE_ENTITY_EFFECT, // 0x38 REMOVE_MOB_EFFECT, // 0x38
RESOURCE_PACK, // 0x39 RESOURCE_PACK, // 0x39
RESPAWN, // 0x3A RESPAWN, // 0x3A
ENTITY_HEAD_LOOK, // 0x3B ROTATE_HEAD, // 0x3B
SELECT_ADVANCEMENTS_TAB, // 0x3C SELECT_ADVANCEMENTS_TAB, // 0x3C
WORLD_BORDER, // 0x3D SET_BORDER, // 0x3D
CAMERA, // 0x3E SET_CAMERA, // 0x3E
HELD_ITEM_CHANGE, // 0x3F SET_CARRIED_ITEM, // 0x3F
UPDATE_VIEW_POSITION, // 0x40 SET_CHUNK_CACHE_CENTER, // 0x40
UPDATE_VIEW_DISTANCE, // 0x41 SET_CHUNK_CACHE_RADIUS, // 0x41
DISPLAY_SCOREBOARD, // 0x42 SET_DISPLAY_OBJECTIVE, // 0x42
ENTITY_METADATA, // 0x43 SET_ENTITY_DATA, // 0x43
ATTACH_ENTITY, // 0x44 SET_ENTITY_LINK, // 0x44
ENTITY_VELOCITY, // 0x45 SET_ENTITY_MOTION, // 0x45
ENTITY_EQUIPMENT, // 0x46 SET_EQUIPPED_ITEM, // 0x46
SET_EXPERIENCE, // 0x47 SET_EXPERIENCE, // 0x47
UPDATE_HEALTH, // 0x48 SET_HEALTH, // 0x48
SCOREBOARD_OBJECTIVE, // 0x49 SET_OBJECTIVE, // 0x49
SET_PASSENGERS, // 0x4A SET_PASSENGERS, // 0x4A
TEAMS, // 0x4B SET_PLAYER_TEAM, // 0x4B
UPDATE_SCORE, // 0x4C SET_SCORE, // 0x4C
SPAWN_POSITION, // 0x4D SET_DEFAULT_SPAWN_POSITION, // 0x4D
TIME_UPDATE, // 0x4E SET_TIME, // 0x4E
TITLE, // 0x4F SET_TITLES, // 0x4F
ENTITY_SOUND, // 0x50 SOUND_ENTITY, // 0x50
SOUND, // 0x51 SOUND, // 0x51
STOP_SOUND, // 0x52 STOP_SOUND, // 0x52
TAB_LIST, // 0x53 TAB_LIST, // 0x53
NBT_QUERY, // 0x54 TAG_QUERY, // 0x54
COLLECT_ITEM, // 0x55 TAKE_ITEM_ENTITY, // 0x55
ENTITY_TELEPORT, // 0x56 TELEPORT_ENTITY, // 0x56
ADVANCEMENTS, // 0x57 UPDATE_ADVANCEMENTS, // 0x57
ENTITY_PROPERTIES, // 0x58 UPDATE_ATTRIBUTES, // 0x58
ENTITY_EFFECT, // 0x59 UPDATE_MOB_EFFECT, // 0x59
DECLARE_RECIPES, // 0x5A UPDATE_RECIPES, // 0x5A
TAGS; // 0x5B UPDATE_TAGS; // 0x5B
@Override @Override
public int getId() { public int getId() {

View File

@ -21,51 +21,51 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_14 implements ServerboundPacketType { public enum ServerboundPackets1_14 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_MESSAGE, // 0x03 CHAT, // 0x03
CLIENT_STATUS, // 0x04 CLIENT_COMMAND, // 0x04
CLIENT_SETTINGS, // 0x05 CLIENT_INFORMATION, // 0x05
TAB_COMPLETE, // 0x06 COMMAND_SUGGESTION, // 0x06
WINDOW_CONFIRMATION, // 0x07 CONTAINER_ACK, // 0x07
CLICK_WINDOW_BUTTON, // 0x08 CONTAINER_BUTTON_CLICK, // 0x08
CLICK_WINDOW, // 0x09 CONTAINER_CLICK, // 0x09
CLOSE_WINDOW, // 0x0A CONTAINER_CLOSE, // 0x0A
PLUGIN_MESSAGE, // 0x0B CUSTOM_PAYLOAD, // 0x0B
EDIT_BOOK, // 0x0C EDIT_BOOK, // 0x0C
ENTITY_NBT_REQUEST, // 0x0D ENTITY_TAG_QUERY, // 0x0D
INTERACT_ENTITY, // 0x0E INTERACT, // 0x0E
KEEP_ALIVE, // 0x0F KEEP_ALIVE, // 0x0F
LOCK_DIFFICULTY, // 0x10 LOCK_DIFFICULTY, // 0x10
PLAYER_POSITION, // 0x11 MOVE_PLAYER_POS, // 0x11
PLAYER_POSITION_AND_ROTATION, // 0x12 MOVE_PLAYER_POS_ROT, // 0x12
PLAYER_ROTATION, // 0x13 MOVE_PLAYER_ROT, // 0x13
PLAYER_MOVEMENT, // 0x14 MOVE_PLAYER_STATUS_ONLY, // 0x14
VEHICLE_MOVE, // 0x15 MOVE_VEHICLE, // 0x15
STEER_BOAT, // 0x16 PADDLE_BOAT, // 0x16
PICK_ITEM, // 0x17 PICK_ITEM, // 0x17
CRAFT_RECIPE_REQUEST, // 0x18 PLACE_RECIPE, // 0x18
PLAYER_ABILITIES, // 0x19 PLAYER_ABILITIES, // 0x19
PLAYER_DIGGING, // 0x1A PLAYER_ACTION, // 0x1A
ENTITY_ACTION, // 0x1B PLAYER_COMMAND, // 0x1B
STEER_VEHICLE, // 0x1C PLAYER_INPUT, // 0x1C
RECIPE_BOOK_DATA, // 0x1D RECIPE_BOOK_UPDATE, // 0x1D
RENAME_ITEM, // 0x1E RENAME_ITEM, // 0x1E
RESOURCE_PACK_STATUS, // 0x1F RESOURCE_PACK, // 0x1F
ADVANCEMENT_TAB, // 0x20 SEEN_ADVANCEMENTS, // 0x20
SELECT_TRADE, // 0x21 SELECT_TRADE, // 0x21
SET_BEACON_EFFECT, // 0x22 SET_BEACON, // 0x22
HELD_ITEM_CHANGE, // 0x23 SET_CARRIED_ITEM, // 0x23
UPDATE_COMMAND_BLOCK, // 0x24 SET_COMMAND_BLOCK, // 0x24
UPDATE_COMMAND_BLOCK_MINECART, // 0x25 SET_COMMAND_MINECART, // 0x25
CREATIVE_INVENTORY_ACTION, // 0x26 SET_CREATIVE_MODE_SLOT, // 0x26
UPDATE_JIGSAW_BLOCK, // 0x27 SET_JIGSAW_BLOCK, // 0x27
UPDATE_STRUCTURE_BLOCK, // 0x28 SET_STRUCTURE_BLOCK, // 0x28
UPDATE_SIGN, // 0x29 SIGN_UPDATE, // 0x29
ANIMATION, // 0x2A SWING, // 0x2A
SPECTATE, // 0x2B TELEPORT_TO_ENTITY, // 0x2B
PLAYER_BLOCK_PLACEMENT, // 0x2C USE_ITEM_ON, // 0x2C
USE_ITEM; // 0x2D USE_ITEM; // 0x2D
@Override @Override

View File

@ -41,19 +41,19 @@ public class EntityPacketRewriter1_14 {
public static void register(Protocol1_13_2To1_14 protocol) { public static void register(Protocol1_13_2To1_14 protocol) {
MetadataRewriter1_14To1_13_2 metadataRewriter = protocol.get(MetadataRewriter1_14To1_13_2.class); 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); int entityId = wrapper.passthrough(Type.VAR_INT);
metadataRewriter.tracker(wrapper.user()).addEntity(entityId, EntityTypes1_14.EXPERIENCE_ORB); 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); int entityId = wrapper.passthrough(Type.VAR_INT);
if (wrapper.passthrough(Type.BYTE) == 1) { if (wrapper.passthrough(Type.BYTE) == 1) {
metadataRewriter.tracker(wrapper.user()).addEntity(entityId, EntityTypes1_14.LIGHTNING_BOLT); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -175,7 +175,7 @@ public class EntityPacketRewriter1_14 {
int entityId = wrapper.get(Type.VAR_INT, 0); int entityId = wrapper.get(Type.VAR_INT, 0);
tracker.setSleeping(entityId, false); 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); metadataPacket.write(Type.VAR_INT, entityId);
List<Metadata> metadataList = new LinkedList<>(); List<Metadata> metadataList = new LinkedList<>();
if (tracker.clientEntityId() != entityId) { 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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Entity ID map(Type.INT); // 0 - Entity ID
@ -204,7 +204,7 @@ public class EntityPacketRewriter1_14 {
handler(metadataRewriter.playerTrackerHandler()); handler(metadataRewriter.playerTrackerHandler());
handler(wrapper -> { handler(wrapper -> {
short difficulty = wrapper.read(Type.UNSIGNED_BYTE); // 19w11a removed difficulty from join game 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.UNSIGNED_BYTE, difficulty);
difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a
difficultyPacket.scheduleSend(protocol.getClass()); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -245,7 +245,7 @@ public class EntityPacketRewriter1_14 {
} }
}); });
metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.REMOVE_ENTITIES);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.ENTITY_METADATA, Types1_13_2.METADATA_LIST, Types1_14.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.SET_ENTITY_DATA, Types1_13_2.METADATA_LIST, Types1_14.METADATA_LIST);
} }
} }

View File

@ -66,9 +66,9 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_13.COOLDOWN); registerSetCooldown(ClientboundPackets1_13.COOLDOWN);
registerAdvancements(ClientboundPackets1_13.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_13.UPDATE_ADVANCEMENTS);
protocol.registerClientbound(ClientboundPackets1_13.OPEN_WINDOW, null, wrapper -> { protocol.registerClientbound(ClientboundPackets1_13.OPEN_SCREEN, null, wrapper -> {
Short windowId = wrapper.read(Type.UNSIGNED_BYTE); Short windowId = wrapper.read(Type.UNSIGNED_BYTE);
String type = wrapper.read(Type.STRING); String type = wrapper.read(Type.STRING);
JsonElement title = wrapper.read(Type.COMPONENT); JsonElement title = wrapper.read(Type.COMPONENT);
@ -76,13 +76,13 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
Short slots = wrapper.read(Type.UNSIGNED_BYTE); Short slots = wrapper.read(Type.UNSIGNED_BYTE);
if (type.equals("EntityHorse")) { if (type.equals("EntityHorse")) {
wrapper.setPacketType(ClientboundPackets1_14.OPEN_HORSE_WINDOW); wrapper.setPacketType(ClientboundPackets1_14.HORSE_SCREEN_OPEN);
int entityId = wrapper.read(Type.INT); int entityId = wrapper.read(Type.INT);
wrapper.write(Type.UNSIGNED_BYTE, windowId); wrapper.write(Type.UNSIGNED_BYTE, windowId);
wrapper.write(Type.VAR_INT, slots.intValue()); wrapper.write(Type.VAR_INT, slots.intValue());
wrapper.write(Type.INT, entityId); wrapper.write(Type.INT, entityId);
} else { } else {
wrapper.setPacketType(ClientboundPackets1_14.OPEN_WINDOW); wrapper.setPacketType(ClientboundPackets1_14.OPEN_SCREEN);
wrapper.write(Type.VAR_INT, windowId.intValue()); wrapper.write(Type.VAR_INT, windowId.intValue());
int typeId = -1; int typeId = -1;
@ -134,17 +134,17 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
} }
}); });
registerWindowItems(ClientboundPackets1_13.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_13.CONTAINER_SET_CONTENT);
registerSetSlot(ClientboundPackets1_13.SET_SLOT); registerSetSlot(ClientboundPackets1_13.CONTAINER_SET_SLOT);
protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_13.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Channel map(Type.STRING); // Channel
handlerSoftFail(wrapper -> { handlerSoftFail(wrapper -> {
String channel = Key.namespaced(wrapper.get(Type.STRING, 0)); String channel = Key.namespaced(wrapper.get(Type.STRING, 0));
if (channel.equals("minecraft:trader_list")) { if (channel.equals("minecraft:trader_list")) {
wrapper.setPacketType(ClientboundPackets1_14.TRADE_LIST); wrapper.setPacketType(ClientboundPackets1_14.MERCHANT_OFFERS);
wrapper.resetReader(); wrapper.resetReader();
wrapper.read(Type.STRING); // Remove channel wrapper.read(Type.STRING); // Remove channel
@ -188,10 +188,10 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
} }
}); });
registerEntityEquipment(ClientboundPackets1_13.ENTITY_EQUIPMENT); registerEntityEquipment(ClientboundPackets1_13.SET_EQUIPPED_ITEM);
RecipeRewriter<ClientboundPackets1_13> recipeRewriter = new RecipeRewriter<>(protocol); RecipeRewriter<ClientboundPackets1_13> 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 size = wrapper.passthrough(Type.VAR_INT);
int deleted = 0; int deleted = 0;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -210,11 +210,11 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
}); });
registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_14.CONTAINER_CLICK);
protocol.registerServerbound(ServerboundPackets1_14.SELECT_TRADE, wrapper -> { protocol.registerServerbound(ServerboundPackets1_14.SELECT_TRADE, wrapper -> {
// Selecting trade now moves the items, we need to resync the inventory // 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); 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.UNSIGNED_BYTE, ((short) tracker.getLatestTradeWindowId())); // 0 - Window ID
resyncPacket.write(Type.SHORT, ((short) -999)); // 1 - Slot resyncPacket.write(Type.SHORT, ((short) -999)); // 1 - Slot
@ -227,9 +227,9 @@ public class ItemPacketRewriter1_14 extends ItemRewriter<ClientboundPackets1_13,
resyncPacket.scheduleSendToServer(Protocol1_13_2To1_14.class); resyncPacket.scheduleSendToServer(Protocol1_13_2To1_14.class);
}); });
registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_14.SET_CREATIVE_MODE_SLOT);
registerSpawnParticle(ClientboundPackets1_13.SPAWN_PARTICLE, Type.FLOAT); registerSpawnParticle(ClientboundPackets1_13.LEVEL_PARTICLES, Type.FLOAT);
} }
@Override @Override

View File

@ -40,7 +40,7 @@ public class PlayerPackets1_14 {
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.QUERY_BLOCK_NBT, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.BLOCK_ENTITY_TAG_QUERY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -75,7 +75,7 @@ public class PlayerPackets1_14 {
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.PLAYER_DIGGING, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.PLAYER_ACTION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Action map(Type.VAR_INT); // Action
@ -83,7 +83,7 @@ public class PlayerPackets1_14 {
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.RECIPE_BOOK_DATA, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.RECIPE_BOOK_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -107,26 +107,26 @@ public class PlayerPackets1_14 {
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.UPDATE_COMMAND_BLOCK, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.SET_COMMAND_BLOCK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_14, Type.POSITION1_8); map(Type.POSITION1_14, Type.POSITION1_8);
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.UPDATE_STRUCTURE_BLOCK, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.SET_STRUCTURE_BLOCK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_14, Type.POSITION1_8); map(Type.POSITION1_14, Type.POSITION1_8);
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.UPDATE_SIGN, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_14.SIGN_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_14, Type.POSITION1_8); map(Type.POSITION1_14, Type.POSITION1_8);
} }
}); });
protocol.registerServerbound(ServerboundPackets1_14.PLAYER_BLOCK_PLACEMENT, wrapper -> { protocol.registerServerbound(ServerboundPackets1_14.USE_ITEM_ON, wrapper -> {
int hand = wrapper.read(Type.VAR_INT); int hand = wrapper.read(Type.VAR_INT);
Position position = wrapper.read(Type.POSITION1_14); Position position = wrapper.read(Type.POSITION1_14);
int face = wrapper.read(Type.VAR_INT); int face = wrapper.read(Type.VAR_INT);

View File

@ -55,7 +55,7 @@ public class WorldPacketRewriter1_14 {
public static void register(Protocol1_13_2To1_14 protocol) { public static void register(Protocol1_13_2To1_14 protocol) {
BlockRewriter<ClientboundPackets1_13> blockRewriter = BlockRewriter.for1_14(protocol); BlockRewriter<ClientboundPackets1_13> blockRewriter = BlockRewriter.for1_14(protocol);
protocol.registerClientbound(ClientboundPackets1_13.BLOCK_BREAK_ANIMATION, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_13.BLOCK_DESTRUCTION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -69,7 +69,7 @@ public class WorldPacketRewriter1_14 {
map(Type.POSITION1_8, Type.POSITION1_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 @Override
public void register() { public void register() {
map(Type.POSITION1_8, Type.POSITION1_14); // Location 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)))); 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 @Override
public void register() { public void register() {
map(Type.POSITION1_8, Type.POSITION1_14); 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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); 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 @Override
public void register() { public void register() {
map(Type.FLOAT); // X 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); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
Chunk chunk = wrapper.read(ChunkType1_13.forEnvironment(clientWorld.getEnvironment())); Chunk chunk = wrapper.read(ChunkType1_13.forEnvironment(clientWorld.getEnvironment()));
wrapper.write(ChunkType1_14.TYPE, chunk); wrapper.write(ChunkType1_14.TYPE, chunk);
@ -182,7 +182,7 @@ public class WorldPacketRewriter1_14 {
heightMap.put("WORLD_SURFACE", new LongArrayTag(encodeHeightMap(worldSurface))); heightMap.put("WORLD_SURFACE", new LongArrayTag(encodeHeightMap(worldSurface)));
chunk.setHeightMap(heightMap); 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.getX());
lightPacket.write(Type.VAR_INT, chunk.getZ()); lightPacket.write(Type.VAR_INT, chunk.getZ());
@ -229,7 +229,7 @@ public class WorldPacketRewriter1_14 {
if (entityTracker.isForceSendCenterChunk() if (entityTracker.isForceSendCenterChunk()
|| diffX >= SERVERSIDE_VIEW_DISTANCE || diffX >= SERVERSIDE_VIEW_DISTANCE
|| diffZ >= 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.getX());
fakePosLook.write(Type.VAR_INT, chunk.getZ()); fakePosLook.write(Type.VAR_INT, chunk.getZ());
fakePosLook.send(Protocol1_13_2To1_14.class); 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 @Override
public void register() { public void register() {
map(Type.INT); // Effect Id 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -291,7 +291,7 @@ public class WorldPacketRewriter1_14 {
}); });
handler(wrapper -> { handler(wrapper -> {
short difficulty = wrapper.read(Type.UNSIGNED_BYTE); // 19w11a removed difficulty from respawn 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.UNSIGNED_BYTE, difficulty);
difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a difficultyPacket.write(Type.BOOLEAN, false); // Unknown value added in 19w11a
difficultyPacket.scheduleSend(protocol.getClass()); 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 @Override
public void register() { public void register() {
map(Type.POSITION1_8, Type.POSITION1_14); map(Type.POSITION1_8, Type.POSITION1_14);
@ -314,7 +314,7 @@ public class WorldPacketRewriter1_14 {
} }
static void sendViewDistancePacket(UserConnection connection) { 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.write(Type.VAR_INT, WorldPacketRewriter1_14.SERVERSIDE_VIEW_DISTANCE);
setViewDistance.send(Protocol1_13_2To1_14.class); setViewDistance.send(Protocol1_13_2To1_14.class);
} }

View File

@ -57,7 +57,7 @@ public class Protocol1_13To1_13_1 extends AbstractProtocol<ClientboundPackets1_1
EntityPacketRewriter1_13_1.register(this); EntityPacketRewriter1_13_1.register(this);
WorldPacketRewriter1_13_1.register(this); WorldPacketRewriter1_13_1.register(this);
registerServerbound(ServerboundPackets1_13.TAB_COMPLETE, new PacketHandlers() { registerServerbound(ServerboundPackets1_13.COMMAND_SUGGESTION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -89,7 +89,7 @@ public class Protocol1_13To1_13_1 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_13.TAB_COMPLETE, new PacketHandlers() { registerClientbound(ClientboundPackets1_13.COMMAND_SUGGESTIONS, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Transaction id map(Type.VAR_INT); // Transaction id
@ -109,7 +109,7 @@ public class Protocol1_13To1_13_1 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
registerClientbound(ClientboundPackets1_13.BOSSBAR, new PacketHandlers() { registerClientbound(ClientboundPackets1_13.BOSS_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UUID); map(Type.UUID);
@ -129,8 +129,8 @@ public class Protocol1_13To1_13_1 extends AbstractProtocol<ClientboundPackets1_1
} }
}); });
tagRewriter.register(ClientboundPackets1_13.TAGS, RegistryType.ITEM); tagRewriter.register(ClientboundPackets1_13.UPDATE_TAGS, RegistryType.ITEM);
new StatisticsRewriter<>(this).register(ClientboundPackets1_13.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_13.AWARD_STATS);
} }
@Override @Override

View File

@ -30,7 +30,7 @@ public class EntityPacketRewriter1_13_1 {
public static void register(Protocol1_13To1_13_1 protocol) { public static void register(Protocol1_13To1_13_1 protocol) {
MetadataRewriter1_13_1To1_13 metadataRewriter = protocol.get(MetadataRewriter1_13_1To1_13.class); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity id 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -98,7 +98,7 @@ public class EntityPacketRewriter1_13_1 {
} }
}); });
metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_13.REMOVE_ENTITIES);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.ENTITY_METADATA, Types1_13.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_13.SET_ENTITY_DATA, Types1_13.METADATA_LIST);
} }
} }

View File

@ -35,12 +35,12 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter<ClientboundPackets1_1
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetSlot(ClientboundPackets1_13.SET_SLOT); registerSetSlot(ClientboundPackets1_13.CONTAINER_SET_SLOT);
registerWindowItems(ClientboundPackets1_13.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_13.CONTAINER_SET_CONTENT);
registerAdvancements(ClientboundPackets1_13.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_13.UPDATE_ADVANCEMENTS);
registerSetCooldown(ClientboundPackets1_13.COOLDOWN); registerSetCooldown(ClientboundPackets1_13.COOLDOWN);
protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_13.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Channel map(Type.STRING); // Channel
@ -71,7 +71,7 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter<ClientboundPackets1_1
} }
}); });
registerEntityEquipment(ClientboundPackets1_13.ENTITY_EQUIPMENT); registerEntityEquipment(ClientboundPackets1_13.SET_EQUIPPED_ITEM);
RecipeRewriter<ClientboundPackets1_13> recipeRewriter = new RecipeRewriter<>(protocol) { RecipeRewriter<ClientboundPackets1_13> recipeRewriter = new RecipeRewriter<>(protocol) {
@Override @Override
@ -84,7 +84,7 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter<ClientboundPackets1_1
return Type.ITEM1_13_ARRAY; return Type.ITEM1_13_ARRAY;
} }
}; };
protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, wrapper -> { protocol.registerClientbound(ClientboundPackets1_13.UPDATE_RECIPES, wrapper -> {
int size = wrapper.passthrough(Type.VAR_INT); int size = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
// First id, then type // First id, then type
@ -94,9 +94,9 @@ public class ItemPacketRewriter1_13_1 extends ItemRewriter<ClientboundPackets1_1
} }
}); });
registerClickWindow(ServerboundPackets1_13.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_13.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_13.SET_CREATIVE_MODE_SLOT);
registerSpawnParticle(ClientboundPackets1_13.SPAWN_PARTICLE, Type.FLOAT); registerSpawnParticle(ClientboundPackets1_13.LEVEL_PARTICLES, Type.FLOAT);
} }
} }

View File

@ -34,7 +34,7 @@ public class WorldPacketRewriter1_13_1 {
public static void register(Protocol1_13To1_13_1 protocol) { public static void register(Protocol1_13To1_13_1 protocol) {
BlockRewriter<ClientboundPackets1_13> blockRewriter = BlockRewriter.legacy(protocol); BlockRewriter<ClientboundPackets1_13> 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); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
Chunk chunk = wrapper.passthrough(ChunkType1_13.forEnvironment(clientWorld.getEnvironment())); 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.registerBlockAction(ClientboundPackets1_13.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_13.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_13.BLOCK_UPDATE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.MULTI_BLOCK_CHANGE); blockRewriter.registerMultiBlockChange(ClientboundPackets1_13.CHUNK_BLOCKS_UPDATE);
protocol.registerClientbound(ClientboundPackets1_13.EFFECT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_13.LEVEL_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Effect Id 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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Entity ID map(Type.INT); // 0 - Entity ID

View File

@ -30,7 +30,7 @@ public class Protocol1_14_2To1_14_3 extends AbstractProtocol<ClientboundPackets1
@Override @Override
protected void registerPackets() { protected void registerPackets() {
registerClientbound(ClientboundPackets1_14.TRADE_LIST, wrapper -> { registerClientbound(ClientboundPackets1_14.MERCHANT_OFFERS, wrapper -> {
wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.VAR_INT);
int size = wrapper.passthrough(Type.UNSIGNED_BYTE); int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {

View File

@ -31,7 +31,7 @@ public class Protocol1_14_3To1_14_4 extends AbstractProtocol<ClientboundPackets1
@Override @Override
protected void registerPackets() { protected void registerPackets() {
registerClientbound(ClientboundPackets1_14.TRADE_LIST, wrapper -> { registerClientbound(ClientboundPackets1_14.MERCHANT_OFFERS, wrapper -> {
wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.VAR_INT);
int size = wrapper.passthrough(Type.UNSIGNED_BYTE); int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {

View File

@ -21,99 +21,99 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_14_4 implements ClientboundPacketType { public enum ClientboundPackets1_14_4 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E CHAT, // 0x0E
MULTI_BLOCK_CHANGE, // 0x0F CHUNK_BLOCKS_UPDATE, // 0x0F
TAB_COMPLETE, // 0x10 COMMAND_SUGGESTIONS, // 0x10
DECLARE_COMMANDS, // 0x11 COMMANDS, // 0x11
WINDOW_CONFIRMATION, // 0x12 CONTAINER_ACK, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
KEEP_ALIVE, // 0x20 KEEP_ALIVE, // 0x20
CHUNK_DATA, // 0x21 LEVEL_CHUNK, // 0x21
EFFECT, // 0x22 LEVEL_EVENT, // 0x22
SPAWN_PARTICLE, // 0x23 LEVEL_PARTICLES, // 0x23
UPDATE_LIGHT, // 0x24 LIGHT_UPDATE, // 0x24
JOIN_GAME, // 0x25 LOGIN, // 0x25
MAP_DATA, // 0x26 MAP_ITEM_DATA, // 0x26
TRADE_LIST, // 0x27 MERCHANT_OFFERS, // 0x27
ENTITY_POSITION, // 0x28 MOVE_ENTITY_POS, // 0x28
ENTITY_POSITION_AND_ROTATION, // 0x29 MOVE_ENTITY_POS_ROT, // 0x29
ENTITY_ROTATION, // 0x2A MOVE_ENTITY_ROT, // 0x2A
ENTITY_MOVEMENT, // 0x2B MOVE_ENTITY, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
CRAFT_RECIPE_RESPONSE, // 0x30 PLACE_GHOST_RECIPE, // 0x30
PLAYER_ABILITIES, // 0x31 PLAYER_ABILITIES, // 0x31
COMBAT_EVENT, // 0x32 PLAYER_COMBAT, // 0x32
PLAYER_INFO, // 0x33 PLAYER_INFO, // 0x33
FACE_PLAYER, // 0x34 PLAYER_LOOK_AT, // 0x34
PLAYER_POSITION, // 0x35 PLAYER_POSITION, // 0x35
UNLOCK_RECIPES, // 0x36 RECIPE, // 0x36
DESTROY_ENTITIES, // 0x37 REMOVE_ENTITIES, // 0x37
REMOVE_ENTITY_EFFECT, // 0x38 REMOVE_MOB_EFFECT, // 0x38
RESOURCE_PACK, // 0x39 RESOURCE_PACK, // 0x39
RESPAWN, // 0x3A RESPAWN, // 0x3A
ENTITY_HEAD_LOOK, // 0x3B ROTATE_HEAD, // 0x3B
SELECT_ADVANCEMENTS_TAB, // 0x3C SELECT_ADVANCEMENTS_TAB, // 0x3C
WORLD_BORDER, // 0x3D SET_BORDER, // 0x3D
CAMERA, // 0x3E SET_CAMERA, // 0x3E
HELD_ITEM_CHANGE, // 0x3F SET_CARRIED_ITEM, // 0x3F
UPDATE_VIEW_POSITION, // 0x40 SET_CHUNK_CACHE_CENTER, // 0x40
UPDATE_VIEW_DISTANCE, // 0x41 SET_CHUNK_CACHE_RADIUS, // 0x41
DISPLAY_SCOREBOARD, // 0x42 SET_DISPLAY_OBJECTIVE, // 0x42
ENTITY_METADATA, // 0x43 SET_ENTITY_DATA, // 0x43
ATTACH_ENTITY, // 0x44 SET_ENTITY_LINK, // 0x44
ENTITY_VELOCITY, // 0x45 SET_ENTITY_MOTION, // 0x45
ENTITY_EQUIPMENT, // 0x46 SET_EQUIPPED_ITEM, // 0x46
SET_EXPERIENCE, // 0x47 SET_EXPERIENCE, // 0x47
UPDATE_HEALTH, // 0x48 SET_HEALTH, // 0x48
SCOREBOARD_OBJECTIVE, // 0x49 SET_OBJECTIVE, // 0x49
SET_PASSENGERS, // 0x4A SET_PASSENGERS, // 0x4A
TEAMS, // 0x4B SET_PLAYER_TEAM, // 0x4B
UPDATE_SCORE, // 0x4C SET_SCORE, // 0x4C
SPAWN_POSITION, // 0x4D SET_DEFAULT_SPAWN_POSITION, // 0x4D
TIME_UPDATE, // 0x4E SET_TIME, // 0x4E
TITLE, // 0x4F SET_TITLES, // 0x4F
ENTITY_SOUND, // 0x50 SOUND_ENTITY, // 0x50
SOUND, // 0x51 SOUND, // 0x51
STOP_SOUND, // 0x52 STOP_SOUND, // 0x52
TAB_LIST, // 0x53 TAB_LIST, // 0x53
NBT_QUERY, // 0x54 TAG_QUERY, // 0x54
COLLECT_ITEM, // 0x55 TAKE_ITEM_ENTITY, // 0x55
ENTITY_TELEPORT, // 0x56 TELEPORT_ENTITY, // 0x56
ADVANCEMENTS, // 0x57 UPDATE_ADVANCEMENTS, // 0x57
ENTITY_PROPERTIES, // 0x58 UPDATE_ATTRIBUTES, // 0x58
ENTITY_EFFECT, // 0x59 UPDATE_MOB_EFFECT, // 0x59
DECLARE_RECIPES, // 0x5A UPDATE_RECIPES, // 0x5A
TAGS, // 0x5B UPDATE_TAGS, // 0x5B
ACKNOWLEDGE_PLAYER_DIGGING; // 0x5C BLOCK_BREAK_ACK; // 0x5C
@Override @Override
public int getId() { public int getId() {

View File

@ -55,14 +55,14 @@ public class Protocol1_14_4To1_15 extends AbstractProtocol<ClientboundPackets1_1
WorldPacketRewriter1_15.register(this); WorldPacketRewriter1_15.register(this);
SoundRewriter<ClientboundPackets1_14_4> soundRewriter = new SoundRewriter<>(this); SoundRewriter<ClientboundPackets1_14_4> 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); 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))); 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 @Override

View File

@ -34,12 +34,12 @@ public class MetadataRewriter1_15To1_14_4 extends EntityRewriter<ClientboundPack
@Override @Override
protected void registerRewrites() { protected void registerRewrites() {
registerMetaTypeHandler(Types1_14.META_TYPES.itemType, Types1_14.META_TYPES.blockStateType, Types1_14.META_TYPES.particleType); registerMetaTypeHandler(Types1_14.META_TYPES.itemType, Types1_14.META_TYPES.blockStateType, Types1_14.META_TYPES.particleType);
filter().type(EntityTypes1_15.MINECART_ABSTRACT).index(10).handler((metadatas, meta) -> { filter().type(EntityTypes1_15.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> {
int data = meta.value(); int data = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); 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); filter().type(EntityTypes1_15.WOLF).removeIndex(18);
} }

View File

@ -21,99 +21,99 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_15 implements ClientboundPacketType { public enum ClientboundPackets1_15 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_GLOBAL_ENTITY, // 0x02 ADD_GLOBAL_ENTITY, // 0x02
SPAWN_MOB, // 0x03 ADD_MOB, // 0x03
SPAWN_PAINTING, // 0x04 ADD_PAINTING, // 0x04
SPAWN_PLAYER, // 0x05 ADD_PLAYER, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 BLOCK_BREAK_ACK, // 0x08
BLOCK_BREAK_ANIMATION, // 0x09 BLOCK_DESTRUCTION, // 0x09
BLOCK_ENTITY_DATA, // 0x0A BLOCK_ENTITY_DATA, // 0x0A
BLOCK_ACTION, // 0x0B BLOCK_EVENT, // 0x0B
BLOCK_CHANGE, // 0x0C BLOCK_UPDATE, // 0x0C
BOSSBAR, // 0x0D BOSS_EVENT, // 0x0D
SERVER_DIFFICULTY, // 0x0E CHANGE_DIFFICULTY, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
MULTI_BLOCK_CHANGE, // 0x10 CHUNK_BLOCKS_UPDATE, // 0x10
TAB_COMPLETE, // 0x11 COMMAND_SUGGESTIONS, // 0x11
DECLARE_COMMANDS, // 0x12 COMMANDS, // 0x12
WINDOW_CONFIRMATION, // 0x13 CONTAINER_ACK, // 0x13
CLOSE_WINDOW, // 0x14 CONTAINER_CLOSE, // 0x14
WINDOW_ITEMS, // 0x15 CONTAINER_SET_CONTENT, // 0x15
WINDOW_PROPERTY, // 0x16 CONTAINER_SET_DATA, // 0x16
SET_SLOT, // 0x17 CONTAINER_SET_SLOT, // 0x17
COOLDOWN, // 0x18 COOLDOWN, // 0x18
PLUGIN_MESSAGE, // 0x19 CUSTOM_PAYLOAD, // 0x19
NAMED_SOUND, // 0x1A CUSTOM_SOUND, // 0x1A
DISCONNECT, // 0x1B DISCONNECT, // 0x1B
ENTITY_STATUS, // 0x1C ENTITY_EVENT, // 0x1C
EXPLOSION, // 0x1D EXPLODE, // 0x1D
UNLOAD_CHUNK, // 0x1E FORGET_LEVEL_CHUNK, // 0x1E
GAME_EVENT, // 0x1F GAME_EVENT, // 0x1F
OPEN_HORSE_WINDOW, // 0x20 HORSE_SCREEN_OPEN, // 0x20
KEEP_ALIVE, // 0x21 KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22 LEVEL_CHUNK, // 0x22
EFFECT, // 0x23 LEVEL_EVENT, // 0x23
SPAWN_PARTICLE, // 0x24 LEVEL_PARTICLES, // 0x24
UPDATE_LIGHT, // 0x25 LIGHT_UPDATE, // 0x25
JOIN_GAME, // 0x26 LOGIN, // 0x26
MAP_DATA, // 0x27 MAP_ITEM_DATA, // 0x27
TRADE_LIST, // 0x28 MERCHANT_OFFERS, // 0x28
ENTITY_POSITION, // 0x29 MOVE_ENTITY_POS, // 0x29
ENTITY_POSITION_AND_ROTATION, // 0x2A MOVE_ENTITY_POS_ROT, // 0x2A
ENTITY_ROTATION, // 0x2B MOVE_ENTITY_ROT, // 0x2B
ENTITY_MOVEMENT, // 0x2C MOVE_ENTITY, // 0x2C
VEHICLE_MOVE, // 0x2D MOVE_VEHICLE, // 0x2D
OPEN_BOOK, // 0x2E OPEN_BOOK, // 0x2E
OPEN_WINDOW, // 0x2F OPEN_SCREEN, // 0x2F
OPEN_SIGN_EDITOR, // 0x30 OPEN_SIGN_EDITOR, // 0x30
CRAFT_RECIPE_RESPONSE, // 0x31 PLACE_GHOST_RECIPE, // 0x31
PLAYER_ABILITIES, // 0x32 PLAYER_ABILITIES, // 0x32
COMBAT_EVENT, // 0x33 PLAYER_COMBAT, // 0x33
PLAYER_INFO, // 0x34 PLAYER_INFO, // 0x34
FACE_PLAYER, // 0x35 PLAYER_LOOK_AT, // 0x35
PLAYER_POSITION, // 0x36 PLAYER_POSITION, // 0x36
UNLOCK_RECIPES, // 0x37 RECIPE, // 0x37
DESTROY_ENTITIES, // 0x38 REMOVE_ENTITIES, // 0x38
REMOVE_ENTITY_EFFECT, // 0x39 REMOVE_MOB_EFFECT, // 0x39
RESOURCE_PACK, // 0x3A RESOURCE_PACK, // 0x3A
RESPAWN, // 0x3B RESPAWN, // 0x3B
ENTITY_HEAD_LOOK, // 0x3C ROTATE_HEAD, // 0x3C
SELECT_ADVANCEMENTS_TAB, // 0x3D SELECT_ADVANCEMENTS_TAB, // 0x3D
WORLD_BORDER, // 0x3E SET_BORDER, // 0x3E
CAMERA, // 0x3F SET_CAMERA, // 0x3F
HELD_ITEM_CHANGE, // 0x40 SET_CARRIED_ITEM, // 0x40
UPDATE_VIEW_POSITION, // 0x41 SET_CHUNK_CACHE_CENTER, // 0x41
UPDATE_VIEW_DISTANCE, // 0x42 SET_CHUNK_CACHE_RADIUS, // 0x42
DISPLAY_SCOREBOARD, // 0x43 SET_DISPLAY_OBJECTIVE, // 0x43
ENTITY_METADATA, // 0x44 SET_ENTITY_DATA, // 0x44
ATTACH_ENTITY, // 0x45 SET_ENTITY_LINK, // 0x45
ENTITY_VELOCITY, // 0x46 SET_ENTITY_MOTION, // 0x46
ENTITY_EQUIPMENT, // 0x47 SET_EQUIPPED_ITEM, // 0x47
SET_EXPERIENCE, // 0x48 SET_EXPERIENCE, // 0x48
UPDATE_HEALTH, // 0x49 SET_HEALTH, // 0x49
SCOREBOARD_OBJECTIVE, // 0x4A SET_OBJECTIVE, // 0x4A
SET_PASSENGERS, // 0x4B SET_PASSENGERS, // 0x4B
TEAMS, // 0x4C SET_PLAYER_TEAM, // 0x4C
UPDATE_SCORE, // 0x4D SET_SCORE, // 0x4D
SPAWN_POSITION, // 0x4E SET_DEFAULT_SPAWN_POSITION, // 0x4E
TIME_UPDATE, // 0x4F SET_TIME, // 0x4F
TITLE, // 0x50 SET_TITLES, // 0x50
ENTITY_SOUND, // 0x51 SOUND_ENTITY, // 0x51
SOUND, // 0x52 SOUND, // 0x52
STOP_SOUND, // 0x53 STOP_SOUND, // 0x53
TAB_LIST, // 0x54 TAB_LIST, // 0x54
NBT_QUERY, // 0x55 TAG_QUERY, // 0x55
COLLECT_ITEM, // 0x56 TAKE_ITEM_ENTITY, // 0x56
ENTITY_TELEPORT, // 0x57 TELEPORT_ENTITY, // 0x57
ADVANCEMENTS, // 0x58 UPDATE_ADVANCEMENTS, // 0x58
ENTITY_PROPERTIES, // 0x59 UPDATE_ATTRIBUTES, // 0x59
ENTITY_EFFECT, // 0x5A UPDATE_MOB_EFFECT, // 0x5A
DECLARE_RECIPES, // 0x5B UPDATE_RECIPES, // 0x5B
TAGS; // 0x5C UPDATE_TAGS; // 0x5C
@Override @Override
public int getId() { public int getId() {

View File

@ -36,9 +36,9 @@ public final class EntityPacketRewriter1_15 {
public static void register(Protocol1_14_4To1_15 protocol) { public static void register(Protocol1_14_4To1_15 protocol) {
MetadataRewriter1_15To1_14_4 metadataRewriter = protocol.get(MetadataRewriter1_15To1_14_4.class); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.INT); // 0 - Entity ID 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.registerMetadataRewriter(ClientboundPackets1_14_4.SET_ENTITY_DATA, Types1_14.METADATA_LIST);
metadataRewriter.registerRemoveEntities(ClientboundPackets1_14_4.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_14_4.REMOVE_ENTITIES);
} }
private static void sendMetadataPacket(PacketWrapper wrapper, int entityId, EntityRewriter<?, ?> rewriter) { private static void sendMetadataPacket(PacketWrapper wrapper, int entityId, EntityRewriter<?, ?> rewriter) {
@ -123,7 +123,7 @@ public final class EntityPacketRewriter1_15 {
// Handle meta // Handle meta
rewriter.handleMetadata(entityId, metadata, wrapper.user()); 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(Type.VAR_INT, entityId);
metadataPacket.write(Types1_14.METADATA_LIST, metadata); metadataPacket.write(Types1_14.METADATA_LIST, metadata);
metadataPacket.send(Protocol1_14_4To1_15.class); metadataPacket.send(Protocol1_14_4To1_15.class);

View File

@ -33,15 +33,15 @@ public class ItemPacketRewriter1_15 extends ItemRewriter<ClientboundPackets1_14_
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_14_4.COOLDOWN); registerSetCooldown(ClientboundPackets1_14_4.COOLDOWN);
registerWindowItems(ClientboundPackets1_14_4.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_14_4.CONTAINER_SET_CONTENT);
registerTradeList(ClientboundPackets1_14_4.TRADE_LIST); registerTradeList(ClientboundPackets1_14_4.MERCHANT_OFFERS);
registerSetSlot(ClientboundPackets1_14_4.SET_SLOT); registerSetSlot(ClientboundPackets1_14_4.CONTAINER_SET_SLOT);
registerEntityEquipment(ClientboundPackets1_14_4.ENTITY_EQUIPMENT); registerEntityEquipment(ClientboundPackets1_14_4.SET_EQUIPPED_ITEM);
registerAdvancements(ClientboundPackets1_14_4.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_14_4.UPDATE_ADVANCEMENTS);
new RecipeRewriter<>(protocol).register(ClientboundPackets1_14_4.DECLARE_RECIPES); new RecipeRewriter<>(protocol).register(ClientboundPackets1_14_4.UPDATE_RECIPES);
registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_14.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_14.SET_CREATIVE_MODE_SLOT);
} }
} }

View File

@ -34,12 +34,12 @@ public final class WorldPacketRewriter1_15 {
public static void register(Protocol1_14_4To1_15 protocol) { public static void register(Protocol1_14_4To1_15 protocol) {
BlockRewriter<ClientboundPackets1_14_4> blockRewriter = BlockRewriter.for1_14(protocol); BlockRewriter<ClientboundPackets1_14_4> blockRewriter = BlockRewriter.for1_14(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_14_4.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_14_4.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_14_4.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_14_4.BLOCK_UPDATE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_14_4.MULTI_BLOCK_CHANGE); blockRewriter.registerMultiBlockChange(ClientboundPackets1_14_4.CHUNK_BLOCKS_UPDATE);
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_14_4.ACKNOWLEDGE_PLAYER_DIGGING); 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); Chunk chunk = wrapper.read(ChunkType1_14.TYPE);
wrapper.write(ChunkType1_15.TYPE, chunk); wrapper.write(ChunkType1_15.TYPE, chunk);
@ -79,8 +79,8 @@ public final class WorldPacketRewriter1_15 {
} }
}); });
blockRewriter.registerEffect(ClientboundPackets1_14_4.EFFECT, 1010, 2001); blockRewriter.registerEffect(ClientboundPackets1_14_4.LEVEL_EVENT, 1010, 2001);
protocol.registerClientbound(ClientboundPackets1_14_4.SPAWN_PARTICLE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_14_4.LEVEL_PARTICLES, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // 0 - Particle ID map(Type.INT); // 0 - Particle ID

View File

@ -30,7 +30,7 @@ public class EntityPacketRewriter1_14_1 {
public static void register(Protocol1_14To1_14_1 protocol) { public static void register(Protocol1_14To1_14_1 protocol) {
MetadataRewriter1_14_1To1_14 metadataRewriter = protocol.get(MetadataRewriter1_14_1To1_14.class); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID 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);
} }
} }

View File

@ -78,9 +78,9 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
EntityPacketRewriter1_16.register(this); EntityPacketRewriter1_16.register(this);
WorldPacketRewriter1_16.register(this); WorldPacketRewriter1_16.register(this);
tagRewriter.register(ClientboundPackets1_15.TAGS, RegistryType.ENTITY); tagRewriter.register(ClientboundPackets1_15.UPDATE_TAGS, RegistryType.ENTITY);
new StatisticsRewriter<>(this).register(ClientboundPackets1_15.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_15.AWARD_STATS);
// Login Success // Login Success
registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), wrapper -> { registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), wrapper -> {
@ -125,7 +125,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
}); });
// Handle (relevant) component cases for translatable and score changes // Handle (relevant) component cases for translatable and score changes
registerClientbound(ClientboundPackets1_15.CHAT_MESSAGE, new PacketHandlers() { registerClientbound(ClientboundPackets1_15.CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.COMPONENT); map(Type.COMPONENT);
@ -136,15 +136,15 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
}); });
} }
}); });
componentRewriter.registerBossBar(ClientboundPackets1_15.BOSSBAR); componentRewriter.registerBossBar(ClientboundPackets1_15.BOSS_EVENT);
componentRewriter.registerTitle(ClientboundPackets1_15.TITLE); componentRewriter.registerTitle(ClientboundPackets1_15.SET_TITLES);
componentRewriter.registerCombatEvent(ClientboundPackets1_15.COMBAT_EVENT); componentRewriter.registerCombatEvent(ClientboundPackets1_15.PLAYER_COMBAT);
SoundRewriter<ClientboundPackets1_15> soundRewriter = new SoundRewriter<>(this); SoundRewriter<ClientboundPackets1_15> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound(ClientboundPackets1_15.SOUND); 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 wrapper.passthrough(Type.VAR_INT); // Entity Id
int action = wrapper.passthrough(Type.VAR_INT); int action = wrapper.passthrough(Type.VAR_INT);
if (action == 0 || action == 2) { if (action == 0 || action == 2) {
@ -163,7 +163,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
}); });
if (Via.getConfig().isIgnoreLong1_16ChannelNames()) { if (Via.getConfig().isIgnoreLong1_16ChannelNames()) {
registerServerbound(ServerboundPackets1_16.PLUGIN_MESSAGE, new PacketHandlers() { registerServerbound(ServerboundPackets1_16.CUSTOM_PAYLOAD, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Channel map(Type.STRING); // Channel
@ -210,8 +210,8 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
wrapper.write(Type.FLOAT, playerAbilities.getWalkingSpeed(wrapper.user())); wrapper.write(Type.FLOAT, playerAbilities.getWalkingSpeed(wrapper.user()));
}); });
cancelServerbound(ServerboundPackets1_16.GENERATE_JIGSAW); cancelServerbound(ServerboundPackets1_16.JIGSAW_GENERATE);
cancelServerbound(ServerboundPackets1_16.UPDATE_JIGSAW_BLOCK); cancelServerbound(ServerboundPackets1_16.SET_JIGSAW_BLOCK);
} }
@Override @Override

View File

@ -35,7 +35,7 @@ public class MetadataRewriter1_16To1_15_2 extends EntityRewriter<ClientboundPack
protected void registerRewrites() { protected void registerRewrites() {
filter().mapMetaType(Types1_16.META_TYPES::byId); filter().mapMetaType(Types1_16.META_TYPES::byId);
registerMetaTypeHandler(Types1_16.META_TYPES.itemType, Types1_16.META_TYPES.blockStateType, Types1_16.META_TYPES.particleType); registerMetaTypeHandler(Types1_16.META_TYPES.itemType, Types1_16.META_TYPES.blockStateType, Types1_16.META_TYPES.particleType);
filter().type(EntityTypes1_16.MINECART_ABSTRACT).index(10).handler((metadatas, meta) -> { filter().type(EntityTypes1_16.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> {
int data = meta.value(); int data = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));
}); });

View File

@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_16 implements ClientboundPacketType { public enum ClientboundPackets1_16 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_MOB, // 0x02 ADD_MOB, // 0x02
SPAWN_PAINTING, // 0x03 ADD_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04 ADD_PLAYER, // 0x04
ENTITY_ANIMATION, // 0x05 ANIMATE, // 0x05
STATISTICS, // 0x06 AWARD_STATS, // 0x06
ACKNOWLEDGE_PLAYER_DIGGING, // 0x07 BLOCK_BREAK_ACK, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E CHAT, // 0x0E
MULTI_BLOCK_CHANGE, // 0x0F CHUNK_BLOCKS_UPDATE, // 0x0F
TAB_COMPLETE, // 0x10 COMMAND_SUGGESTIONS, // 0x10
DECLARE_COMMANDS, // 0x11 COMMANDS, // 0x11
WINDOW_CONFIRMATION, // 0x12 CONTAINER_ACK, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
KEEP_ALIVE, // 0x20 KEEP_ALIVE, // 0x20
CHUNK_DATA, // 0x21 LEVEL_CHUNK, // 0x21
EFFECT, // 0x22 LEVEL_EVENT, // 0x22
SPAWN_PARTICLE, // 0x23 LEVEL_PARTICLES, // 0x23
UPDATE_LIGHT, // 0x24 LIGHT_UPDATE, // 0x24
JOIN_GAME, // 0x25 LOGIN, // 0x25
MAP_DATA, // 0x26 MAP_ITEM_DATA, // 0x26
TRADE_LIST, // 0x27 MERCHANT_OFFERS, // 0x27
ENTITY_POSITION, // 0x28 MOVE_ENTITY_POS, // 0x28
ENTITY_POSITION_AND_ROTATION, // 0x29 MOVE_ENTITY_POS_ROT, // 0x29
ENTITY_ROTATION, // 0x2A MOVE_ENTITY_ROT, // 0x2A
ENTITY_MOVEMENT, // 0x2B MOVE_ENTITY, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
CRAFT_RECIPE_RESPONSE, // 0x30 PLACE_GHOST_RECIPE, // 0x30
PLAYER_ABILITIES, // 0x31 PLAYER_ABILITIES, // 0x31
COMBAT_EVENT, // 0x32 PLAYER_COMBAT, // 0x32
PLAYER_INFO, // 0x33 PLAYER_INFO, // 0x33
FACE_PLAYER, // 0x34 PLAYER_LOOK_AT, // 0x34
PLAYER_POSITION, // 0x35 PLAYER_POSITION, // 0x35
UNLOCK_RECIPES, // 0x36 RECIPE, // 0x36
DESTROY_ENTITIES, // 0x37 REMOVE_ENTITIES, // 0x37
REMOVE_ENTITY_EFFECT, // 0x38 REMOVE_MOB_EFFECT, // 0x38
RESOURCE_PACK, // 0x39 RESOURCE_PACK, // 0x39
RESPAWN, // 0x3A RESPAWN, // 0x3A
ENTITY_HEAD_LOOK, // 0x3B ROTATE_HEAD, // 0x3B
SELECT_ADVANCEMENTS_TAB, // 0x3C SELECT_ADVANCEMENTS_TAB, // 0x3C
WORLD_BORDER, // 0x3D SET_BORDER, // 0x3D
CAMERA, // 0x3E SET_CAMERA, // 0x3E
HELD_ITEM_CHANGE, // 0x3F SET_CARRIED_ITEM, // 0x3F
UPDATE_VIEW_POSITION, // 0x40 SET_CHUNK_CACHE_CENTER, // 0x40
UPDATE_VIEW_DISTANCE, // 0x41 SET_CHUNK_CACHE_RADIUS, // 0x41
SPAWN_POSITION, // 0x42 SET_DEFAULT_SPAWN_POSITION, // 0x42
DISPLAY_SCOREBOARD, // 0x43 SET_DISPLAY_OBJECTIVE, // 0x43
ENTITY_METADATA, // 0x44 SET_ENTITY_DATA, // 0x44
ATTACH_ENTITY, // 0x45 SET_ENTITY_LINK, // 0x45
ENTITY_VELOCITY, // 0x46 SET_ENTITY_MOTION, // 0x46
ENTITY_EQUIPMENT, // 0x47 SET_EQUIPMENT, // 0x47
SET_EXPERIENCE, // 0x48 SET_EXPERIENCE, // 0x48
UPDATE_HEALTH, // 0x49 SET_HEALTH, // 0x49
SCOREBOARD_OBJECTIVE, // 0x4A SET_OBJECTIVE, // 0x4A
SET_PASSENGERS, // 0x4B SET_PASSENGERS, // 0x4B
TEAMS, // 0x4C SET_PLAYER_TEAM, // 0x4C
UPDATE_SCORE, // 0x4D SET_SCORE, // 0x4D
TIME_UPDATE, // 0x4E SET_TIME, // 0x4E
TITLE, // 0x4F SET_TITLES, // 0x4F
ENTITY_SOUND, // 0x50 SOUND_ENTITY, // 0x50
SOUND, // 0x51 SOUND, // 0x51
STOP_SOUND, // 0x52 STOP_SOUND, // 0x52
TAB_LIST, // 0x53 TAB_LIST, // 0x53
NBT_QUERY, // 0x54 TAG_QUERY, // 0x54
COLLECT_ITEM, // 0x55 TAKE_ITEM_ENTITY, // 0x55
ENTITY_TELEPORT, // 0x56 TELEPORT_ENTITY, // 0x56
ADVANCEMENTS, // 0x57 UPDATE_ADVANCEMENTS, // 0x57
ENTITY_PROPERTIES, // 0x58 UPDATE_ATTRIBUTES, // 0x58
ENTITY_EFFECT, // 0x59 UPDATE_MOB_EFFECT, // 0x59
DECLARE_RECIPES, // 0x5A UPDATE_RECIPES, // 0x5A
TAGS; // 0x5B UPDATE_TAGS; // 0x5B
@Override @Override
public int getId() { public int getId() {

View File

@ -21,52 +21,52 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_16 implements ServerboundPacketType { public enum ServerboundPackets1_16 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_MESSAGE, // 0x03 CHAT, // 0x03
CLIENT_STATUS, // 0x04 CLIENT_COMMAND, // 0x04
CLIENT_SETTINGS, // 0x05 CLIENT_INFORMATION, // 0x05
TAB_COMPLETE, // 0x06 COMMAND_SUGGESTION, // 0x06
WINDOW_CONFIRMATION, // 0x07 CONTAINER_ACK, // 0x07
CLICK_WINDOW_BUTTON, // 0x08 CONTAINER_BUTTON_CLICK, // 0x08
CLICK_WINDOW, // 0x09 CONTAINER_CLICK, // 0x09
CLOSE_WINDOW, // 0x0A CONTAINER_CLOSE, // 0x0A
PLUGIN_MESSAGE, // 0x0B CUSTOM_PAYLOAD, // 0x0B
EDIT_BOOK, // 0x0C EDIT_BOOK, // 0x0C
ENTITY_NBT_REQUEST, // 0x0D ENTITY_TAG_QUERY, // 0x0D
INTERACT_ENTITY, // 0x0E INTERACT, // 0x0E
GENERATE_JIGSAW, // 0x0F JIGSAW_GENERATE, // 0x0F
KEEP_ALIVE, // 0x10 KEEP_ALIVE, // 0x10
LOCK_DIFFICULTY, // 0x11 LOCK_DIFFICULTY, // 0x11
PLAYER_POSITION, // 0x12 MOVE_PLAYER_POS, // 0x12
PLAYER_POSITION_AND_ROTATION, // 0x13 MOVE_PLAYER_POS_ROT, // 0x13
PLAYER_ROTATION, // 0x14 MOVE_PLAYER_ROT, // 0x14
PLAYER_MOVEMENT, // 0x15 MOVE_PLAYER_STATUS_ONLY, // 0x15
VEHICLE_MOVE, // 0x16 MOVE_VEHICLE, // 0x16
STEER_BOAT, // 0x17 PADDLE_BOAT, // 0x17
PICK_ITEM, // 0x18 PICK_ITEM, // 0x18
CRAFT_RECIPE_REQUEST, // 0x19 PLACE_RECIPE, // 0x19
PLAYER_ABILITIES, // 0x1A PLAYER_ABILITIES, // 0x1A
PLAYER_DIGGING, // 0x1B PLAYER_ACTION, // 0x1B
ENTITY_ACTION, // 0x1C PLAYER_COMMAND, // 0x1C
STEER_VEHICLE, // 0x1D PLAYER_INPUT, // 0x1D
RECIPE_BOOK_DATA, // 0x1E RECIPE_BOOK_UPDATE, // 0x1E
RENAME_ITEM, // 0x1F RENAME_ITEM, // 0x1F
RESOURCE_PACK_STATUS, // 0x20 RESOURCE_PACK, // 0x20
ADVANCEMENT_TAB, // 0x21 SEEN_ADVANCEMENTS, // 0x21
SELECT_TRADE, // 0x22 SELECT_TRADE, // 0x22
SET_BEACON_EFFECT, // 0x23 SET_BEACON, // 0x23
HELD_ITEM_CHANGE, // 0x24 SET_CARRIED_ITEM, // 0x24
UPDATE_COMMAND_BLOCK, // 0x25 SET_COMMAND_BLOCK, // 0x25
UPDATE_COMMAND_BLOCK_MINECART, // 0x26 SET_COMMAND_MINECART, // 0x26
CREATIVE_INVENTORY_ACTION, // 0x27 SET_CREATIVE_MODE_SLOT, // 0x27
UPDATE_JIGSAW_BLOCK, // 0x28 SET_JIGSAW_BLOCK, // 0x28
UPDATE_STRUCTURE_BLOCK, // 0x29 SET_STRUCTURE_BLOCK, // 0x29
UPDATE_SIGN, // 0x2A SIGN_UPDATE, // 0x2A
ANIMATION, // 0x2B SWING, // 0x2B
SPECTATE, // 0x2C TELEPORT_TO_ENTITY, // 0x2C
PLAYER_BLOCK_PLACEMENT, // 0x2D USE_ITEM_ON, // 0x2D
USE_ITEM; // 0x2E USE_ITEM; // 0x2E
@Override @Override

View File

@ -160,7 +160,7 @@ public class EntityPacketRewriter1_16 {
MetadataRewriter1_16To1_15_2 metadataRewriter = protocol.get(MetadataRewriter1_16To1_15_2.class); MetadataRewriter1_16To1_15_2 metadataRewriter = protocol.get(MetadataRewriter1_16To1_15_2.class);
// Spawn lightning -> Spawn entity // 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); int entityId = wrapper.passthrough(Type.VAR_INT);
byte type = wrapper.read(Type.BYTE); byte type = wrapper.read(Type.BYTE);
if (type != 1) { if (type != 1) {
@ -185,11 +185,11 @@ public class EntityPacketRewriter1_16 {
wrapper.write(Type.SHORT, (short) 0); // velocity wrapper.write(Type.SHORT, (short) 0); // velocity
}); });
metadataRewriter.registerTrackerWithData(ClientboundPackets1_15.SPAWN_ENTITY, EntityTypes1_16.FALLING_BLOCK); metadataRewriter.registerTrackerWithData(ClientboundPackets1_15.ADD_ENTITY, EntityTypes1_16.FALLING_BLOCK);
metadataRewriter.registerTracker(ClientboundPackets1_15.SPAWN_MOB); metadataRewriter.registerTracker(ClientboundPackets1_15.ADD_MOB);
metadataRewriter.registerTracker(ClientboundPackets1_15.SPAWN_PLAYER, EntityTypes1_16.PLAYER); metadataRewriter.registerTracker(ClientboundPackets1_15.ADD_PLAYER, EntityTypes1_16.PLAYER);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_15.ENTITY_METADATA, Types1_14.METADATA_LIST, Types1_16.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_15.SET_ENTITY_DATA, Types1_14.METADATA_LIST, Types1_16.METADATA_LIST);
metadataRewriter.registerRemoveEntities(ClientboundPackets1_15.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_15.REMOVE_ENTITIES);
protocol.registerClientbound(ClientboundPackets1_15.RESPAWN, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.RESPAWN, new PacketHandlers() {
@Override @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 @Override
public void register() { public void register() {
map(Type.INT); // Entity ID 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); wrapper.passthrough(Type.VAR_INT);
int size = wrapper.passthrough(Type.INT); int size = wrapper.passthrough(Type.INT);
int actualSize = size; 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); InventoryTracker1_16 inventoryTracker = wrapper.user().get(InventoryTracker1_16.class);
// Don't send an arm swing if the player has an inventory opened. // Don't send an arm swing if the player has an inventory opened.
if (inventoryTracker.isInventoryOpen()) { if (inventoryTracker.isInventoryOpen()) {

View File

@ -50,14 +50,14 @@ public class ItemPacketRewriter1_16 extends ItemRewriter<ClientboundPackets1_15,
public void registerPackets() { public void registerPackets() {
// clear cursor item to prevent client to try dropping it during navigation between multiple inventories causing arm swing // clear cursor item to prevent client to try dropping it during navigation between multiple inventories causing arm swing
PacketHandler cursorRemapper = wrapper -> { PacketHandler cursorRemapper = wrapper -> {
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.UNSIGNED_BYTE, (short) -1);
clearPacket.write(Type.SHORT, (short) -1); clearPacket.write(Type.SHORT, (short) -1);
clearPacket.write(Type.ITEM1_13_2, null); clearPacket.write(Type.ITEM1_13_2, null);
clearPacket.send(Protocol1_15_2To1_16.class); clearPacket.send(Protocol1_15_2To1_16.class);
}; };
protocol.registerClientbound(ClientboundPackets1_15.OPEN_WINDOW, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.OPEN_SCREEN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Window Id map(Type.VAR_INT); // Window Id
@ -76,7 +76,7 @@ public class ItemPacketRewriter1_16 extends ItemRewriter<ClientboundPackets1_15,
} }
}); });
protocol.registerClientbound(ClientboundPackets1_15.CLOSE_WINDOW, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.CONTAINER_CLOSE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
handler(cursorRemapper); handler(cursorRemapper);
@ -87,7 +87,7 @@ public class ItemPacketRewriter1_16 extends ItemRewriter<ClientboundPackets1_15,
} }
}); });
protocol.registerClientbound(ClientboundPackets1_15.WINDOW_PROPERTY, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.CONTAINER_SET_DATA, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Window Id map(Type.UNSIGNED_BYTE); // Window Id
@ -107,12 +107,12 @@ public class ItemPacketRewriter1_16 extends ItemRewriter<ClientboundPackets1_15,
}); });
registerSetCooldown(ClientboundPackets1_15.COOLDOWN); registerSetCooldown(ClientboundPackets1_15.COOLDOWN);
registerWindowItems(ClientboundPackets1_15.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_15.CONTAINER_SET_CONTENT);
registerTradeList(ClientboundPackets1_15.TRADE_LIST); registerTradeList(ClientboundPackets1_15.MERCHANT_OFFERS);
registerSetSlot(ClientboundPackets1_15.SET_SLOT); registerSetSlot(ClientboundPackets1_15.CONTAINER_SET_SLOT);
registerAdvancements(ClientboundPackets1_15.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_15.UPDATE_ADVANCEMENTS);
protocol.registerClientbound(ClientboundPackets1_15.ENTITY_EQUIPMENT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.SET_EQUIPPED_ITEM, ClientboundPackets1_16.SET_EQUIPMENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // 0 - Entity ID map(Type.VAR_INT); // 0 - Entity ID
@ -125,19 +125,19 @@ public class ItemPacketRewriter1_16 extends ItemRewriter<ClientboundPackets1_15,
} }
}); });
new RecipeRewriter<>(protocol).register(ClientboundPackets1_15.DECLARE_RECIPES); new RecipeRewriter<>(protocol).register(ClientboundPackets1_15.UPDATE_RECIPES);
registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_16.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION); 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); InventoryTracker1_16 inventoryTracker = wrapper.user().get(InventoryTracker1_16.class);
inventoryTracker.setInventoryOpen(false); inventoryTracker.setInventoryOpen(false);
}); });
protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); 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 @Override

View File

@ -46,12 +46,12 @@ public class WorldPacketRewriter1_16 {
public static void register(Protocol1_15_2To1_16 protocol) { public static void register(Protocol1_15_2To1_16 protocol) {
BlockRewriter<ClientboundPackets1_15> blockRewriter = BlockRewriter.for1_14(protocol); BlockRewriter<ClientboundPackets1_15> blockRewriter = BlockRewriter.for1_14(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_15.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_15.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_UPDATE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_15.MULTI_BLOCK_CHANGE); blockRewriter.registerMultiBlockChange(ClientboundPackets1_15.CHUNK_BLOCKS_UPDATE);
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_15.ACKNOWLEDGE_PLAYER_DIGGING); blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_15.BLOCK_BREAK_ACK);
protocol.registerClientbound(ClientboundPackets1_15.UPDATE_LIGHT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_15.LIGHT_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // x 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); Chunk chunk = wrapper.read(ChunkType1_15.TYPE);
wrapper.write(ChunkType1_16.TYPE, chunk); wrapper.write(ChunkType1_16.TYPE, chunk);
@ -100,7 +100,7 @@ public class WorldPacketRewriter1_16 {
handleBlockEntity(protocol, wrapper.user(), tag); 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) { private static void handleBlockEntity(Protocol1_15_2To1_16 protocol, UserConnection connection, CompoundTag compoundTag) {

View File

@ -54,16 +54,16 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol<ClientboundPackets1
EntityPacketRewriter1_16_2.register(this); EntityPacketRewriter1_16_2.register(this);
WorldPacketRewriter1_16_2.register(this); WorldPacketRewriter1_16_2.register(this);
tagRewriter.register(ClientboundPackets1_16.TAGS, RegistryType.ENTITY); tagRewriter.register(ClientboundPackets1_16.UPDATE_TAGS, RegistryType.ENTITY);
new StatisticsRewriter<>(this).register(ClientboundPackets1_16.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_16.AWARD_STATS);
SoundRewriter<ClientboundPackets1_16> soundRewriter = new SoundRewriter<>(this); SoundRewriter<ClientboundPackets1_16> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound(ClientboundPackets1_16.SOUND); 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 // 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); int recipeType = wrapper.read(Type.VAR_INT);
boolean open = wrapper.read(Type.BOOLEAN); boolean open = wrapper.read(Type.BOOLEAN);
boolean filter = wrapper.read(Type.BOOLEAN); boolean filter = wrapper.read(Type.BOOLEAN);
@ -77,7 +77,7 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol<ClientboundPackets1
wrapper.write(Type.BOOLEAN, recipeType == 3 && open); // Smoker wrapper.write(Type.BOOLEAN, recipeType == 3 && open); // Smoker
wrapper.write(Type.BOOLEAN, filter); wrapper.write(Type.BOOLEAN, filter);
}); });
registerServerbound(ServerboundPackets1_16_2.SEEN_RECIPE, ServerboundPackets1_16.RECIPE_BOOK_DATA, wrapper -> { registerServerbound(ServerboundPackets1_16_2.RECIPE_BOOK_SEEN_RECIPE, ServerboundPackets1_16.RECIPE_BOOK_UPDATE, wrapper -> {
String recipe = wrapper.read(Type.STRING); String recipe = wrapper.read(Type.STRING);
wrapper.write(Type.VAR_INT, 0); // Shown wrapper.write(Type.VAR_INT, 0); // Shown
wrapper.write(Type.STRING, recipe); wrapper.write(Type.STRING, recipe);

View File

@ -33,7 +33,7 @@ public class MetadataRewriter1_16_2To1_16_1 extends EntityRewriter<ClientboundPa
@Override @Override
protected void registerRewrites() { protected void registerRewrites() {
registerMetaTypeHandler(Types1_16.META_TYPES.itemType, Types1_16.META_TYPES.blockStateType, Types1_16.META_TYPES.particleType); registerMetaTypeHandler(Types1_16.META_TYPES.itemType, Types1_16.META_TYPES.blockStateType, Types1_16.META_TYPES.particleType);
filter().type(EntityTypes1_16_2.MINECART_ABSTRACT).index(10).handler((metadatas, meta) -> { filter().type(EntityTypes1_16_2.ABSTRACT_MINECART).index(10).handler((metadatas, meta) -> {
int data = meta.value(); int data = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));
}); });

View File

@ -21,98 +21,98 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_16_2 implements ClientboundPacketType { public enum ClientboundPackets1_16_2 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_MOB, // 0x02 ADD_MOB, // 0x02
SPAWN_PAINTING, // 0x03 ADD_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04 ADD_PLAYER, // 0x04
ENTITY_ANIMATION, // 0x05 ANIMATE, // 0x05
STATISTICS, // 0x06 AWARD_STATS, // 0x06
ACKNOWLEDGE_PLAYER_DIGGING, // 0x07 BLOCK_BREAK_ACK, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08 BLOCK_DESTRUCTION, // 0x08
BLOCK_ENTITY_DATA, // 0x09 BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A BLOCK_EVENT, // 0x0A
BLOCK_CHANGE, // 0x0B BLOCK_UPDATE, // 0x0B
BOSSBAR, // 0x0C BOSS_EVENT, // 0x0C
SERVER_DIFFICULTY, // 0x0D CHANGE_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E CHAT, // 0x0E
TAB_COMPLETE, // 0x0F COMMAND_SUGGESTIONS, // 0x0F
DECLARE_COMMANDS, // 0x10 COMMANDS, // 0x10
WINDOW_CONFIRMATION, // 0x11 CONTAINER_ACK, // 0x11
CLOSE_WINDOW, // 0x12 CONTAINER_CLOSE, // 0x12
WINDOW_ITEMS, // 0x13 CONTAINER_SET_CONTENT, // 0x13
WINDOW_PROPERTY, // 0x14 CONTAINER_SET_DATA, // 0x14
SET_SLOT, // 0x15 CONTAINER_SET_SLOT, // 0x15
COOLDOWN, // 0x16 COOLDOWN, // 0x16
PLUGIN_MESSAGE, // 0x17 CUSTOM_PAYLOAD, // 0x17
NAMED_SOUND, // 0x18 CUSTOM_SOUND, // 0x18
DISCONNECT, // 0x19 DISCONNECT, // 0x19
ENTITY_STATUS, // 0x1A ENTITY_EVENT, // 0x1A
EXPLOSION, // 0x1B EXPLODE, // 0x1B
UNLOAD_CHUNK, // 0x1C FORGET_LEVEL_CHUNK, // 0x1C
GAME_EVENT, // 0x1D GAME_EVENT, // 0x1D
OPEN_HORSE_WINDOW, // 0x1E HORSE_SCREEN_OPEN, // 0x1E
KEEP_ALIVE, // 0x1F KEEP_ALIVE, // 0x1F
CHUNK_DATA, // 0x20 LEVEL_CHUNK, // 0x20
EFFECT, // 0x21 LEVEL_EVENT, // 0x21
SPAWN_PARTICLE, // 0x22 LEVEL_PARTICLES, // 0x22
UPDATE_LIGHT, // 0x23 LIGHT_UPDATE, // 0x23
JOIN_GAME, // 0x24 LOGIN, // 0x24
MAP_DATA, // 0x25 MAP_ITEM_DATA, // 0x25
TRADE_LIST, // 0x26 MERCHANT_OFFERS, // 0x26
ENTITY_POSITION, // 0x27 MOVE_ENTITY_POS, // 0x27
ENTITY_POSITION_AND_ROTATION, // 0x28 MOVE_ENTITY_POS_ROT, // 0x28
ENTITY_ROTATION, // 0x29 MOVE_ENTITY_ROT, // 0x29
ENTITY_MOVEMENT, // 0x2A MOVE_ENTITY, // 0x2A
VEHICLE_MOVE, // 0x2B MOVE_VEHICLE, // 0x2B
OPEN_BOOK, // 0x2C OPEN_BOOK, // 0x2C
OPEN_WINDOW, // 0x2D OPEN_SCREEN, // 0x2D
OPEN_SIGN_EDITOR, // 0x2E OPEN_SIGN_EDITOR, // 0x2E
CRAFT_RECIPE_RESPONSE, // 0x2F PLACE_GHOST_RECIPE, // 0x2F
PLAYER_ABILITIES, // 0x30 PLAYER_ABILITIES, // 0x30
COMBAT_EVENT, // 0x31 PLAYER_COMBAT, // 0x31
PLAYER_INFO, // 0x32 PLAYER_INFO, // 0x32
FACE_PLAYER, // 0x33 PLAYER_LOOK_AT, // 0x33
PLAYER_POSITION, // 0x34 PLAYER_POSITION, // 0x34
UNLOCK_RECIPES, // 0x35 RECIPE, // 0x35
DESTROY_ENTITIES, // 0x36 REMOVE_ENTITIES, // 0x36
REMOVE_ENTITY_EFFECT, // 0x37 REMOVE_MOB_EFFECT, // 0x37
RESOURCE_PACK, // 0x38 RESOURCE_PACK, // 0x38
RESPAWN, // 0x39 RESPAWN, // 0x39
ENTITY_HEAD_LOOK, // 0x3A ROTATE_HEAD, // 0x3A
MULTI_BLOCK_CHANGE, // 0x3B SECTION_BLOCKS_UPDATE, // 0x3B
SELECT_ADVANCEMENTS_TAB, // 0x3C SELECT_ADVANCEMENTS_TAB, // 0x3C
WORLD_BORDER, // 0x3D SET_BORDER, // 0x3D
CAMERA, // 0x3E SET_CAMERA, // 0x3E
HELD_ITEM_CHANGE, // 0x3F SET_CARRIED_ITEM, // 0x3F
UPDATE_VIEW_POSITION, // 0x40 SET_CHUNK_CACHE_CENTER, // 0x40
UPDATE_VIEW_DISTANCE, // 0x41 SET_CHUNK_CACHE_RADIUS, // 0x41
SPAWN_POSITION, // 0x42 SET_DEFAULT_SPAWN_POSITION, // 0x42
DISPLAY_SCOREBOARD, // 0x43 SET_DISPLAY_OBJECTIVE, // 0x43
ENTITY_METADATA, // 0x44 SET_ENTITY_DATA, // 0x44
ATTACH_ENTITY, // 0x45 SET_ENTITY_LINK, // 0x45
ENTITY_VELOCITY, // 0x46 SET_ENTITY_MOTION, // 0x46
ENTITY_EQUIPMENT, // 0x47 SET_EQUIPMENT, // 0x47
SET_EXPERIENCE, // 0x48 SET_EXPERIENCE, // 0x48
UPDATE_HEALTH, // 0x49 SET_HEALTH, // 0x49
SCOREBOARD_OBJECTIVE, // 0x4A SET_OBJECTIVE, // 0x4A
SET_PASSENGERS, // 0x4B SET_PASSENGERS, // 0x4B
TEAMS, // 0x4C SET_PLAYER_TEAM, // 0x4C
UPDATE_SCORE, // 0x4D SET_SCORE, // 0x4D
TIME_UPDATE, // 0x4E SET_TIME, // 0x4E
TITLE, // 0x4F SET_TITLES, // 0x4F
ENTITY_SOUND, // 0x50 SOUND_ENTITY, // 0x50
SOUND, // 0x51 SOUND, // 0x51
STOP_SOUND, // 0x52 STOP_SOUND, // 0x52
TAB_LIST, // 0x53 TAB_LIST, // 0x53
NBT_QUERY, // 0x54 TAG_QUERY, // 0x54
COLLECT_ITEM, // 0x55 TAKE_ITEM_ENTITY, // 0x55
ENTITY_TELEPORT, // 0x56 TELEPORT_ENTITY, // 0x56
ADVANCEMENTS, // 0x57 UPDATE_ADVANCEMENTS, // 0x57
ENTITY_PROPERTIES, // 0x58 UPDATE_ATTRIBUTES, // 0x58
ENTITY_EFFECT, // 0x59 UPDATE_MOB_EFFECT, // 0x59
DECLARE_RECIPES, // 0x5A UPDATE_RECIPES, // 0x5A
TAGS; // 0x5B UPDATE_TAGS; // 0x5B
@Override @Override
public int getId() { public int getId() {

View File

@ -21,53 +21,53 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_16_2 implements ServerboundPacketType { public enum ServerboundPackets1_16_2 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_MESSAGE, // 0x03 CHAT, // 0x03
CLIENT_STATUS, // 0x04 CLIENT_COMMAND, // 0x04
CLIENT_SETTINGS, // 0x05 CLIENT_INFORMATION, // 0x05
TAB_COMPLETE, // 0x06 COMMAND_SUGGESTION, // 0x06
WINDOW_CONFIRMATION, // 0x07 CONTAINER_ACK, // 0x07
CLICK_WINDOW_BUTTON, // 0x08 CONTAINER_BUTTON_CLICK, // 0x08
CLICK_WINDOW, // 0x09 CONTAINER_CLICK, // 0x09
CLOSE_WINDOW, // 0x0A CONTAINER_CLOSE, // 0x0A
PLUGIN_MESSAGE, // 0x0B CUSTOM_PAYLOAD, // 0x0B
EDIT_BOOK, // 0x0C EDIT_BOOK, // 0x0C
ENTITY_NBT_REQUEST, // 0x0D ENTITY_TAG_QUERY, // 0x0D
INTERACT_ENTITY, // 0x0E INTERACT, // 0x0E
GENERATE_JIGSAW, // 0x0F JIGSAW_GENERATE, // 0x0F
KEEP_ALIVE, // 0x10 KEEP_ALIVE, // 0x10
LOCK_DIFFICULTY, // 0x11 LOCK_DIFFICULTY, // 0x11
PLAYER_POSITION, // 0x12 MOVE_PLAYER_POS, // 0x12
PLAYER_POSITION_AND_ROTATION, // 0x13 MOVE_PLAYER_POS_ROT, // 0x13
PLAYER_ROTATION, // 0x14 MOVE_PLAYER_ROT, // 0x14
PLAYER_MOVEMENT, // 0x15 MOVE_PLAYER_STATUS_ONLY, // 0x15
VEHICLE_MOVE, // 0x16 MOVE_VEHICLE, // 0x16
STEER_BOAT, // 0x17 PADDLE_BOAT, // 0x17
PICK_ITEM, // 0x18 PICK_ITEM, // 0x18
CRAFT_RECIPE_REQUEST, // 0x19 PLACE_RECIPE, // 0x19
PLAYER_ABILITIES, // 0x1A PLAYER_ABILITIES, // 0x1A
PLAYER_DIGGING, // 0x1B PLAYER_ACTION, // 0x1B
ENTITY_ACTION, // 0x1C PLAYER_COMMAND, // 0x1C
STEER_VEHICLE, // 0x1D PLAYER_INPUT, // 0x1D
RECIPE_BOOK_DATA, // 0x1E RECIPE_BOOK_CHANGE_SETTINGS, // 0x1E
SEEN_RECIPE, // 0x1F RECIPE_BOOK_SEEN_RECIPE, // 0x1F
RENAME_ITEM, // 0x20 RENAME_ITEM, // 0x20
RESOURCE_PACK_STATUS, // 0x21 RESOURCE_PACK, // 0x21
ADVANCEMENT_TAB, // 0x22 SEEN_ADVANCEMENTS, // 0x22
SELECT_TRADE, // 0x23 SELECT_TRADE, // 0x23
SET_BEACON_EFFECT, // 0x24 SET_BEACON, // 0x24
HELD_ITEM_CHANGE, // 0x25 SET_CARRIED_ITEM, // 0x25
UPDATE_COMMAND_BLOCK, // 0x26 SET_COMMAND_BLOCK, // 0x26
UPDATE_COMMAND_BLOCK_MINECART, // 0x27 SET_COMMAND_MINECART, // 0x27
CREATIVE_INVENTORY_ACTION, // 0x28 SET_CREATIVE_MODE_SLOT, // 0x28
UPDATE_JIGSAW_BLOCK, // 0x29 SET_JIGSAW_BLOCK, // 0x29
UPDATE_STRUCTURE_BLOCK, // 0x2A SET_STRUCTURE_BLOCK, // 0x2A
UPDATE_SIGN, // 0x2B SIGN_UPDATE, // 0x2B
ANIMATION, // 0x2C SWING, // 0x2C
SPECTATE, // 0x2D TELEPORT_TO_ENTITY, // 0x2D
PLAYER_BLOCK_PLACEMENT, // 0x2E USE_ITEM_ON, // 0x2E
USE_ITEM; // 0x2F USE_ITEM; // 0x2F
@Override @Override

View File

@ -31,13 +31,13 @@ public class EntityPacketRewriter1_16_2 {
public static void register(Protocol1_16_1To1_16_2 protocol) { public static void register(Protocol1_16_1To1_16_2 protocol) {
MetadataRewriter1_16_2To1_16_1 metadataRewriter = protocol.get(MetadataRewriter1_16_2To1_16_1.class); 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.registerTrackerWithData(ClientboundPackets1_16.ADD_ENTITY, EntityTypes1_16_2.FALLING_BLOCK);
metadataRewriter.registerTracker(ClientboundPackets1_16.SPAWN_MOB); metadataRewriter.registerTracker(ClientboundPackets1_16.ADD_MOB);
metadataRewriter.registerTracker(ClientboundPackets1_16.SPAWN_PLAYER, EntityTypes1_16_2.PLAYER); metadataRewriter.registerTracker(ClientboundPackets1_16.ADD_PLAYER, EntityTypes1_16_2.PLAYER);
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16.ENTITY_METADATA, Types1_16.METADATA_LIST); metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16.SET_ENTITY_DATA, Types1_16.METADATA_LIST);
metadataRewriter.registerRemoveEntities(ClientboundPackets1_16.DESTROY_ENTITIES); metadataRewriter.registerRemoveEntities(ClientboundPackets1_16.REMOVE_ENTITIES);
protocol.registerClientbound(ClientboundPackets1_16.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_16.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity ID map(Type.INT); // Entity ID

View File

@ -33,13 +33,13 @@ public class ItemPacketRewriter1_16_2 extends ItemRewriter<ClientboundPackets1_1
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_16.COOLDOWN); registerSetCooldown(ClientboundPackets1_16.COOLDOWN);
registerWindowItems(ClientboundPackets1_16.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_16.CONTAINER_SET_CONTENT);
registerTradeList(ClientboundPackets1_16.TRADE_LIST); registerTradeList(ClientboundPackets1_16.MERCHANT_OFFERS);
registerSetSlot(ClientboundPackets1_16.SET_SLOT); registerSetSlot(ClientboundPackets1_16.CONTAINER_SET_SLOT);
registerEntityEquipmentArray(ClientboundPackets1_16.ENTITY_EQUIPMENT); registerEntityEquipmentArray(ClientboundPackets1_16.SET_EQUIPMENT);
registerAdvancements(ClientboundPackets1_16.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_16.UPDATE_ADVANCEMENTS);
protocol.registerClientbound(ClientboundPackets1_16.UNLOCK_RECIPES, wrapper -> { protocol.registerClientbound(ClientboundPackets1_16.RECIPE, wrapper -> {
wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.VAR_INT);
wrapper.passthrough(Type.BOOLEAN); // Open wrapper.passthrough(Type.BOOLEAN); // Open
wrapper.passthrough(Type.BOOLEAN); // Filter wrapper.passthrough(Type.BOOLEAN); // Filter
@ -52,12 +52,12 @@ public class ItemPacketRewriter1_16_2 extends ItemRewriter<ClientboundPackets1_1
wrapper.write(Type.BOOLEAN, false); wrapper.write(Type.BOOLEAN, false);
}); });
new RecipeRewriter<>(protocol).register(ClientboundPackets1_16.DECLARE_RECIPES); new RecipeRewriter<>(protocol).register(ClientboundPackets1_16.UPDATE_RECIPES);
registerClickWindow(ServerboundPackets1_16_2.CLICK_WINDOW); registerClickWindow(ServerboundPackets1_16_2.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION); 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))); 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);
} }
} }

View File

@ -41,11 +41,11 @@ public class WorldPacketRewriter1_16_2 {
public static void register(Protocol1_16_1To1_16_2 protocol) { public static void register(Protocol1_16_1To1_16_2 protocol) {
BlockRewriter<ClientboundPackets1_16> blockRewriter = BlockRewriter.for1_14(protocol); BlockRewriter<ClientboundPackets1_16> blockRewriter = BlockRewriter.for1_14(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_UPDATE);
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16.ACKNOWLEDGE_PLAYER_DIGGING); 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); Chunk chunk = wrapper.read(ChunkType1_16.TYPE);
wrapper.write(ChunkType1_16_2.TYPE, chunk); 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(); wrapper.cancel();
int chunkX = wrapper.read(Type.INT); int chunkX = wrapper.read(Type.INT);
@ -92,7 +92,7 @@ public class WorldPacketRewriter1_16_2 {
List<BlockChangeRecord> sectionRecord = sectionRecords[chunkY]; List<BlockChangeRecord> sectionRecord = sectionRecords[chunkY];
if (sectionRecord == null) continue; 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.LONG, chunkPosition | (chunkY & 0xFFFFFL));
newPacket.write(Type.BOOLEAN, false); // Ignore light updates newPacket.write(Type.BOOLEAN, false); // Ignore light updates
newPacket.write(Type.VAR_LONG_BLOCK_CHANGE_RECORD_ARRAY, sectionRecord.toArray(EMPTY_RECORDS)); 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);
} }
} }

View File

@ -62,7 +62,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
WorldPacketRewriter1_17.register(this); WorldPacketRewriter1_17.register(this);
registerClientbound(ClientboundPackets1_16_2.TAGS, wrapper -> { registerClientbound(ClientboundPackets1_16_2.UPDATE_TAGS, wrapper -> {
// Tags are now generically written with resource location - 5 different Vanilla types // Tags are now generically written with resource location - 5 different Vanilla types
wrapper.write(Type.VAR_INT, 5); wrapper.write(Type.VAR_INT, 5);
for (RegistryType type : RegistryType.getValues()) { for (RegistryType type : RegistryType.getValues()) {
@ -87,11 +87,11 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
} }
}); });
new StatisticsRewriter<>(this).register(ClientboundPackets1_16_2.STATISTICS); new StatisticsRewriter<>(this).register(ClientboundPackets1_16_2.AWARD_STATS);
SoundRewriter<ClientboundPackets1_16_2> soundRewriter = new SoundRewriter<>(this); SoundRewriter<ClientboundPackets1_16_2> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound(ClientboundPackets1_16_2.SOUND); 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 -> { registerClientbound(ClientboundPackets1_16_2.RESOURCE_PACK, wrapper -> {
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING);
@ -100,7 +100,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
wrapper.write(Type.OPTIONAL_COMPONENT, Via.getConfig().get1_17ResourcePackPrompt()); // Prompt message wrapper.write(Type.OPTIONAL_COMPONENT, Via.getConfig().get1_17ResourcePackPrompt()); // Prompt message
}); });
registerClientbound(ClientboundPackets1_16_2.MAP_DATA, wrapper -> { registerClientbound(ClientboundPackets1_16_2.MAP_ITEM_DATA, wrapper -> {
wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.VAR_INT);
wrapper.passthrough(Type.BYTE); wrapper.passthrough(Type.BYTE);
wrapper.read(Type.BOOLEAN); // Tracking position removed wrapper.read(Type.BOOLEAN); // Tracking position removed
@ -116,15 +116,15 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
} }
}); });
registerClientbound(ClientboundPackets1_16_2.TITLE, null, wrapper -> { registerClientbound(ClientboundPackets1_16_2.SET_TITLES, null, wrapper -> {
// Title packet actions have been split into individual packets (the content hasn't changed) // Title packet actions have been split into individual packets (the content hasn't changed)
int type = wrapper.read(Type.VAR_INT); int type = wrapper.read(Type.VAR_INT);
ClientboundPacketType packetType; ClientboundPacketType packetType;
switch (type) { switch (type) {
case 0 -> packetType = ClientboundPackets1_17.TITLE_TEXT; case 0 -> packetType = ClientboundPackets1_17.SET_TITLE_TEXT;
case 1 -> packetType = ClientboundPackets1_17.TITLE_SUBTITLE; case 1 -> packetType = ClientboundPackets1_17.SET_SUBTITLE_TEXT;
case 2 -> packetType = ClientboundPackets1_17.ACTIONBAR; case 2 -> packetType = ClientboundPackets1_17.SET_ACTION_BAR_TEXT;
case 3 -> packetType = ClientboundPackets1_17.TITLE_TIMES; case 3 -> packetType = ClientboundPackets1_17.SET_TITLES_ANIMATION;
case 4 -> { case 4 -> {
packetType = ClientboundPackets1_17.CLEAR_TITLES; packetType = ClientboundPackets1_17.CLEAR_TITLES;
wrapper.write(Type.BOOLEAN, false); // Reset times wrapper.write(Type.BOOLEAN, false); // Reset times
@ -139,7 +139,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
wrapper.setPacketType(packetType); wrapper.setPacketType(packetType);
}); });
registerClientbound(ClientboundPackets1_16_2.EXPLOSION, new PacketHandlers() { registerClientbound(ClientboundPackets1_16_2.EXPLODE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.FLOAT); // X map(Type.FLOAT); // X
@ -150,7 +150,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
} }
}); });
registerClientbound(ClientboundPackets1_16_2.SPAWN_POSITION, new PacketHandlers() { registerClientbound(ClientboundPackets1_16_2.SET_DEFAULT_SPAWN_POSITION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.POSITION1_14); map(Type.POSITION1_14);
@ -158,7 +158,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol<ClientboundPack
} }
}); });
registerServerbound(ServerboundPackets1_17.CLIENT_SETTINGS, new PacketHandlers() { registerServerbound(ServerboundPackets1_17.CLIENT_INFORMATION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Locale map(Type.STRING); // Locale

View File

@ -21,109 +21,109 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_17 implements ClientboundPacketType { public enum ClientboundPackets1_17 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_MOB, // 0x02 ADD_MOB, // 0x02
SPAWN_PAINTING, // 0x03 ADD_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04 ADD_PLAYER, // 0x04
ADD_VIBRATION_SIGNAL, // 0x05 ADD_VIBRATION_SIGNAL, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 BLOCK_BREAK_ACK, // 0x08
BLOCK_BREAK_ANIMATION, // 0x09 BLOCK_DESTRUCTION, // 0x09
BLOCK_ENTITY_DATA, // 0x0A BLOCK_ENTITY_DATA, // 0x0A
BLOCK_ACTION, // 0x0B BLOCK_EVENT, // 0x0B
BLOCK_CHANGE, // 0x0C BLOCK_UPDATE, // 0x0C
BOSSBAR, // 0x0D BOSS_EVENT, // 0x0D
SERVER_DIFFICULTY, // 0x0E CHANGE_DIFFICULTY, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
CLEAR_TITLES, // 0x10 CLEAR_TITLES, // 0x10
TAB_COMPLETE, // 0x11 COMMAND_SUGGESTIONS, // 0x11
DECLARE_COMMANDS, // 0x12 COMMANDS, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
WORLD_BORDER_INIT, // 0x20 INITIALIZE_BORDER, // 0x20
KEEP_ALIVE, // 0x21 KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22 LEVEL_CHUNK, // 0x22
EFFECT, // 0x23 LEVEL_EVENT, // 0x23
SPAWN_PARTICLE, // 0x24 LEVEL_PARTICLES, // 0x24
UPDATE_LIGHT, // 0x25 LIGHT_UPDATE, // 0x25
JOIN_GAME, // 0x26 LOGIN, // 0x26
MAP_DATA, // 0x27 MAP_ITEM_DATA, // 0x27
TRADE_LIST, // 0x28 MERCHANT_OFFERS, // 0x28
ENTITY_POSITION, // 0x29 MOVE_ENTITY_POS, // 0x29
ENTITY_POSITION_AND_ROTATION, // 0x2A MOVE_ENTITY_POS_ROT, // 0x2A
ENTITY_ROTATION, // 0x2B MOVE_ENTITY_ROT, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
PING, // 0x30 PING, // 0x30
CRAFT_RECIPE_RESPONSE, // 0x31 PLACE_GHOST_RECIPE, // 0x31
PLAYER_ABILITIES, // 0x32 PLAYER_ABILITIES, // 0x32
COMBAT_END, // 0x33 PLAYER_COMBAT_END, // 0x33
COMBAT_ENTER, // 0x34 PLAYER_COMBAT_ENTER, // 0x34
COMBAT_KILL, // 0x35 PLAYER_COMBAT_KILL, // 0x35
PLAYER_INFO, // 0x36 PLAYER_INFO, // 0x36
FACE_PLAYER, // 0x37 PLAYER_LOOK_AT, // 0x37
PLAYER_POSITION, // 0x38 PLAYER_POSITION, // 0x38
UNLOCK_RECIPES, // 0x39 RECIPE, // 0x39
REMOVE_ENTITY, // 0x3A REMOVE_ENTITY, // 0x3A
REMOVE_ENTITY_EFFECT, // 0x3B REMOVE_MOB_EFFECT, // 0x3B
RESOURCE_PACK, // 0x3C RESOURCE_PACK, // 0x3C
RESPAWN, // 0x3D RESPAWN, // 0x3D
ENTITY_HEAD_LOOK, // 0x3E ROTATE_HEAD, // 0x3E
MULTI_BLOCK_CHANGE, // 0x3F SECTION_BLOCKS_UPDATE, // 0x3F
SELECT_ADVANCEMENTS_TAB, // 0x40 SELECT_ADVANCEMENTS_TAB, // 0x40
ACTIONBAR, // 0x41 SET_ACTION_BAR_TEXT, // 0x41
WORLD_BORDER_CENTER, // 0x42 SET_BORDER_CENTER, // 0x42
WORLD_BORDER_LERP_SIZE, // 0x43 SET_BORDER_LERP_SIZE, // 0x43
WORLD_BORDER_SIZE, // 0x44 SET_BORDER_SIZE, // 0x44
WORLD_BORDER_WARNING_DELAY, // 0x45 SET_BORDER_WARNING_DELAY, // 0x45
WORLD_BORDER_WARNING_DISTANCE, // 0x46 SET_BORDER_WARNING_DISTANCE, // 0x46
CAMERA, // 0x47 SET_CAMERA, // 0x47
HELD_ITEM_CHANGE, // 0x48 SET_CARRIED_ITEM, // 0x48
UPDATE_VIEW_POSITION, // 0x49 SET_CHUNK_CACHE_CENTER, // 0x49
UPDATE_VIEW_DISTANCE, // 0x4A SET_CHUNK_CACHE_RADIUS, // 0x4A
SPAWN_POSITION, // 0x4B SET_DEFAULT_SPAWN_POSITION, // 0x4B
DISPLAY_SCOREBOARD, // 0x4C SET_DISPLAY_OBJECTIVE, // 0x4C
ENTITY_METADATA, // 0x4D SET_ENTITY_DATA, // 0x4D
ATTACH_ENTITY, // 0x4E SET_ENTITY_LINK, // 0x4E
ENTITY_VELOCITY, // 0x4F SET_ENTITY_MOTION, // 0x4F
ENTITY_EQUIPMENT, // 0x50 SET_EQUIPMENT, // 0x50
SET_EXPERIENCE, // 0x51 SET_EXPERIENCE, // 0x51
UPDATE_HEALTH, // 0x52 SET_HEALTH, // 0x52
SCOREBOARD_OBJECTIVE, // 0x53 SET_OBJECTIVE, // 0x53
SET_PASSENGERS, // 0x54 SET_PASSENGERS, // 0x54
TEAMS, // 0x55 SET_PLAYER_TEAM, // 0x55
UPDATE_SCORE, // 0x56 SET_SCORE, // 0x56
TITLE_SUBTITLE, // 0x57 SET_SUBTITLE_TEXT, // 0x57
TIME_UPDATE, // 0x58 SET_TIME, // 0x58
TITLE_TEXT, // 0x59 SET_TITLE_TEXT, // 0x59
TITLE_TIMES, // 0x5A SET_TITLES_ANIMATION, // 0x5A
ENTITY_SOUND, // 0x5B SOUND_ENTITY, // 0x5B
SOUND, // 0x5C SOUND, // 0x5C
STOP_SOUND, // 0x5D STOP_SOUND, // 0x5D
TAB_LIST, // 0x5E TAB_LIST, // 0x5E
NBT_QUERY, // 0x5F TAG_QUERY, // 0x5F
COLLECT_ITEM, // 0x60 TAKE_ITEM_ENTITY, // 0x60
ENTITY_TELEPORT, // 0x61 TELEPORT_ENTITY, // 0x61
ADVANCEMENTS, // 0x62 UPDATE_ADVANCEMENTS, // 0x62
ENTITY_PROPERTIES, // 0x63 UPDATE_ATTRIBUTES, // 0x63
ENTITY_EFFECT, // 0x64 UPDATE_MOB_EFFECT, // 0x64
DECLARE_RECIPES, // 0x65 UPDATE_RECIPES, // 0x65
TAGS; // 0x66 UPDATE_TAGS; // 0x66
@Override @Override
public int getId() { public int getId() {

View File

@ -21,53 +21,53 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_17 implements ServerboundPacketType { public enum ServerboundPackets1_17 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_MESSAGE, // 0x03 CHAT, // 0x03
CLIENT_STATUS, // 0x04 CLIENT_COMMAND, // 0x04
CLIENT_SETTINGS, // 0x05 CLIENT_INFORMATION, // 0x05
TAB_COMPLETE, // 0x06 COMMAND_SUGGESTION, // 0x06
CLICK_WINDOW_BUTTON, // 0x07 CONTAINER_BUTTON_CLICK, // 0x07
CLICK_WINDOW, // 0x08 CONTAINER_CLICK, // 0x08
CLOSE_WINDOW, // 0x09 CONTAINER_CLOSE, // 0x09
PLUGIN_MESSAGE, // 0x0A CUSTOM_PAYLOAD, // 0x0A
EDIT_BOOK, // 0x0B EDIT_BOOK, // 0x0B
ENTITY_NBT_REQUEST, // 0x0C ENTITY_TAG_QUERY, // 0x0C
INTERACT_ENTITY, // 0x0D INTERACT, // 0x0D
GENERATE_JIGSAW, // 0x0E JIGSAW_GENERATE, // 0x0E
KEEP_ALIVE, // 0x0F KEEP_ALIVE, // 0x0F
LOCK_DIFFICULTY, // 0x10 LOCK_DIFFICULTY, // 0x10
PLAYER_POSITION, // 0x11 MOVE_PLAYER_POS, // 0x11
PLAYER_POSITION_AND_ROTATION, // 0x12 MOVE_PLAYER_POS_ROT, // 0x12
PLAYER_ROTATION, // 0x13 MOVE_PLAYER_ROT, // 0x13
PLAYER_MOVEMENT, // 0x14 MOVE_PLAYER_STATUS_ONLY, // 0x14
VEHICLE_MOVE, // 0x15 MOVE_VEHICLE, // 0x15
STEER_BOAT, // 0x16 PADDLE_BOAT, // 0x16
PICK_ITEM, // 0x17 PICK_ITEM, // 0x17
CRAFT_RECIPE_REQUEST, // 0x18 PLACE_RECIPE, // 0x18
PLAYER_ABILITIES, // 0x19 PLAYER_ABILITIES, // 0x19
PLAYER_DIGGING, // 0x1A PLAYER_ACTION, // 0x1A
ENTITY_ACTION, // 0x1B PLAYER_COMMAND, // 0x1B
STEER_VEHICLE, // 0x1C PLAYER_INPUT, // 0x1C
PONG, // 0x1D PONG, // 0x1D
RECIPE_BOOK_DATA, // 0x1E RECIPE_BOOK_CHANGE_SETTINGS, // 0x1E
SEEN_RECIPE, // 0x1F RECIPE_BOOK_SEEN_RECIPE, // 0x1F
RENAME_ITEM, // 0x20 RENAME_ITEM, // 0x20
RESOURCE_PACK_STATUS, // 0x21 RESOURCE_PACK, // 0x21
ADVANCEMENT_TAB, // 0x22 SEEN_ADVANCEMENTS, // 0x22
SELECT_TRADE, // 0x23 SELECT_TRADE, // 0x23
SET_BEACON_EFFECT, // 0x24 SET_BEACON, // 0x24
HELD_ITEM_CHANGE, // 0x25 SET_CARRIED_ITEM, // 0x25
UPDATE_COMMAND_BLOCK, // 0x26 SET_COMMAND_BLOCK, // 0x26
UPDATE_COMMAND_BLOCK_MINECART, // 0x27 SET_COMMAND_MINECART, // 0x27
CREATIVE_INVENTORY_ACTION, // 0x28 SET_CREATIVE_MODE_SLOT, // 0x28
UPDATE_JIGSAW_BLOCK, // 0x29 SET_JIGSAW_BLOCK, // 0x29
UPDATE_STRUCTURE_BLOCK, // 0x2A SET_STRUCTURE_BLOCK, // 0x2A
UPDATE_SIGN, // 0x2B SIGN_UPDATE, // 0x2B
ANIMATION, // 0x2C SWING, // 0x2C
SPECTATE, // 0x2D TELEPORT_TO_ENTITY, // 0x2D
PLAYER_BLOCK_PLACEMENT, // 0x2E USE_ITEM_ON, // 0x2E
USE_ITEM; // 0x2F USE_ITEM; // 0x2F
@Override @Override

View File

@ -43,12 +43,12 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
@Override @Override
public void registerPackets() { public void registerPackets() {
registerTrackerWithData(ClientboundPackets1_16_2.SPAWN_ENTITY, EntityTypes1_17.FALLING_BLOCK); registerTrackerWithData(ClientboundPackets1_16_2.ADD_ENTITY, EntityTypes1_17.FALLING_BLOCK);
registerTracker(ClientboundPackets1_16_2.SPAWN_MOB); registerTracker(ClientboundPackets1_16_2.ADD_MOB);
registerTracker(ClientboundPackets1_16_2.SPAWN_PLAYER, EntityTypes1_17.PLAYER); registerTracker(ClientboundPackets1_16_2.ADD_PLAYER, EntityTypes1_17.PLAYER);
registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_16.METADATA_LIST, Types1_17.METADATA_LIST); registerMetadataRewriter(ClientboundPackets1_16_2.SET_ENTITY_DATA, Types1_16.METADATA_LIST, Types1_17.METADATA_LIST);
protocol.registerClientbound(ClientboundPackets1_16_2.DESTROY_ENTITIES, null, wrapper -> { protocol.registerClientbound(ClientboundPackets1_16_2.REMOVE_ENTITIES, null, wrapper -> {
int[] entityIds = wrapper.read(Type.VAR_INT_ARRAY_PRIMITIVE); int[] entityIds = wrapper.read(Type.VAR_INT_ARRAY_PRIMITIVE);
wrapper.cancel(); wrapper.cancel();
@ -63,7 +63,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_16_2.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_16_2.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity ID map(Type.INT); // Entity ID
@ -94,7 +94,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
addNewDimensionData(dimensionData); addNewDimensionData(dimensionData);
}); });
protocol.registerClientbound(ClientboundPackets1_16_2.ENTITY_PROPERTIES, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_16_2.UPDATE_ATTRIBUTES, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -116,13 +116,13 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_16_2.COMBAT_EVENT, null, wrapper -> { protocol.registerClientbound(ClientboundPackets1_16_2.PLAYER_COMBAT, null, wrapper -> {
// Combat packet actions have been split into individual packets (the content hasn't changed) // Combat packet actions have been split into individual packets (the content hasn't changed)
int type = wrapper.read(Type.VAR_INT); int type = wrapper.read(Type.VAR_INT);
ClientboundPacketType packetType = switch (type) { ClientboundPacketType packetType = switch (type) {
case 0 -> ClientboundPackets1_17.COMBAT_ENTER; case 0 -> ClientboundPackets1_17.PLAYER_COMBAT_ENTER;
case 1 -> ClientboundPackets1_17.COMBAT_END; case 1 -> ClientboundPackets1_17.PLAYER_COMBAT_END;
case 2 -> ClientboundPackets1_17.COMBAT_KILL; case 2 -> ClientboundPackets1_17.PLAYER_COMBAT_KILL;
default -> throw new IllegalArgumentException("Invalid combat type received: " + type); default -> throw new IllegalArgumentException("Invalid combat type received: " + type);
}; };
@ -130,7 +130,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
}); });
// The parent class of the other entity move packets that is never actually used has finally been removed from the id list // The parent class of the other entity move packets that is never actually used has finally been removed from the id list
protocol.cancelClientbound(ClientboundPackets1_16_2.ENTITY_MOVEMENT); protocol.cancelClientbound(ClientboundPackets1_16_2.MOVE_ENTITY);
} }
@Override @Override
@ -148,7 +148,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
// Ticks frozen added with id 7 // Ticks frozen added with id 7
filter().type(EntityTypes1_17.ENTITY).addIndex(7); filter().type(EntityTypes1_17.ENTITY).addIndex(7);
filter().type(EntityTypes1_17.MINECART_ABSTRACT).index(11).handler((event, meta) -> { filter().type(EntityTypes1_17.ABSTRACT_MINECART).index(11).handler((event, meta) -> {
// Convert to new block id // Convert to new block id
int data = (int) meta.getValue(); int data = (int) meta.getValue();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));

View File

@ -42,20 +42,20 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter<ClientboundPacket
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_16_2.COOLDOWN); registerSetCooldown(ClientboundPackets1_16_2.COOLDOWN);
registerWindowItems(ClientboundPackets1_16_2.WINDOW_ITEMS); registerWindowItems(ClientboundPackets1_16_2.CONTAINER_SET_CONTENT);
registerTradeList(ClientboundPackets1_16_2.TRADE_LIST); registerTradeList(ClientboundPackets1_16_2.MERCHANT_OFFERS);
registerSetSlot(ClientboundPackets1_16_2.SET_SLOT); registerSetSlot(ClientboundPackets1_16_2.CONTAINER_SET_SLOT);
registerAdvancements(ClientboundPackets1_16_2.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_16_2.UPDATE_ADVANCEMENTS);
registerEntityEquipmentArray(ClientboundPackets1_16_2.ENTITY_EQUIPMENT); registerEntityEquipmentArray(ClientboundPackets1_16_2.SET_EQUIPMENT);
registerSpawnParticle(ClientboundPackets1_16_2.SPAWN_PARTICLE, Type.DOUBLE); registerSpawnParticle(ClientboundPackets1_16_2.LEVEL_PARTICLES, Type.DOUBLE);
new RecipeRewriter<>(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.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 @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Window Id map(Type.UNSIGNED_BYTE); // Window Id
@ -90,7 +90,7 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter<ClientboundPacket
} }
}); });
protocol.registerClientbound(ClientboundPackets1_16_2.WINDOW_CONFIRMATION, null, wrapper -> { protocol.registerClientbound(ClientboundPackets1_16_2.CONTAINER_ACK, null, wrapper -> {
short inventoryId = wrapper.read(Type.UNSIGNED_BYTE); short inventoryId = wrapper.read(Type.UNSIGNED_BYTE);
short confirmationId = wrapper.read(Type.SHORT); short confirmationId = wrapper.read(Type.SHORT);
boolean accepted = wrapper.read(Type.BOOLEAN); boolean accepted = wrapper.read(Type.BOOLEAN);
@ -115,7 +115,7 @@ public final class ItemPacketRewriter1_17 extends ItemRewriter<ClientboundPacket
// Decode our requested inventory acknowledgement // Decode our requested inventory acknowledgement
short inventoryId = (short) ((id >> 16) & 0xFF); short inventoryId = (short) ((id >> 16) & 0xFF);
short confirmationId = (short) (id & 0xFFFF); 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.UNSIGNED_BYTE, inventoryId);
packet.write(Type.SHORT, confirmationId); packet.write(Type.SHORT, confirmationId);
packet.write(Type.BOOLEAN, true); // Accept packet.write(Type.BOOLEAN, true); // Accept

View File

@ -42,28 +42,28 @@ public final class WorldPacketRewriter1_17 {
public static void register(Protocol1_16_4To1_17 protocol) { public static void register(Protocol1_16_4To1_17 protocol) {
BlockRewriter<ClientboundPackets1_16_2> blockRewriter = BlockRewriter.for1_14(protocol); BlockRewriter<ClientboundPackets1_16_2> blockRewriter = BlockRewriter.for1_14(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_UPDATE);
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.SECTION_BLOCKS_UPDATE);
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16_2.ACKNOWLEDGE_PLAYER_DIGGING); 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) // Border packet actions have been split into individual packets (the content hasn't changed)
int type = wrapper.read(Type.VAR_INT); int type = wrapper.read(Type.VAR_INT);
ClientboundPacketType packetType = switch (type) { ClientboundPacketType packetType = switch (type) {
case 0 -> ClientboundPackets1_17.WORLD_BORDER_SIZE; case 0 -> ClientboundPackets1_17.SET_BORDER_SIZE;
case 1 -> ClientboundPackets1_17.WORLD_BORDER_LERP_SIZE; case 1 -> ClientboundPackets1_17.SET_BORDER_LERP_SIZE;
case 2 -> ClientboundPackets1_17.WORLD_BORDER_CENTER; case 2 -> ClientboundPackets1_17.SET_BORDER_CENTER;
case 3 -> ClientboundPackets1_17.WORLD_BORDER_INIT; case 3 -> ClientboundPackets1_17.INITIALIZE_BORDER;
case 4 -> ClientboundPackets1_17.WORLD_BORDER_WARNING_DELAY; case 4 -> ClientboundPackets1_17.SET_BORDER_WARNING_DELAY;
case 5 -> ClientboundPackets1_17.WORLD_BORDER_WARNING_DISTANCE; case 5 -> ClientboundPackets1_17.SET_BORDER_WARNING_DISTANCE;
default -> throw new IllegalArgumentException("Invalid world border type received: " + type); default -> throw new IllegalArgumentException("Invalid world border type received: " + type);
}; };
wrapper.setPacketType(packetType); wrapper.setPacketType(packetType);
}); });
protocol.registerClientbound(ClientboundPackets1_16_2.UPDATE_LIGHT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_16_2.LIGHT_UPDATE, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // x 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); Chunk chunk = wrapper.read(ChunkType1_16_2.TYPE);
if (!chunk.isFullChunk()) { if (!chunk.isFullChunk()) {
// All chunks are full chunk packets now (1.16 already stopped sending non-full chunks) // 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) { private static void writeMultiBlockChangePacket(PacketWrapper wrapper, Chunk chunk) {
@ -151,7 +151,7 @@ public final class WorldPacketRewriter1_17 {
ChunkSection section = sections[chunkY]; ChunkSection section = sections[chunkY];
if (section == null) continue; 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.LONG, chunkPosition | (chunkY & 0xFFFFFL));
blockChangePacket.write(Type.BOOLEAN, true); // Suppress light updates blockChangePacket.write(Type.BOOLEAN, true); // Suppress light updates

View File

@ -58,18 +58,18 @@ public final class Protocol1_17_1To1_18 extends AbstractProtocol<ClientboundPack
final SoundRewriter<ClientboundPackets1_17_1> soundRewriter = new SoundRewriter<>(this); final SoundRewriter<ClientboundPackets1_17_1> soundRewriter = new SoundRewriter<>(this);
soundRewriter.registerSound(ClientboundPackets1_17_1.SOUND); 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", 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: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: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"); "minecraft:azalea_grows_on", "minecraft:azalea_root_replaceable", "minecraft:replaceable_plants", "minecraft:terracotta");
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:dirt", "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 @Override
public void register() { public void register() {
map(Type.STRING); // Language map(Type.STRING); // Language

View File

@ -21,110 +21,110 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_18 implements ClientboundPacketType { public enum ClientboundPackets1_18 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_MOB, // 0x02 ADD_MOB, // 0x02
SPAWN_PAINTING, // 0x03 ADD_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04 ADD_PLAYER, // 0x04
ADD_VIBRATION_SIGNAL, // 0x05 ADD_VIBRATION_SIGNAL, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 BLOCK_BREAK_ACK, // 0x08
BLOCK_BREAK_ANIMATION, // 0x09 BLOCK_DESTRUCTION, // 0x09
BLOCK_ENTITY_DATA, // 0x0A BLOCK_ENTITY_DATA, // 0x0A
BLOCK_ACTION, // 0x0B BLOCK_EVENT, // 0x0B
BLOCK_CHANGE, // 0x0C BLOCK_UPDATE, // 0x0C
BOSSBAR, // 0x0D BOSS_EVENT, // 0x0D
SERVER_DIFFICULTY, // 0x0E CHANGE_DIFFICULTY, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
CLEAR_TITLES, // 0x10 CLEAR_TITLES, // 0x10
TAB_COMPLETE, // 0x11 COMMAND_SUGGESTIONS, // 0x11
DECLARE_COMMANDS, // 0x12 COMMANDS, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
WORLD_BORDER_INIT, // 0x20 INITIALIZE_BORDER, // 0x20
KEEP_ALIVE, // 0x21 KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22 LEVEL_CHUNK_WITH_LIGHT, // 0x22
EFFECT, // 0x23 LEVEL_EVENT, // 0x23
SPAWN_PARTICLE, // 0x24 LEVEL_PARTICLES, // 0x24
UPDATE_LIGHT, // 0x25 LIGHT_UPDATE, // 0x25
JOIN_GAME, // 0x26 LOGIN, // 0x26
MAP_DATA, // 0x27 MAP_ITEM_DATA, // 0x27
TRADE_LIST, // 0x28 MERCHANT_OFFERS, // 0x28
ENTITY_POSITION, // 0x29 MOVE_ENTITY_POS, // 0x29
ENTITY_POSITION_AND_ROTATION, // 0x2A MOVE_ENTITY_POS_ROT, // 0x2A
ENTITY_ROTATION, // 0x2B MOVE_ENTITY_ROT, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
PING, // 0x30 PING, // 0x30
CRAFT_RECIPE_RESPONSE, // 0x31 PLACE_GHOST_RECIPE, // 0x31
PLAYER_ABILITIES, // 0x32 PLAYER_ABILITIES, // 0x32
COMBAT_END, // 0x33 PLAYER_COMBAT_END, // 0x33
COMBAT_ENTER, // 0x34 PLAYER_COMBAT_ENTER, // 0x34
COMBAT_KILL, // 0x35 PLAYER_COMBAT_KILL, // 0x35
PLAYER_INFO, // 0x36 PLAYER_INFO, // 0x36
FACE_PLAYER, // 0x37 PLAYER_LOOK_AT, // 0x37
PLAYER_POSITION, // 0x38 PLAYER_POSITION, // 0x38
UNLOCK_RECIPES, // 0x39 RECIPE, // 0x39
REMOVE_ENTITIES, // 0x3A REMOVE_ENTITIES, // 0x3A
REMOVE_ENTITY_EFFECT, // 0x3B REMOVE_MOB_EFFECT, // 0x3B
RESOURCE_PACK, // 0x3C RESOURCE_PACK, // 0x3C
RESPAWN, // 0x3D RESPAWN, // 0x3D
ENTITY_HEAD_LOOK, // 0x3E ROTATE_HEAD, // 0x3E
MULTI_BLOCK_CHANGE, // 0x3F SECTION_BLOCKS_UPDATE, // 0x3F
SELECT_ADVANCEMENTS_TAB, // 0x40 SELECT_ADVANCEMENTS_TAB, // 0x40
ACTIONBAR, // 0x41 SET_ACTION_BAR_TEXT, // 0x41
WORLD_BORDER_CENTER, // 0x42 SET_BORDER_CENTER, // 0x42
WORLD_BORDER_LERP_SIZE, // 0x43 SET_BORDER_LERP_SIZE, // 0x43
WORLD_BORDER_SIZE, // 0x44 SET_BORDER_SIZE, // 0x44
WORLD_BORDER_WARNING_DELAY, // 0x45 SET_BORDER_WARNING_DELAY, // 0x45
WORLD_BORDER_WARNING_DISTANCE, // 0x46 SET_BORDER_WARNING_DISTANCE, // 0x46
CAMERA, // 0x47 SET_CAMERA, // 0x47
HELD_ITEM_CHANGE, // 0x48 SET_CARRIED_ITEM, // 0x48
UPDATE_VIEW_POSITION, // 0x49 SET_CHUNK_CACHE_CENTER, // 0x49
UPDATE_VIEW_DISTANCE, // 0x4A SET_CHUNK_CACHE_RADIUS, // 0x4A
SPAWN_POSITION, // 0x4B SET_DEFAULT_SPAWN_POSITION, // 0x4B
DISPLAY_SCOREBOARD, // 0x4C SET_DISPLAY_OBJECTIVE, // 0x4C
ENTITY_METADATA, // 0x4D SET_ENTITY_DATA, // 0x4D
ATTACH_ENTITY, // 0x4E SET_ENTITY_LINK, // 0x4E
ENTITY_VELOCITY, // 0x4F SET_ENTITY_MOTION, // 0x4F
ENTITY_EQUIPMENT, // 0x50 SET_EQUIPMENT, // 0x50
SET_EXPERIENCE, // 0x51 SET_EXPERIENCE, // 0x51
UPDATE_HEALTH, // 0x52 SET_HEALTH, // 0x52
SCOREBOARD_OBJECTIVE, // 0x53 SET_OBJECTIVE, // 0x53
SET_PASSENGERS, // 0x54 SET_PASSENGERS, // 0x54
TEAMS, // 0x55 SET_PLAYER_TEAM, // 0x55
UPDATE_SCORE, // 0x56 SET_SCORE, // 0x56
SET_SIMULATION_DISTANCE, // 0x57 SET_SIMULATION_DISTANCE, // 0x57
TITLE_SUBTITLE, // 0x58 SET_SUBTITLE_TEXT, // 0x58
TIME_UPDATE, // 0x59 SET_TIME, // 0x59
TITLE_TEXT, // 0x5A SET_TITLE_TEXT, // 0x5A
TITLE_TIMES, // 0x5B SET_TITLES_ANIMATION, // 0x5B
ENTITY_SOUND, // 0x5C SOUND_ENTITY, // 0x5C
SOUND, // 0x5D SOUND, // 0x5D
STOP_SOUND, // 0x5E STOP_SOUND, // 0x5E
TAB_LIST, // 0x5F TAB_LIST, // 0x5F
NBT_QUERY, // 0x60 TAG_QUERY, // 0x60
COLLECT_ITEM, // 0x61 TAKE_ITEM_ENTITY, // 0x61
ENTITY_TELEPORT, // 0x62 TELEPORT_ENTITY, // 0x62
ADVANCEMENTS, // 0x63 UPDATE_ADVANCEMENTS, // 0x63
ENTITY_PROPERTIES, // 0x64 UPDATE_ATTRIBUTES, // 0x64
ENTITY_EFFECT, // 0x65 UPDATE_MOB_EFFECT, // 0x65
DECLARE_RECIPES, // 0x66 UPDATE_RECIPES, // 0x66
TAGS; // 0x67 UPDATE_TAGS; // 0x67
@Override @Override
public int getId() { public int getId() {

View File

@ -38,9 +38,9 @@ public final class EntityPacketRewriter1_18 extends EntityRewriter<ClientboundPa
@Override @Override
public void registerPackets() { public void registerPackets() {
registerMetadataRewriter(ClientboundPackets1_17_1.ENTITY_METADATA, Types1_17.METADATA_LIST, Types1_18.METADATA_LIST); registerMetadataRewriter(ClientboundPackets1_17_1.SET_ENTITY_DATA, Types1_17.METADATA_LIST, Types1_18.METADATA_LIST);
protocol.registerClientbound(ClientboundPackets1_17_1.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_17_1.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity ID map(Type.INT); // Entity ID

View File

@ -35,13 +35,13 @@ public final class ItemPacketRewriter1_18 extends ItemRewriter<ClientboundPacket
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_17_1.COOLDOWN); registerSetCooldown(ClientboundPackets1_17_1.COOLDOWN);
registerWindowItems1_17_1(ClientboundPackets1_17_1.WINDOW_ITEMS); registerWindowItems1_17_1(ClientboundPackets1_17_1.CONTAINER_SET_CONTENT);
registerTradeList(ClientboundPackets1_17_1.TRADE_LIST); registerTradeList(ClientboundPackets1_17_1.MERCHANT_OFFERS);
registerSetSlot1_17_1(ClientboundPackets1_17_1.SET_SLOT); registerSetSlot1_17_1(ClientboundPackets1_17_1.CONTAINER_SET_SLOT);
registerAdvancements(ClientboundPackets1_17_1.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_17_1.UPDATE_ADVANCEMENTS);
registerEntityEquipmentArray(ClientboundPackets1_17_1.ENTITY_EQUIPMENT); registerEntityEquipmentArray(ClientboundPackets1_17_1.SET_EQUIPMENT);
protocol.registerClientbound(ClientboundPackets1_17_1.EFFECT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_17_1.LEVEL_EVENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Effect id map(Type.INT); // Effect id
@ -57,7 +57,7 @@ public final class ItemPacketRewriter1_18 extends ItemRewriter<ClientboundPacket
} }
}); });
protocol.registerClientbound(ClientboundPackets1_17_1.SPAWN_PARTICLE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_17_1.LEVEL_PARTICLES, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Particle id map(Type.INT); // Particle id
@ -97,9 +97,9 @@ public final class ItemPacketRewriter1_18 extends ItemRewriter<ClientboundPacket
} }
}); });
new RecipeRewriter<>(protocol).register(ClientboundPackets1_17_1.DECLARE_RECIPES); new RecipeRewriter<>(protocol).register(ClientboundPackets1_17_1.UPDATE_RECIPES);
registerClickWindow1_17_1(ServerboundPackets1_17.CLICK_WINDOW); registerClickWindow1_17_1(ServerboundPackets1_17.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_17.SET_CREATIVE_MODE_SLOT);
} }
} }

View File

@ -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.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.BlockEntityIds;
import com.viaversion.viaversion.protocols.v1_17_1to1_18.data.BlockEntities; 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_17_1to1_18.storage.ChunkLightStorage;
import com.viaversion.viaversion.protocols.v1_17to1_17_1.packet.ClientboundPackets1_17_1; import com.viaversion.viaversion.protocols.v1_17to1_17_1.packet.ClientboundPackets1_17_1;
import com.viaversion.viaversion.util.Key; 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 chunkX = wrapper.passthrough(Type.VAR_INT);
final int chunkZ = 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)); 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 EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
final Chunk oldChunk = wrapper.read(new ChunkType1_17(tracker.currentWorldSectionHeight())); 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 chunkX = wrapper.passthrough(Type.INT);
final int chunkZ = wrapper.passthrough(Type.INT); final int chunkZ = wrapper.passthrough(Type.INT);
wrapper.user().get(ChunkLightStorage.class).clear(chunkX, chunkZ); wrapper.user().get(ChunkLightStorage.class).clear(chunkX, chunkZ);

View File

@ -47,7 +47,7 @@ public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPack
wrapper.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{entityId}); wrapper.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{entityId});
}); });
registerClientbound(ClientboundPackets1_17.SET_SLOT, new PacketHandlers() { registerClientbound(ClientboundPackets1_17.CONTAINER_SET_SLOT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Container id map(Type.UNSIGNED_BYTE); // Container id
@ -55,7 +55,7 @@ public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPack
} }
}); });
registerClientbound(ClientboundPackets1_17.WINDOW_ITEMS, new PacketHandlers() { registerClientbound(ClientboundPackets1_17.CONTAINER_SET_CONTENT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Container id map(Type.UNSIGNED_BYTE); // Container id
@ -70,7 +70,7 @@ public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPack
} }
}); });
registerServerbound(ServerboundPackets1_17.CLICK_WINDOW, new PacketHandlers() { registerServerbound(ServerboundPackets1_17.CONTAINER_CLICK, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.UNSIGNED_BYTE); // Container id map(Type.UNSIGNED_BYTE); // Container id

View File

@ -21,109 +21,109 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_17_1 implements ClientboundPacketType { public enum ClientboundPackets1_17_1 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_MOB, // 0x02 ADD_MOB, // 0x02
SPAWN_PAINTING, // 0x03 ADD_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04 ADD_PLAYER, // 0x04
ADD_VIBRATION_SIGNAL, // 0x05 ADD_VIBRATION_SIGNAL, // 0x05
ENTITY_ANIMATION, // 0x06 ANIMATE, // 0x06
STATISTICS, // 0x07 AWARD_STATS, // 0x07
ACKNOWLEDGE_PLAYER_DIGGING, // 0x08 BLOCK_BREAK_ACK, // 0x08
BLOCK_BREAK_ANIMATION, // 0x09 BLOCK_DESTRUCTION, // 0x09
BLOCK_ENTITY_DATA, // 0x0A BLOCK_ENTITY_DATA, // 0x0A
BLOCK_ACTION, // 0x0B BLOCK_EVENT, // 0x0B
BLOCK_CHANGE, // 0x0C BLOCK_UPDATE, // 0x0C
BOSSBAR, // 0x0D BOSS_EVENT, // 0x0D
SERVER_DIFFICULTY, // 0x0E CHANGE_DIFFICULTY, // 0x0E
CHAT_MESSAGE, // 0x0F CHAT, // 0x0F
CLEAR_TITLES, // 0x10 CLEAR_TITLES, // 0x10
TAB_COMPLETE, // 0x11 COMMAND_SUGGESTIONS, // 0x11
DECLARE_COMMANDS, // 0x12 COMMANDS, // 0x12
CLOSE_WINDOW, // 0x13 CONTAINER_CLOSE, // 0x13
WINDOW_ITEMS, // 0x14 CONTAINER_SET_CONTENT, // 0x14
WINDOW_PROPERTY, // 0x15 CONTAINER_SET_DATA, // 0x15
SET_SLOT, // 0x16 CONTAINER_SET_SLOT, // 0x16
COOLDOWN, // 0x17 COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18 CUSTOM_PAYLOAD, // 0x18
NAMED_SOUND, // 0x19 CUSTOM_SOUND, // 0x19
DISCONNECT, // 0x1A DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B ENTITY_EVENT, // 0x1B
EXPLOSION, // 0x1C EXPLODE, // 0x1C
UNLOAD_CHUNK, // 0x1D FORGET_LEVEL_CHUNK, // 0x1D
GAME_EVENT, // 0x1E GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F HORSE_SCREEN_OPEN, // 0x1F
WORLD_BORDER_INIT, // 0x20 INITIALIZE_BORDER, // 0x20
KEEP_ALIVE, // 0x21 KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22 LEVEL_CHUNK, // 0x22
EFFECT, // 0x23 LEVEL_EVENT, // 0x23
SPAWN_PARTICLE, // 0x24 LEVEL_PARTICLES, // 0x24
UPDATE_LIGHT, // 0x25 LIGHT_UPDATE, // 0x25
JOIN_GAME, // 0x26 LOGIN, // 0x26
MAP_DATA, // 0x27 MAP_ITEM_DATA, // 0x27
TRADE_LIST, // 0x28 MERCHANT_OFFERS, // 0x28
ENTITY_POSITION, // 0x29 MOVE_ENTITY_POS, // 0x29
ENTITY_POSITION_AND_ROTATION, // 0x2A MOVE_ENTITY_POS_ROT, // 0x2A
ENTITY_ROTATION, // 0x2B MOVE_ENTITY_ROT, // 0x2B
VEHICLE_MOVE, // 0x2C MOVE_VEHICLE, // 0x2C
OPEN_BOOK, // 0x2D OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E OPEN_SCREEN, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F OPEN_SIGN_EDITOR, // 0x2F
PING, // 0x30 PING, // 0x30
CRAFT_RECIPE_RESPONSE, // 0x31 PLACE_GHOST_RECIPE, // 0x31
PLAYER_ABILITIES, // 0x32 PLAYER_ABILITIES, // 0x32
COMBAT_END, // 0x33 PLAYER_COMBAT_END, // 0x33
COMBAT_ENTER, // 0x34 PLAYER_COMBAT_ENTER, // 0x34
COMBAT_KILL, // 0x35 PLAYER_COMBAT_KILL, // 0x35
PLAYER_INFO, // 0x36 PLAYER_INFO, // 0x36
FACE_PLAYER, // 0x37 PLAYER_LOOK_AT, // 0x37
PLAYER_POSITION, // 0x38 PLAYER_POSITION, // 0x38
UNLOCK_RECIPES, // 0x39 RECIPE, // 0x39
REMOVE_ENTITIES, // 0x3A REMOVE_ENTITIES, // 0x3A
REMOVE_ENTITY_EFFECT, // 0x3B REMOVE_MOB_EFFECT, // 0x3B
RESOURCE_PACK, // 0x3C RESOURCE_PACK, // 0x3C
RESPAWN, // 0x3D RESPAWN, // 0x3D
ENTITY_HEAD_LOOK, // 0x3E ROTATE_HEAD, // 0x3E
MULTI_BLOCK_CHANGE, // 0x3F SECTION_BLOCKS_UPDATE, // 0x3F
SELECT_ADVANCEMENTS_TAB, // 0x40 SELECT_ADVANCEMENTS_TAB, // 0x40
ACTIONBAR, // 0x41 SET_ACTION_BAR_TEXT, // 0x41
WORLD_BORDER_CENTER, // 0x42 SET_BORDER_CENTER, // 0x42
WORLD_BORDER_LERP_SIZE, // 0x43 SET_BORDER_LERP_SIZE, // 0x43
WORLD_BORDER_SIZE, // 0x44 SET_BORDER_SIZE, // 0x44
WORLD_BORDER_WARNING_DELAY, // 0x45 SET_BORDER_WARNING_DELAY, // 0x45
WORLD_BORDER_WARNING_DISTANCE, // 0x46 SET_BORDER_WARNING_DISTANCE, // 0x46
CAMERA, // 0x47 SET_CAMERA, // 0x47
HELD_ITEM_CHANGE, // 0x48 SET_CARRIED_ITEM, // 0x48
UPDATE_VIEW_POSITION, // 0x49 SET_CHUNK_CACHE_CENTER, // 0x49
UPDATE_VIEW_DISTANCE, // 0x4A SET_CHUNK_CACHE_RADIUS, // 0x4A
SPAWN_POSITION, // 0x4B SET_DEFAULT_SPAWN_POSITION, // 0x4B
DISPLAY_SCOREBOARD, // 0x4C SET_DISPLAY_OBJECTIVE, // 0x4C
ENTITY_METADATA, // 0x4D SET_ENTITY_DATA, // 0x4D
ATTACH_ENTITY, // 0x4E SET_ENTITY_LINK, // 0x4E
ENTITY_VELOCITY, // 0x4F SET_ENTITY_MOTION, // 0x4F
ENTITY_EQUIPMENT, // 0x50 SET_EQUIPMENT, // 0x50
SET_EXPERIENCE, // 0x51 SET_EXPERIENCE, // 0x51
UPDATE_HEALTH, // 0x52 SET_HEALTH, // 0x52
SCOREBOARD_OBJECTIVE, // 0x53 SET_OBJECTIVE, // 0x53
SET_PASSENGERS, // 0x54 SET_PASSENGERS, // 0x54
TEAMS, // 0x55 SET_PLAYER_TEAM, // 0x55
UPDATE_SCORE, // 0x56 SET_SCORE, // 0x56
TITLE_SUBTITLE, // 0x57 SET_SUBTITLE_TEXT, // 0x57
TIME_UPDATE, // 0x58 SET_TIME, // 0x58
TITLE_TEXT, // 0x59 SET_TITLE_TEXT, // 0x59
TITLE_TIMES, // 0x5A SET_TITLES_ANIMATION, // 0x5A
ENTITY_SOUND, // 0x5B SOUND_ENTITY, // 0x5B
SOUND, // 0x5C SOUND, // 0x5C
STOP_SOUND, // 0x5D STOP_SOUND, // 0x5D
TAB_LIST, // 0x5E TAB_LIST, // 0x5E
NBT_QUERY, // 0x5F TAG_QUERY, // 0x5F
COLLECT_ITEM, // 0x60 TAKE_ITEM_ENTITY, // 0x60
ENTITY_TELEPORT, // 0x61 TELEPORT_ENTITY, // 0x61
ADVANCEMENTS, // 0x62 UPDATE_ADVANCEMENTS, // 0x62
ENTITY_PROPERTIES, // 0x63 UPDATE_ATTRIBUTES, // 0x63
ENTITY_EFFECT, // 0x64 UPDATE_MOB_EFFECT, // 0x64
DECLARE_RECIPES, // 0x65 UPDATE_RECIPES, // 0x65
TAGS; // 0x66 UPDATE_TAGS; // 0x66
@Override @Override
public int getId() { public int getId() {

View File

@ -77,7 +77,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
@Override @Override
protected void registerPackets() { protected void registerPackets() {
tagRewriter.registerGeneric(ClientboundPackets1_18.TAGS); tagRewriter.registerGeneric(ClientboundPackets1_18.UPDATE_TAGS);
entityRewriter.register(); entityRewriter.register();
itemRewriter.register(); itemRewriter.register();
@ -100,7 +100,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
handler(soundRewriter.getSoundHandler()); handler(soundRewriter.getSoundHandler());
} }
}); });
registerClientbound(ClientboundPackets1_18.ENTITY_SOUND, new PacketHandlers() { registerClientbound(ClientboundPackets1_18.SOUND_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Sound id map(Type.VAR_INT); // Sound id
@ -112,7 +112,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
handler(soundRewriter.getSoundHandler()); handler(soundRewriter.getSoundHandler());
} }
}); });
registerClientbound(ClientboundPackets1_18.NAMED_SOUND, new PacketHandlers() { registerClientbound(ClientboundPackets1_18.CUSTOM_SOUND, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Sound name map(Type.STRING); // Sound name
@ -126,20 +126,20 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
} }
}); });
new StatisticsRewriter<>(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))); final PacketHandler singleNullTextComponentMapper = wrapper -> wrapper.write(Type.COMPONENT, mapTextComponentIfNull(wrapper.read(Type.COMPONENT)));
registerClientbound(ClientboundPackets1_18.TITLE_TEXT, singleNullTextComponentMapper); registerClientbound(ClientboundPackets1_18.SET_TITLE_TEXT, singleNullTextComponentMapper);
registerClientbound(ClientboundPackets1_18.TITLE_SUBTITLE, singleNullTextComponentMapper); registerClientbound(ClientboundPackets1_18.SET_SUBTITLE_TEXT, singleNullTextComponentMapper);
registerClientbound(ClientboundPackets1_18.ACTIONBAR, singleNullTextComponentMapper); registerClientbound(ClientboundPackets1_18.SET_ACTION_BAR_TEXT, singleNullTextComponentMapper);
registerClientbound(ClientboundPackets1_18.SCOREBOARD_OBJECTIVE, wrapper -> { registerClientbound(ClientboundPackets1_18.SET_OBJECTIVE, wrapper -> {
wrapper.passthrough(Type.STRING); // Objective Name wrapper.passthrough(Type.STRING); // Objective Name
byte action = wrapper.passthrough(Type.BYTE); // Mode byte action = wrapper.passthrough(Type.BYTE); // Mode
if (action == 0 || action == 2) { if (action == 0 || action == 2) {
wrapper.write(Type.COMPONENT, mapTextComponentIfNull(wrapper.read(Type.COMPONENT))); // Display Name 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 wrapper.passthrough(Type.STRING); // Team Name
byte action = wrapper.passthrough(Type.BYTE); // Mode byte action = wrapper.passthrough(Type.BYTE); // Mode
if (action == 0 || action == 2) { if (action == 0 || action == 2) {
@ -154,7 +154,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
}); });
final CommandRewriter<ClientboundPackets1_18> commandRewriter = new CommandRewriter<>(this); final CommandRewriter<ClientboundPackets1_18> commandRewriter = new CommandRewriter<>(this);
registerClientbound(ClientboundPackets1_18.DECLARE_COMMANDS, wrapper -> { registerClientbound(ClientboundPackets1_18.COMMANDS, wrapper -> {
final int size = wrapper.passthrough(Type.VAR_INT); final int size = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
final byte flags = wrapper.passthrough(Type.BYTE); final byte flags = wrapper.passthrough(Type.BYTE);
@ -188,7 +188,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
}); });
// Make every message a system message, including player ones; we don't want to analyze and remove player names from the original component // Make every message a system message, including player ones; we don't want to analyze and remove player names from the original component
registerClientbound(ClientboundPackets1_18.CHAT_MESSAGE, ClientboundPackets1_19.SYSTEM_CHAT, new PacketHandlers() { registerClientbound(ClientboundPackets1_18.CHAT, ClientboundPackets1_19.SYSTEM_CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.COMPONENT); // Message map(Type.COMPONENT); // Message
@ -200,7 +200,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
} }
}); });
registerServerbound(ServerboundPackets1_19.CHAT_MESSAGE, new PacketHandlers() { registerServerbound(ServerboundPackets1_19.CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Message map(Type.STRING); // Message
@ -210,7 +210,7 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol<ClientboundPack
read(Type.BOOLEAN); // Signed preview read(Type.BOOLEAN); // Signed preview
} }
}); });
registerServerbound(ServerboundPackets1_19.CHAT_COMMAND, ServerboundPackets1_17.CHAT_MESSAGE, new PacketHandlers() { registerServerbound(ServerboundPackets1_19.CHAT_COMMAND, ServerboundPackets1_17.CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Command map(Type.STRING); // Command

View File

@ -21,111 +21,111 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_19 implements ClientboundPacketType { public enum ClientboundPackets1_19 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_PLAYER, // 0x02 ADD_PLAYER, // 0x02
ENTITY_ANIMATION, // 0x03 ANIMATE, // 0x03
STATISTICS, // 0x04 AWARD_STATS, // 0x04
BLOCK_CHANGED_ACK, // 0x05 BLOCK_CHANGED_ACK, // 0x05
BLOCK_BREAK_ANIMATION, // 0x06 BLOCK_DESTRUCTION, // 0x06
BLOCK_ENTITY_DATA, // 0x07 BLOCK_ENTITY_DATA, // 0x07
BLOCK_ACTION, // 0x08 BLOCK_EVENT, // 0x08
BLOCK_CHANGE, // 0x09 BLOCK_UPDATE, // 0x09
BOSSBAR, // 0x0A BOSS_EVENT, // 0x0A
SERVER_DIFFICULTY, // 0x0B CHANGE_DIFFICULTY, // 0x0B
CHAT_PREVIEW, // 0x0C CHAT_PREVIEW, // 0x0C
CLEAR_TITLES, // 0x0D CLEAR_TITLES, // 0x0D
TAB_COMPLETE, // 0x0E COMMAND_SUGGESTIONS, // 0x0E
DECLARE_COMMANDS, // 0x0F COMMANDS, // 0x0F
CLOSE_WINDOW, // 0x10 CONTAINER_CLOSE, // 0x10
WINDOW_ITEMS, // 0x11 CONTAINER_SET_CONTENT, // 0x11
WINDOW_PROPERTY, // 0x12 CONTAINER_SET_DATA, // 0x12
SET_SLOT, // 0x13 CONTAINER_SET_SLOT, // 0x13
COOLDOWN, // 0x14 COOLDOWN, // 0x14
PLUGIN_MESSAGE, // 0x15 CUSTOM_PAYLOAD, // 0x15
NAMED_SOUND, // 0x16 CUSTOM_SOUND, // 0x16
DISCONNECT, // 0x17 DISCONNECT, // 0x17
ENTITY_STATUS, // 0x18 ENTITY_EVENT, // 0x18
EXPLOSION, // 0x19 EXPLODE, // 0x19
UNLOAD_CHUNK, // 0x1A FORGET_LEVEL_CHUNK, // 0x1A
GAME_EVENT, // 0x1B GAME_EVENT, // 0x1B
OPEN_HORSE_WINDOW, // 0x1C HORSE_SCREEN_OPEN, // 0x1C
WORLD_BORDER_INIT, // 0x1D INITIALIZE_BORDER, // 0x1D
KEEP_ALIVE, // 0x1E KEEP_ALIVE, // 0x1E
CHUNK_DATA, // 0x1F LEVEL_CHUNK_WITH_LIGHT, // 0x1F
EFFECT, // 0x20 LEVEL_EVENT, // 0x20
SPAWN_PARTICLE, // 0x21 LEVEL_PARTICLES, // 0x21
UPDATE_LIGHT, // 0x22 LIGHT_UPDATE, // 0x22
JOIN_GAME, // 0x23 LOGIN, // 0x23
MAP_DATA, // 0x24 MAP_ITEM_DATA, // 0x24
TRADE_LIST, // 0x25 MERCHANT_OFFERS, // 0x25
ENTITY_POSITION, // 0x26 MOVE_ENTITY_POS, // 0x26
ENTITY_POSITION_AND_ROTATION, // 0x27 MOVE_ENTITY_POS_ROT, // 0x27
ENTITY_ROTATION, // 0x28 MOVE_ENTITY_ROT, // 0x28
VEHICLE_MOVE, // 0x29 MOVE_VEHICLE, // 0x29
OPEN_BOOK, // 0x2A OPEN_BOOK, // 0x2A
OPEN_WINDOW, // 0x2B OPEN_SCREEN, // 0x2B
OPEN_SIGN_EDITOR, // 0x2C OPEN_SIGN_EDITOR, // 0x2C
PING, // 0x2D PING, // 0x2D
CRAFT_RECIPE_RESPONSE, // 0x2E PLACE_GHOST_RECIPE, // 0x2E
PLAYER_ABILITIES, // 0x2F PLAYER_ABILITIES, // 0x2F
PLAYER_CHAT, // 0x30 PLAYER_CHAT, // 0x30
COMBAT_END, // 0x31 PLAYER_COMBAT_END, // 0x31
COMBAT_ENTER, // 0x32 PLAYER_COMBAT_ENTER, // 0x32
COMBAT_KILL, // 0x33 PLAYER_COMBAT_KILL, // 0x33
PLAYER_INFO, // 0x34 PLAYER_INFO, // 0x34
FACE_PLAYER, // 0x35 PLAYER_LOOK_AT, // 0x35
PLAYER_POSITION, // 0x36 PLAYER_POSITION, // 0x36
UNLOCK_RECIPES, // 0x37 RECIPE, // 0x37
REMOVE_ENTITIES, // 0x38 REMOVE_ENTITIES, // 0x38
REMOVE_ENTITY_EFFECT, // 0x39 REMOVE_MOB_EFFECT, // 0x39
RESOURCE_PACK, // 0x3A RESOURCE_PACK, // 0x3A
RESPAWN, // 0x3B RESPAWN, // 0x3B
ENTITY_HEAD_LOOK, // 0x3C ROTATE_HEAD, // 0x3C
MULTI_BLOCK_CHANGE, // 0x3D SECTION_BLOCKS_UPDATE, // 0x3D
SELECT_ADVANCEMENTS_TAB, // 0x3E SELECT_ADVANCEMENTS_TAB, // 0x3E
SERVER_DATA, // 0x3F SERVER_DATA, // 0x3F
ACTIONBAR, // 0x40 SET_ACTION_BAR_TEXT, // 0x40
WORLD_BORDER_CENTER, // 0x41 SET_BORDER_CENTER, // 0x41
WORLD_BORDER_LERP_SIZE, // 0x42 SET_BORDER_LERP_SIZE, // 0x42
WORLD_BORDER_SIZE, // 0x43 SET_BORDER_SIZE, // 0x43
WORLD_BORDER_WARNING_DELAY, // 0x44 SET_BORDER_WARNING_DELAY, // 0x44
WORLD_BORDER_WARNING_DISTANCE, // 0x45 SET_BORDER_WARNING_DISTANCE, // 0x45
CAMERA, // 0x46 SET_CAMERA, // 0x46
HELD_ITEM_CHANGE, // 0x47 SET_CARRIED_ITEM, // 0x47
UPDATE_VIEW_POSITION, // 0x48 SET_CHUNK_CACHE_CENTER, // 0x48
UPDATE_VIEW_DISTANCE, // 0x49 SET_CHUNK_CACHE_RADIUS, // 0x49
SPAWN_POSITION, // 0x4A SET_DEFAULT_SPAWN_POSITION, // 0x4A
SET_DISPLAY_CHAT_PREVIEW, // 0x4B SET_DISPLAY_CHAT_PREVIEW, // 0x4B
DISPLAY_SCOREBOARD, // 0x4C SET_DISPLAY_OBJECTIVE, // 0x4C
ENTITY_METADATA, // 0x4D SET_ENTITY_DATA, // 0x4D
ATTACH_ENTITY, // 0x4E SET_ENTITY_LINK, // 0x4E
ENTITY_VELOCITY, // 0x4F SET_ENTITY_MOTION, // 0x4F
ENTITY_EQUIPMENT, // 0x50 SET_EQUIPMENT, // 0x50
SET_EXPERIENCE, // 0x51 SET_EXPERIENCE, // 0x51
UPDATE_HEALTH, // 0x52 SET_HEALTH, // 0x52
SCOREBOARD_OBJECTIVE, // 0x53 SET_OBJECTIVE, // 0x53
SET_PASSENGERS, // 0x54 SET_PASSENGERS, // 0x54
TEAMS, // 0x55 SET_PLAYER_TEAM, // 0x55
UPDATE_SCORE, // 0x56 SET_SCORE, // 0x56
SET_SIMULATION_DISTANCE, // 0x57 SET_SIMULATION_DISTANCE, // 0x57
TITLE_SUBTITLE, // 0x58 SET_SUBTITLE_TEXT, // 0x58
TIME_UPDATE, // 0x59 SET_TIME, // 0x59
TITLE_TEXT, // 0x5A SET_TITLE_TEXT, // 0x5A
TITLE_TIMES, // 0x5B SET_TITLES_ANIMATION, // 0x5B
ENTITY_SOUND, // 0x5C SOUND_ENTITY, // 0x5C
SOUND, // 0x5D SOUND, // 0x5D
STOP_SOUND, // 0x5E STOP_SOUND, // 0x5E
SYSTEM_CHAT, // 0x5F SYSTEM_CHAT, // 0x5F
TAB_LIST, // 0x60 TAB_LIST, // 0x60
NBT_QUERY, // 0x61 TAG_QUERY, // 0x61
COLLECT_ITEM, // 0x62 TAKE_ITEM_ENTITY, // 0x62
ENTITY_TELEPORT, // 0x63 TELEPORT_ENTITY, // 0x63
ADVANCEMENTS, // 0x64 UPDATE_ADVANCEMENTS, // 0x64
ENTITY_PROPERTIES, // 0x65 UPDATE_ATTRIBUTES, // 0x65
ENTITY_EFFECT, // 0x66 UPDATE_MOB_EFFECT, // 0x66
DECLARE_RECIPES, // 0x67 UPDATE_RECIPES, // 0x67
TAGS; // 0x68 UPDATE_TAGS; // 0x68
@Override @Override
public int getId() { public int getId() {

View File

@ -21,55 +21,55 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_19 implements ServerboundPacketType { public enum ServerboundPackets1_19 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_COMMAND, // 0x03 CHAT_COMMAND, // 0x03
CHAT_MESSAGE, // 0x04 CHAT, // 0x04
CHAT_PREVIEW, // 0x05 CHAT_PREVIEW, // 0x05
CLIENT_STATUS, // 0x06 CLIENT_COMMAND, // 0x06
CLIENT_SETTINGS, // 0x07 CLIENT_INFORMATION, // 0x07
TAB_COMPLETE, // 0x08 COMMAND_SUGGESTION, // 0x08
CLICK_WINDOW_BUTTON, // 0x09 CONTAINER_BUTTON_CLICK, // 0x09
CLICK_WINDOW, // 0x0A CONTAINER_CLICK, // 0x0A
CLOSE_WINDOW, // 0x0B CONTAINER_CLOSE, // 0x0B
PLUGIN_MESSAGE, // 0x0C CUSTOM_PAYLOAD, // 0x0C
EDIT_BOOK, // 0x0D EDIT_BOOK, // 0x0D
ENTITY_NBT_REQUEST, // 0x0E ENTITY_TAG_QUERY, // 0x0E
INTERACT_ENTITY, // 0x0F INTERACT, // 0x0F
GENERATE_JIGSAW, // 0x10 JIGSAW_GENERATE, // 0x10
KEEP_ALIVE, // 0x11 KEEP_ALIVE, // 0x11
LOCK_DIFFICULTY, // 0x12 LOCK_DIFFICULTY, // 0x12
PLAYER_POSITION, // 0x13 MOVE_PLAYER_POS, // 0x13
PLAYER_POSITION_AND_ROTATION, // 0x14 MOVE_PLAYER_POS_ROT, // 0x14
PLAYER_ROTATION, // 0x15 MOVE_PLAYER_ROT, // 0x15
PLAYER_MOVEMENT, // 0x16 MOVE_PLAYER_STATUS_ONLY, // 0x16
VEHICLE_MOVE, // 0x17 MOVE_VEHICLE, // 0x17
STEER_BOAT, // 0x18 PADDLE_BOAT, // 0x18
PICK_ITEM, // 0x19 PICK_ITEM, // 0x19
CRAFT_RECIPE_REQUEST, // 0x1A PLACE_RECIPE, // 0x1A
PLAYER_ABILITIES, // 0x1B PLAYER_ABILITIES, // 0x1B
PLAYER_DIGGING, // 0x1C PLAYER_ACTION, // 0x1C
ENTITY_ACTION, // 0x1D PLAYER_COMMAND, // 0x1D
STEER_VEHICLE, // 0x1E PLAYER_INPUT, // 0x1E
PONG, // 0x1F PONG, // 0x1F
RECIPE_BOOK_DATA, // 0x20 RECIPE_BOOK_CHANGE_SETTINGS, // 0x20
SEEN_RECIPE, // 0x21 RECIPE_BOOK_SEEN_RECIPE, // 0x21
RENAME_ITEM, // 0x22 RENAME_ITEM, // 0x22
RESOURCE_PACK_STATUS, // 0x23 RESOURCE_PACK, // 0x23
ADVANCEMENT_TAB, // 0x24 SEEN_ADVANCEMENTS, // 0x24
SELECT_TRADE, // 0x25 SELECT_TRADE, // 0x25
SET_BEACON_EFFECT, // 0x26 SET_BEACON, // 0x26
HELD_ITEM_CHANGE, // 0x27 SET_CARRIED_ITEM, // 0x27
UPDATE_COMMAND_BLOCK, // 0x28 SET_COMMAND_BLOCK, // 0x28
UPDATE_COMMAND_BLOCK_MINECART, // 0x29 SET_COMMAND_MINECART, // 0x29
CREATIVE_INVENTORY_ACTION, // 0x2A SET_CREATIVE_MODE_SLOT, // 0x2A
UPDATE_JIGSAW_BLOCK, // 0x2B SET_JIGSAW_BLOCK, // 0x2B
UPDATE_STRUCTURE_BLOCK, // 0x2C SET_STRUCTURE_BLOCK, // 0x2C
UPDATE_SIGN, // 0x2D SIGN_UPDATE, // 0x2D
ANIMATION, // 0x2E SWING, // 0x2E
SPECTATE, // 0x2F TELEPORT_TO_ENTITY, // 0x2F
PLAYER_BLOCK_PLACEMENT, // 0x30 USE_ITEM_ON, // 0x30
USE_ITEM; // 0x31 USE_ITEM; // 0x31
@Override @Override

View File

@ -59,11 +59,11 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
@Override @Override
public void registerPackets() { public void registerPackets() {
registerTracker(ClientboundPackets1_18.SPAWN_PLAYER, EntityTypes1_19.PLAYER); registerTracker(ClientboundPackets1_18.ADD_PLAYER, EntityTypes1_19.PLAYER);
registerMetadataRewriter(ClientboundPackets1_18.ENTITY_METADATA, Types1_18.METADATA_LIST, Types1_19.METADATA_LIST); registerMetadataRewriter(ClientboundPackets1_18.SET_ENTITY_DATA, Types1_18.METADATA_LIST, Types1_19.METADATA_LIST);
registerRemoveEntities(ClientboundPackets1_18.REMOVE_ENTITIES); registerRemoveEntities(ClientboundPackets1_18.REMOVE_ENTITIES);
protocol.registerClientbound(ClientboundPackets1_18.SPAWN_ENTITY, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.ADD_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -90,7 +90,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_18.SPAWN_PAINTING, ClientboundPackets1_19.SPAWN_ENTITY, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.ADD_PAINTING, ClientboundPackets1_19.ADD_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -116,7 +116,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
wrapper.cancel(); wrapper.cancel();
// Send motive in metadata // Send motive in metadata
final PacketWrapper metaPacket = wrapper.create(ClientboundPackets1_19.ENTITY_METADATA); final PacketWrapper metaPacket = wrapper.create(ClientboundPackets1_19.SET_ENTITY_DATA);
metaPacket.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0)); // Entity id metaPacket.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0)); // Entity id
final List<Metadata> metadata = new ArrayList<>(); final List<Metadata> metadata = new ArrayList<>();
metadata.add(new Metadata(8, Types1_19.META_TYPES.paintingVariantType, protocol.getMappingData().getPaintingMappings().getNewIdOrDefault(motive, 0))); 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<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_18.SPAWN_MOB, ClientboundPackets1_19.SPAWN_ENTITY, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.ADD_MOB, ClientboundPackets1_19.ADD_ENTITY, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity ID map(Type.VAR_INT); // Entity ID
@ -151,7 +151,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_18.ENTITY_EFFECT, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.UPDATE_MOB_EFFECT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -163,7 +163,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
} }
}); });
protocol.registerClientbound(ClientboundPackets1_18.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity ID map(Type.INT); // Entity ID
@ -336,7 +336,7 @@ public final class EntityPacketRewriter1_19 extends EntityRewriter<ClientboundPa
registerMetaTypeHandler(Types1_19.META_TYPES.itemType, Types1_19.META_TYPES.blockStateType, null); registerMetaTypeHandler(Types1_19.META_TYPES.itemType, Types1_19.META_TYPES.blockStateType, null);
filter().type(EntityTypes1_19.MINECART_ABSTRACT).index(11).handler((event, meta) -> { filter().type(EntityTypes1_19.ABSTRACT_MINECART).index(11).handler((event, meta) -> {
// Convert to new block id // Convert to new block id
final int data = (int) meta.getValue(); final int data = (int) meta.getValue();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));

View File

@ -39,11 +39,11 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter<ClientboundPacket
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSetCooldown(ClientboundPackets1_18.COOLDOWN); registerSetCooldown(ClientboundPackets1_18.COOLDOWN);
registerWindowItems1_17_1(ClientboundPackets1_18.WINDOW_ITEMS); registerWindowItems1_17_1(ClientboundPackets1_18.CONTAINER_SET_CONTENT);
registerSetSlot1_17_1(ClientboundPackets1_18.SET_SLOT); registerSetSlot1_17_1(ClientboundPackets1_18.CONTAINER_SET_SLOT);
registerAdvancements(ClientboundPackets1_18.ADVANCEMENTS); registerAdvancements(ClientboundPackets1_18.UPDATE_ADVANCEMENTS);
registerEntityEquipmentArray(ClientboundPackets1_18.ENTITY_EQUIPMENT); registerEntityEquipmentArray(ClientboundPackets1_18.SET_EQUIPMENT);
protocol.registerClientbound(ClientboundPackets1_18.SPAWN_PARTICLE, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.LEVEL_PARTICLES, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT, Type.VAR_INT); // 0 - Particle ID map(Type.INT, Type.VAR_INT); // 0 - Particle ID
@ -73,12 +73,12 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter<ClientboundPacket
} }
}); });
registerClickWindow1_17_1(ServerboundPackets1_19.CLICK_WINDOW); registerClickWindow1_17_1(ServerboundPackets1_19.CONTAINER_CLICK);
registerCreativeInvAction(ServerboundPackets1_19.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_19.SET_CREATIVE_MODE_SLOT);
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_18.WINDOW_PROPERTY); registerWindowPropertyEnchantmentHandler(ClientboundPackets1_18.CONTAINER_SET_DATA);
protocol.registerClientbound(ClientboundPackets1_18.TRADE_LIST, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_18.MERCHANT_OFFERS, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Container id map(Type.VAR_INT); // Container id
@ -107,7 +107,7 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter<ClientboundPacket
} }
}); });
protocol.registerServerbound(ServerboundPackets1_19.PLAYER_DIGGING, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_19.PLAYER_ACTION, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Action map(Type.VAR_INT); // Action
@ -116,7 +116,7 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter<ClientboundPacket
handler(sequenceHandler()); handler(sequenceHandler());
} }
}); });
protocol.registerServerbound(ServerboundPackets1_19.PLAYER_BLOCK_PLACEMENT, new PacketHandlers() { protocol.registerServerbound(ServerboundPackets1_19.USE_ITEM_ON, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Hand map(Type.VAR_INT); // Hand
@ -137,7 +137,7 @@ public final class ItemPacketRewriter1_19 extends ItemRewriter<ClientboundPacket
} }
}); });
new RecipeRewriter<>(protocol).register(ClientboundPackets1_18.DECLARE_RECIPES); new RecipeRewriter<>(protocol).register(ClientboundPackets1_18.UPDATE_RECIPES);
} }
private PacketHandler sequenceHandler() { private PacketHandler sequenceHandler() {

View File

@ -35,14 +35,14 @@ public final class WorldPacketRewriter1_19 {
public static void register(final Protocol1_18_2To1_19 protocol) { public static void register(final Protocol1_18_2To1_19 protocol) {
final BlockRewriter<ClientboundPackets1_18> blockRewriter = BlockRewriter.for1_14(protocol); final BlockRewriter<ClientboundPackets1_18> blockRewriter = BlockRewriter.for1_14(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_18.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_18.BLOCK_EVENT);
blockRewriter.registerBlockChange(ClientboundPackets1_18.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_18.BLOCK_UPDATE);
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_18.MULTI_BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_18.SECTION_BLOCKS_UPDATE);
blockRewriter.registerEffect(ClientboundPackets1_18.EFFECT, 1010, 2001); 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()); final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set"); Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set");
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height 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 // Primary effect
if (wrapper.read(Type.BOOLEAN)) { if (wrapper.read(Type.BOOLEAN)) {
wrapper.passthrough(Type.VAR_INT); wrapper.passthrough(Type.VAR_INT);

View File

@ -40,9 +40,9 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol<ClientboundPack
protected void registerPackets() { protected void registerPackets() {
final TagRewriter<ClientboundPackets1_18> tagRewriter = new TagRewriter<>(this); final TagRewriter<ClientboundPackets1_18> tagRewriter = new TagRewriter<>(this);
tagRewriter.addEmptyTag(RegistryType.BLOCK, "minecraft:fall_damage_resetting"); 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 @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -50,7 +50,7 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol<ClientboundPack
} }
}); });
registerClientbound(ClientboundPackets1_18.REMOVE_ENTITY_EFFECT, new PacketHandlers() { registerClientbound(ClientboundPackets1_18.REMOVE_MOB_EFFECT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Entity id map(Type.VAR_INT); // Entity id
@ -58,7 +58,7 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol<ClientboundPack
} }
}); });
registerClientbound(ClientboundPackets1_18.JOIN_GAME, new PacketHandlers() { registerClientbound(ClientboundPackets1_18.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity ID map(Type.INT); // Entity ID

View File

@ -83,7 +83,7 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol<ClientboundPa
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:bookshelf_books", "minecraft:hanging_signs", "minecraft:stripped_logs"); tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:bookshelf_books", "minecraft:hanging_signs", "minecraft:stripped_logs");
tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:all_hanging_signs", "minecraft:ceiling_hanging_signs", "minecraft:invalid_spawn_inside", tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:all_hanging_signs", "minecraft:ceiling_hanging_signs", "minecraft:invalid_spawn_inside",
"minecraft:stripped_logs", "minecraft:wall_hanging_signs"); "minecraft:stripped_logs", "minecraft:wall_hanging_signs");
tagRewriter.registerGeneric(ClientboundPackets1_19_1.TAGS); tagRewriter.registerGeneric(ClientboundPackets1_19_1.UPDATE_TAGS);
entityRewriter.register(); entityRewriter.register();
itemRewriter.register(); itemRewriter.register();
@ -99,14 +99,14 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol<ClientboundPa
wrapper.write(Type.SOUND_EVENT, Holder.of(soundId)); wrapper.write(Type.SOUND_EVENT, Holder.of(soundId));
}; };
registerClientbound(ClientboundPackets1_19_1.ENTITY_SOUND, soundHandler); registerClientbound(ClientboundPackets1_19_1.SOUND_ENTITY, soundHandler);
registerClientbound(ClientboundPackets1_19_1.SOUND, soundHandler); registerClientbound(ClientboundPackets1_19_1.SOUND, soundHandler);
registerClientbound(ClientboundPackets1_19_1.NAMED_SOUND, ClientboundPackets1_19_3.SOUND, wrapper -> { registerClientbound(ClientboundPackets1_19_1.CUSTOM_SOUND, ClientboundPackets1_19_3.SOUND, wrapper -> {
final String soundIdentifier = wrapper.read(Type.STRING); final String soundIdentifier = wrapper.read(Type.STRING);
wrapper.write(Type.SOUND_EVENT, Holder.of(new SoundEvent(soundIdentifier, null))); 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<ClientboundPackets1_19_1> commandRewriter = new CommandRewriter<>(this) { final CommandRewriter<ClientboundPackets1_19_1> commandRewriter = new CommandRewriter<>(this) {
@Override @Override
@ -130,7 +130,7 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol<ClientboundPa
}; };
} }
}; };
commandRewriter.registerDeclareCommands1_19(ClientboundPackets1_19_1.DECLARE_COMMANDS); commandRewriter.registerDeclareCommands1_19(ClientboundPackets1_19_1.COMMANDS);
registerClientbound(ClientboundPackets1_19_1.SERVER_DATA, new PacketHandlers() { registerClientbound(ClientboundPackets1_19_1.SERVER_DATA, new PacketHandlers() {
@Override @Override
@ -244,7 +244,7 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol<ClientboundPa
read(Type.ACKNOWLEDGED_BIT_SET); // Acknowledged read(Type.ACKNOWLEDGED_BIT_SET); // Acknowledged
} }
}); });
registerServerbound(ServerboundPackets1_19_3.CHAT_MESSAGE, new PacketHandlers() { registerServerbound(ServerboundPackets1_19_3.CHAT, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Message map(Type.STRING); // Message
@ -339,7 +339,7 @@ public final class Protocol1_19_1To1_19_3 extends AbstractProtocol<ClientboundPa
}); });
cancelServerbound(ServerboundPackets1_19_3.CHAT_SESSION_UPDATE); cancelServerbound(ServerboundPackets1_19_3.CHAT_SESSION_UPDATE);
cancelClientbound(ClientboundPackets1_19_1.DELETE_CHAT_MESSAGE); cancelClientbound(ClientboundPackets1_19_1.DELETE_CHAT);
cancelClientbound(ClientboundPackets1_19_1.PLAYER_CHAT_HEADER); cancelClientbound(ClientboundPackets1_19_1.PLAYER_CHAT_HEADER);
cancelClientbound(ClientboundPackets1_19_1.CHAT_PREVIEW); cancelClientbound(ClientboundPackets1_19_1.CHAT_PREVIEW);
cancelClientbound(ClientboundPackets1_19_1.SET_DISPLAY_CHAT_PREVIEW); cancelClientbound(ClientboundPackets1_19_1.SET_DISPLAY_CHAT_PREVIEW);

View File

@ -21,113 +21,113 @@ import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
public enum ClientboundPackets1_19_3 implements ClientboundPacketType { public enum ClientboundPackets1_19_3 implements ClientboundPacketType {
SPAWN_ENTITY, // 0x00 ADD_ENTITY, // 0x00
SPAWN_EXPERIENCE_ORB, // 0x01 ADD_EXPERIENCE_ORB, // 0x01
SPAWN_PLAYER, // 0x02 ADD_PLAYER, // 0x02
ENTITY_ANIMATION, // 0x03 ANIMATE, // 0x03
STATISTICS, // 0x04 AWARD_STATS, // 0x04
BLOCK_CHANGED_ACK, // 0x05 BLOCK_CHANGED_ACK, // 0x05
BLOCK_BREAK_ANIMATION, // 0x06 BLOCK_DESTRUCTION, // 0x06
BLOCK_ENTITY_DATA, // 0x07 BLOCK_ENTITY_DATA, // 0x07
BLOCK_ACTION, // 0x08 BLOCK_EVENT, // 0x08
BLOCK_CHANGE, // 0x09 BLOCK_UPDATE, // 0x09
BOSSBAR, // 0x0A BOSS_EVENT, // 0x0A
SERVER_DIFFICULTY, // 0x0B CHANGE_DIFFICULTY, // 0x0B
CLEAR_TITLES, // 0x0C CLEAR_TITLES, // 0x0C
TAB_COMPLETE, // 0x0D COMMAND_SUGGESTIONS, // 0x0D
DECLARE_COMMANDS, // 0x0E COMMANDS, // 0x0E
CLOSE_WINDOW, // 0x0F CONTAINER_CLOSE, // 0x0F
WINDOW_ITEMS, // 0x10 CONTAINER_SET_CONTENT, // 0x10
WINDOW_PROPERTY, // 0x11 CONTAINER_SET_DATA, // 0x11
SET_SLOT, // 0x12 CONTAINER_SET_SLOT, // 0x12
COOLDOWN, // 0x13 COOLDOWN, // 0x13
CUSTOM_CHAT_COMPLETIONS, // 0x14 CUSTOM_CHAT_COMPLETIONS, // 0x14
PLUGIN_MESSAGE, // 0x15 CUSTOM_PAYLOAD, // 0x15
DELETE_CHAT_MESSAGE, // 0x16 DELETE_CHAT, // 0x16
DISCONNECT, // 0x17 DISCONNECT, // 0x17
DISGUISED_CHAT, // 0x18 DISGUISED_CHAT, // 0x18
ENTITY_STATUS, // 0x19 ENTITY_EVENT, // 0x19
EXPLOSION, // 0x1A EXPLODE, // 0x1A
UNLOAD_CHUNK, // 0x1B FORGET_LEVEL_CHUNK, // 0x1B
GAME_EVENT, // 0x1C GAME_EVENT, // 0x1C
OPEN_HORSE_WINDOW, // 0x1D HORSE_SCREEN_OPEN, // 0x1D
WORLD_BORDER_INIT, // 0x1E INITIALIZE_BORDER, // 0x1E
KEEP_ALIVE, // 0x1F KEEP_ALIVE, // 0x1F
CHUNK_DATA, // 0x20 LEVEL_CHUNK_WITH_LIGHT, // 0x20
EFFECT, // 0x21 LEVEL_EVENT, // 0x21
SPAWN_PARTICLE, // 0x22 LEVEL_PARTICLES, // 0x22
UPDATE_LIGHT, // 0x23 LIGHT_UPDATE, // 0x23
JOIN_GAME, // 0x24 LOGIN, // 0x24
MAP_DATA, // 0x25 MAP_ITEM_DATA, // 0x25
TRADE_LIST, // 0x26 MERCHANT_OFFERS, // 0x26
ENTITY_POSITION, // 0x27 MOVE_ENTITY_POS, // 0x27
ENTITY_POSITION_AND_ROTATION, // 0x28 MOVE_ENTITY_POS_ROT, // 0x28
ENTITY_ROTATION, // 0x29 MOVE_ENTITY_ROT, // 0x29
VEHICLE_MOVE, // 0x2A MOVE_VEHICLE, // 0x2A
OPEN_BOOK, // 0x2B OPEN_BOOK, // 0x2B
OPEN_WINDOW, // 0x2C OPEN_SCREEN, // 0x2C
OPEN_SIGN_EDITOR, // 0x2D OPEN_SIGN_EDITOR, // 0x2D
PING, // 0x2E PING, // 0x2E
CRAFT_RECIPE_RESPONSE, // 0x2F PLACE_GHOST_RECIPE, // 0x2F
PLAYER_ABILITIES, // 0x30 PLAYER_ABILITIES, // 0x30
PLAYER_CHAT, // 0x31 PLAYER_CHAT, // 0x31
COMBAT_END, // 0x32 PLAYER_COMBAT_END, // 0x32
COMBAT_ENTER, // 0x33 PLAYER_COMBAT_ENTER, // 0x33
COMBAT_KILL, // 0x34 PLAYER_COMBAT_KILL, // 0x34
PLAYER_INFO_REMOVE, // 0x35 PLAYER_INFO_REMOVE, // 0x35
PLAYER_INFO_UPDATE, // 0x36 PLAYER_INFO_UPDATE, // 0x36
FACE_PLAYER, // 0x37 PLAYER_LOOK_AT, // 0x37
PLAYER_POSITION, // 0x38 PLAYER_POSITION, // 0x38
UNLOCK_RECIPES, // 0x39 RECIPE, // 0x39
REMOVE_ENTITIES, // 0x3A REMOVE_ENTITIES, // 0x3A
REMOVE_ENTITY_EFFECT, // 0x3B REMOVE_MOB_EFFECT, // 0x3B
RESOURCE_PACK, // 0x3C RESOURCE_PACK, // 0x3C
RESPAWN, // 0x3D RESPAWN, // 0x3D
ENTITY_HEAD_LOOK, // 0x3E ROTATE_HEAD, // 0x3E
MULTI_BLOCK_CHANGE, // 0x3F SECTION_BLOCKS_UPDATE, // 0x3F
SELECT_ADVANCEMENTS_TAB, // 0x40 SELECT_ADVANCEMENTS_TAB, // 0x40
SERVER_DATA, // 0x41 SERVER_DATA, // 0x41
ACTIONBAR, // 0x42 SET_ACTION_BAR_TEXT, // 0x42
WORLD_BORDER_CENTER, // 0x43 SET_BORDER_CENTER, // 0x43
WORLD_BORDER_LERP_SIZE, // 0x44 SET_BORDER_LERP_SIZE, // 0x44
WORLD_BORDER_SIZE, // 0x45 SET_BORDER_SIZE, // 0x45
WORLD_BORDER_WARNING_DELAY, // 0x46 SET_BORDER_WARNING_DELAY, // 0x46
WORLD_BORDER_WARNING_DISTANCE, // 0x47 SET_BORDER_WARNING_DISTANCE, // 0x47
CAMERA, // 0x48 SET_CAMERA, // 0x48
HELD_ITEM_CHANGE, // 0x49 SET_CARRIED_ITEM, // 0x49
UPDATE_VIEW_POSITION, // 0x4A SET_CHUNK_CACHE_CENTER, // 0x4A
UPDATE_VIEW_DISTANCE, // 0x4B SET_CHUNK_CACHE_RADIUS, // 0x4B
SPAWN_POSITION, // 0x4C SET_DEFAULT_SPAWN_POSITION, // 0x4C
DISPLAY_SCOREBOARD, // 0x4D SET_DISPLAY_OBJECTIVE, // 0x4D
ENTITY_METADATA, // 0x4E SET_ENTITY_DATA, // 0x4E
ATTACH_ENTITY, // 0x4F SET_ENTITY_LINK, // 0x4F
ENTITY_VELOCITY, // 0x50 SET_ENTITY_MOTION, // 0x50
ENTITY_EQUIPMENT, // 0x51 SET_EQUIPMENT, // 0x51
SET_EXPERIENCE, // 0x52 SET_EXPERIENCE, // 0x52
UPDATE_HEALTH, // 0x53 SET_HEALTH, // 0x53
SCOREBOARD_OBJECTIVE, // 0x54 SET_OBJECTIVE, // 0x54
SET_PASSENGERS, // 0x55 SET_PASSENGERS, // 0x55
TEAMS, // 0x56 SET_PLAYER_TEAM, // 0x56
UPDATE_SCORE, // 0x57 SET_SCORE, // 0x57
SET_SIMULATION_DISTANCE, // 0x58 SET_SIMULATION_DISTANCE, // 0x58
TITLE_SUBTITLE, // 0x59 SET_SUBTITLE_TEXT, // 0x59
TIME_UPDATE, // 0x5A SET_TIME, // 0x5A
TITLE_TEXT, // 0x5B SET_TITLE_TEXT, // 0x5B
TITLE_TIMES, // 0x5C SET_TITLES_ANIMATION, // 0x5C
ENTITY_SOUND, // 0x5D SOUND_ENTITY, // 0x5D
SOUND, // 0x5E SOUND, // 0x5E
STOP_SOUND, // 0x5F STOP_SOUND, // 0x5F
SYSTEM_CHAT, // 0x60 SYSTEM_CHAT, // 0x60
TAB_LIST, // 0x61 TAB_LIST, // 0x61
NBT_QUERY, // 0x62 TAG_QUERY, // 0x62
COLLECT_ITEM, // 0x63 TAKE_ITEM_ENTITY, // 0x63
ENTITY_TELEPORT, // 0x64 TELEPORT_ENTITY, // 0x64
ADVANCEMENTS, // 0x65 UPDATE_ADVANCEMENTS, // 0x65
ENTITY_PROPERTIES, // 0x66 UPDATE_ATTRIBUTES, // 0x66
UPDATE_ENABLED_FEATURES, // 0x67 UPDATE_ENABLED_FEATURES, // 0x67
ENTITY_EFFECT, // 0x68 UPDATE_MOB_EFFECT, // 0x68
DECLARE_RECIPES, // 0x69 UPDATE_RECIPES, // 0x69
TAGS; // 0x6A UPDATE_TAGS; // 0x6A
@Override @Override
public int getId() { public int getId() {

View File

@ -21,56 +21,56 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
public enum ServerboundPackets1_19_3 implements ServerboundPacketType { public enum ServerboundPackets1_19_3 implements ServerboundPacketType {
TELEPORT_CONFIRM, // 0x00 ACCEPT_TELEPORTATION, // 0x00
QUERY_BLOCK_NBT, // 0x01 BLOCK_ENTITY_TAG_QUERY, // 0x01
SET_DIFFICULTY, // 0x02 CHANGE_DIFFICULTY, // 0x02
CHAT_ACK, // 0x03 CHAT_ACK, // 0x03
CHAT_COMMAND, // 0x04 CHAT_COMMAND, // 0x04
CHAT_MESSAGE, // 0x05 CHAT, // 0x05
CLIENT_STATUS, // 0x06 CLIENT_COMMAND, // 0x06
CLIENT_SETTINGS, // 0x07 CLIENT_INFORMATION, // 0x07
TAB_COMPLETE, // 0x08 COMMAND_SUGGESTION, // 0x08
CLICK_WINDOW_BUTTON, // 0x09 CONTAINER_BUTTON_CLICK, // 0x09
CLICK_WINDOW, // 0x0A CONTAINER_CLICK, // 0x0A
CLOSE_WINDOW, // 0x0B CONTAINER_CLOSE, // 0x0B
PLUGIN_MESSAGE, // 0x0C CUSTOM_PAYLOAD, // 0x0C
EDIT_BOOK, // 0x0D EDIT_BOOK, // 0x0D
ENTITY_NBT_REQUEST, // 0x0E ENTITY_TAG_QUERY, // 0x0E
INTERACT_ENTITY, // 0x0F INTERACT, // 0x0F
GENERATE_JIGSAW, // 0x10 JIGSAW_GENERATE, // 0x10
KEEP_ALIVE, // 0x11 KEEP_ALIVE, // 0x11
LOCK_DIFFICULTY, // 0x12 LOCK_DIFFICULTY, // 0x12
PLAYER_POSITION, // 0x13 MOVE_PLAYER_POS, // 0x13
PLAYER_POSITION_AND_ROTATION, // 0x14 MOVE_PLAYER_POS_ROT, // 0x14
PLAYER_ROTATION, // 0x15 MOVE_PLAYER_ROT, // 0x15
PLAYER_MOVEMENT, // 0x16 MOVE_PLAYER_STATUS_ONLY, // 0x16
VEHICLE_MOVE, // 0x17 MOVE_VEHICLE, // 0x17
STEER_BOAT, // 0x18 PADDLE_BOAT, // 0x18
PICK_ITEM, // 0x19 PICK_ITEM, // 0x19
CRAFT_RECIPE_REQUEST, // 0x1A PLACE_RECIPE, // 0x1A
PLAYER_ABILITIES, // 0x1B PLAYER_ABILITIES, // 0x1B
PLAYER_DIGGING, // 0x1C PLAYER_ACTION, // 0x1C
ENTITY_ACTION, // 0x1D PLAYER_COMMAND, // 0x1D
STEER_VEHICLE, // 0x1E PLAYER_INPUT, // 0x1E
PONG, // 0x1F PONG, // 0x1F
CHAT_SESSION_UPDATE, // 0x20 CHAT_SESSION_UPDATE, // 0x20
RECIPE_BOOK_DATA, // 0x21 RECIPE_BOOK_CHANGE_SETTINGS, // 0x21
SEEN_RECIPE, // 0x22 RECIPE_BOOK_SEEN_RECIPE, // 0x22
RENAME_ITEM, // 0x23 RENAME_ITEM, // 0x23
RESOURCE_PACK_STATUS, // 0x24 RESOURCE_PACK, // 0x24
ADVANCEMENT_TAB, // 0x25 SEEN_ADVANCEMENTS, // 0x25
SELECT_TRADE, // 0x26 SELECT_TRADE, // 0x26
SET_BEACON_EFFECT, // 0x27 SET_BEACON, // 0x27
HELD_ITEM_CHANGE, // 0x28 SET_CARRIED_ITEM, // 0x28
UPDATE_COMMAND_BLOCK, // 0x29 SET_COMMAND_BLOCK, // 0x29
UPDATE_COMMAND_BLOCK_MINECART, // 0x2A SET_COMMAND_MINECART, // 0x2A
CREATIVE_INVENTORY_ACTION, // 0x2B SET_CREATIVE_MODE_SLOT, // 0x2B
UPDATE_JIGSAW_BLOCK, // 0x2C SET_JIGSAW_BLOCK, // 0x2C
UPDATE_STRUCTURE_BLOCK, // 0x2D SET_STRUCTURE_BLOCK, // 0x2D
UPDATE_SIGN, // 0x2E SIGN_UPDATE, // 0x2E
ANIMATION, // 0x2F SWING, // 0x2F
SPECTATE, // 0x30 TELEPORT_TO_ENTITY, // 0x30
PLAYER_BLOCK_PLACEMENT, // 0x31 USE_ITEM_ON, // 0x31
USE_ITEM; // 0x32 USE_ITEM; // 0x32
@Override @Override

View File

@ -40,13 +40,13 @@ public final class EntityPacketRewriter1_19_3 extends EntityRewriter<Clientbound
@Override @Override
public void registerPackets() { public void registerPackets() {
registerTrackerWithData1_19(ClientboundPackets1_19_1.SPAWN_ENTITY, EntityTypes1_19_3.FALLING_BLOCK); registerTrackerWithData1_19(ClientboundPackets1_19_1.ADD_ENTITY, EntityTypes1_19_3.FALLING_BLOCK);
registerTracker(ClientboundPackets1_19_1.SPAWN_EXPERIENCE_ORB, EntityTypes1_19_3.EXPERIENCE_ORB); registerTracker(ClientboundPackets1_19_1.ADD_EXPERIENCE_ORB, EntityTypes1_19_3.EXPERIENCE_ORB);
registerTracker(ClientboundPackets1_19_1.SPAWN_PLAYER, EntityTypes1_19_3.PLAYER); registerTracker(ClientboundPackets1_19_1.ADD_PLAYER, EntityTypes1_19_3.PLAYER);
registerMetadataRewriter(ClientboundPackets1_19_1.ENTITY_METADATA, Types1_19.METADATA_LIST, Types1_19_3.METADATA_LIST); registerMetadataRewriter(ClientboundPackets1_19_1.SET_ENTITY_DATA, Types1_19.METADATA_LIST, Types1_19_3.METADATA_LIST);
registerRemoveEntities(ClientboundPackets1_19_1.REMOVE_ENTITIES); registerRemoveEntities(ClientboundPackets1_19_1.REMOVE_ENTITIES);
protocol.registerClientbound(ClientboundPackets1_19_1.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_19_1.LOGIN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity id map(Type.INT); // Entity id
@ -161,7 +161,7 @@ public final class EntityPacketRewriter1_19_3 extends EntityRewriter<Clientbound
meta.setValue(pose + 1); meta.setValue(pose + 1);
} }
}); });
filter().type(EntityTypes1_19_3.MINECART_ABSTRACT).index(11).handler((event, meta) -> { filter().type(EntityTypes1_19_3.ABSTRACT_MINECART).index(11).handler((event, meta) -> {
// Convert to new block id // Convert to new block id
final int data = (int) meta.getValue(); final int data = (int) meta.getValue();
meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); meta.setValue(protocol.getMappingData().getNewBlockStateId(data));

Some files were not shown because too many files have changed in this diff Show More