From d7af1ac31a69c92ff03cd848bbb1e6f149bbbe41 Mon Sep 17 00:00:00 2001 From: extremeheat Date: Mon, 23 Dec 2024 07:41:08 +0000 Subject: [PATCH] backport some 1.21.3 changes to 1.21.1 --- data/pc/1.21.1/proto.yml | 283 +++++++++--------------------- data/pc/1.21.1/protocol.json | 330 ++++++++++++++--------------------- data/pc/1.21.3/protocol.json | 29 ++- data/pc/latest/proto.yml | 85 +++------ 4 files changed, 253 insertions(+), 474 deletions(-) diff --git a/data/pc/1.21.1/proto.yml b/data/pc/1.21.1/proto.yml index c18459dd9..4477a5d6f 100644 --- a/data/pc/1.21.1/proto.yml +++ b/data/pc/1.21.1/proto.yml @@ -33,7 +33,6 @@ anonOptionalNbt: native registryEntryHolder: native registryEntryHolderSet: native - arrayWithLengthOffset: native ByteArray: ["buffer", { "countType": "varint" }] string: [ "pstring", @@ -122,8 +121,9 @@ SlotComponent: type: SlotComponentType + ## Ref: client/net/minecraft/core/component/DataComponents.java data: type ? - # TODO: look into how nbt works here + ## TODO: look into how nbt works here if custom_data: anonymousNbt if max_stack_size: varint if max_damage: varint @@ -148,7 +148,7 @@ if attribute_modifiers: attributes: []varint typeId: varint - uniqueId: UUID + uuid: UUID name: string value: f64 operation: varint => @@ -174,18 +174,11 @@ if creative_slot_lock: void if enchantment_glint_override: bool if intangible_projectile: void - # Name Type Description - # Nutrition VarInt Non-negative - # Saturation Modifier Float How much saturation will be given after consuming the item. - # Can Always Eat Boolean Whether the item can always be eaten, even at full hunger. - # Seconds To Eat Float How long it takes to consume the item. - # Using converts to Slot Data This specifies the item produced after consuming the current item. In the Notchian server, this is used for stews, which turn into bowls. Set this to Air if the item should be consumed normally without leaving any other item after. - # Number of effects VarInt Number of elements in the following array. - # Effect Type ID Array Potion Effect The potion effect. See Potion Effect. - # Probability Float The probability for this effect to be chosen. if food: nutrition: varint + # How much saturation will be given after consuming the item. saturationModifier: f32 + # Whether the item can always be eaten, even at full hunger. canAlwaysEat: bool secondsToEat: f32 usingConvertsTo: Slot @@ -193,34 +186,22 @@ effect: varint probability: f32 if fire_resistant: void - # Name Type Description - # Number of Rules VarInt The number of elements in the following array. - # Rule - # Blocks Array Block Set The block this rule applies to. See Block Set. - # Has Speed Boolean - # Speed Optional Float The speed at which the tool breaks this rules' blocks. Only present if Has Speed is true. - # Has Correct Drop For Blocks Boolean - # Correct Drop For Blocks Optional Boolean Whether items should drop only if this is the correct tool. Only present if Has Correct Drop For Blocks is true. - # Default Mining Speed Float The mining speed in case none of the previous rule were matched. - # Damage Per Block VarInt The amount of damage the item takes per block break. if tool: rules: []varint - blocks: BlockSet[]varint - hasSpeed: bool - speed: f32 - hasCorrectDropForBlocks: bool - correctDropForBlocks: bool + blocks: IDSet + # The speed at which the tool breaks this rules' blocks. + speed?: f32 + # Whether items should drop only if this is the correct tool. + correctDropForBlocks?: bool + # The mining speed in case none of the previous rule were matched. defaultMiningSpeed: f32 damagePerBlock: varint - # Name Type Description - # Number of enchantments VarInt Number of elements in the following array. - # Enchantment Type ID Array VarInt Enum The ID of the enchantment in the enchantment registry. - # Level VarInt The level of the enchantment. - # Show In Tooltip Boolean Whether the list of enchantments should be shown on the item's tooltip. if stored_enchantments: enchantments: []varint + # The ID of the enchantment in the enchantment registry. id: varint level: varint + # Whether the list of enchantments should be shown on the item's tooltip. showInTooltip: bool if dyed_color: color: varint @@ -233,52 +214,29 @@ projectiles: Slot[]varint if bundle_contents: contents: Slot[]varint - # Name Type Description - # Has Potion ID Boolean Whether this potion has an ID in the potion registry. If true, it has the default effects associated with the potion type. - # Potion ID Optional VarInt The ID of the potion type in the potion registry. Only present if Has Potion ID is true. - # Has Custom Color Boolean Whether this potion has a custom color. If false, it uses the default color associated with the potion type. - # Custom Color Optional Int The RGB components of the color, encoded as an integer. Only present if Has Custom Color is true. - # Number Of Custom Effects VarInt The number of elements in the following array. - # Custom Effects Array of Potion Effect Any custom effects the potion might have. See Potion Effect. if potion_contents: - hasPotionId: bool - potionId: optvarint - hasCustomColor: bool - customColor: optvarint - customEffects: []varint - effect: varint - details: EffectDetail - # Name Type Description - # Number Of Effects VarInt Number of elements in the following array. - # Effect Type ID Array VarInt Enum The ID of the effect in the potion effect type registry. - # Duration VarInt The duration of the effect. + # True if this potion has an ID in the potion registry--it has the default effects associated with the potion type. + potionId?: varint + # The RGB components of the color, encoded as an integer. + customColor?: varint + customEffects: PotionEffect[]varint + customName: string if suspicious_stew_effects: effects: []varint + # The ID of the effect in the potion effect type registry. effect: varint + # The duration of the effect. duration: varint - # Name Type Description - # Number Of Pages VarInt Number of elements in the following array. - # Page Raw Content Array (100) String (1024) The raw text of the page. - # Has Filtered Content Boolean - # Filtered Content Optional String (1024) The content after passing through chat filters. Only present if Has Filtered Content is true. if writable_book_content: + # Max 100 pages pages: BookPage[]varint - # Name Type Description - # Raw Title String (32) The raw title of the book. - # Has Filtered Title Boolean - # Filtered Title Optional String (32) The title after going through chat filters. Only present if Has Filtered Title is true. - # Author String - # Generation VarInt - # Number Of Pages VarInt Number of elements in the following array. - # Page Raw Content Array (100) TextComponent (1024) The raw text of the page. - # Has Filtered Content Boolean - # Filtered Content Optional Text Component (1024) The content after passing through chat filters. Only present if Has Filtered Content is true. - # Resolved Boolean Whether entity selectors have already been resolved. if written_book_content: + # The raw title of the book, up to 32 characters. rawTitle: string filteredTitle?: string author: string generation: varint + # Max 100 pages pages: BookPage[]varint # Whether entity selectors have already been resolved. resolved: bool @@ -376,53 +334,28 @@ songLocation: string showInTooltip: bool if recipes: anonymousNbt - # Name Type Description - # Has Global Position Boolean Whether this lodestone points to a position, otherwise it spins randomly. - # Dimension Identifier The dimension the compass points to. Only present if Has Global Position is true. - # Position Position The position the compass points to. Only present if Has Global Position is true. - # Tracked Boolean Whether the component is removed when the associated lodestone is broken. if lodestone_tracker: + # Specified if this lodestone points to a position; otherwise it spins randomly. globalPosition?: dimension: string - position: vec3f + # The position the compass points to. Only present if Has Global Position is true. + position: position + # Whether the component is removed when the associated lodestone is broken. tracked: bool - # Name Type Description - # Shape VarInt Enum Can be one of the following: - # 0 - Small ball - # 1 - Large ball - # 2 - Star - # 3 - Creeper - # 4 - Burst - # Number Of Colors VarInt The number of elements in the following array. - # Colors Array of Int The RGB components of the color, encoded as an integer. - # Number Of Fade Colors VarInt The number of elements in the following array. - # Fade Colors Array of Int The RGB components of the color, encoded as an integer. - # Has Trail Boolean - # Has Twinkle Boolean if firework_explosion: FireworkExplosion if fireworks: flightDuration: varint explosions: FireworkExplosion[]varint - # Name Type Description - # Has Name Boolean - # Name Optional String (16) Only present if Has Name is true. - # Has Unique ID Boolean - # Unique ID Optional UUID Only present if Has Unique ID is true. - # Number of Properties VarInt Number of elements in the following array. - # Property Name Array String (64) - # Value String - # Has Signature Boolean - # Signature String (1024) Only present if Has Signature is true. if profile: - hasName: bool - name: string - hasUniqueId: bool - uniqueId: UUID + # If the profile has a name, max 16 characters. + name?: string + uuid?: UUID properties: []varint + # Max 64 characters property: string value: string - hasSignature: bool - signature: string + # Max 1024 characters + signature?: string if note_block_sound: string # Name Type Description # Number of Layers VarInt Number of elements in the following array. @@ -473,64 +406,8 @@ _: itemCount ? if 0: void default: - itemId: varint -# https://wiki.vg/Slot_Data#Structured_components -# + public static final DataComponentType CUSTOM_DATA = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final IntComponentType MAX_STACK_SIZE = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final IntComponentType MAX_DAMAGE = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final IntComponentType DAMAGE = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final BooleanComponentType UNBREAKABLE = new BooleanComponentType(ByteBuf::readBoolean, ByteBuf::writeBoolean, BooleanDataComponent::new); -# + public static final DataComponentType CUSTOM_NAME = new DataComponentType<>(ItemCodecHelper::readComponent, ItemCodecHelper::writeComponent, ObjectDataComponent::new); -# + public static final DataComponentType ITEM_NAME = new DataComponentType<>(ItemCodecHelper::readComponent, ItemCodecHelper::writeComponent, ObjectDataComponent::new); -# + public static final DataComponentType> LORE = new DataComponentType<>(listReader(ItemCodecHelper::readComponent), listWriter(ItemCodecHelper::writeComponent), ObjectDataComponent::new); -# + public static final IntComponentType RARITY = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType ENCHANTMENTS = new DataComponentType<>(ItemCodecHelper::readItemEnchantments, ItemCodecHelper::writeItemEnchantments, ObjectDataComponent::new); -# + public static final DataComponentType CAN_PLACE_ON = new DataComponentType<>(ItemCodecHelper::readAdventureModePredicate, ItemCodecHelper::writeAdventureModePredicate, ObjectDataComponent::new); -# + public static final DataComponentType CAN_BREAK = new DataComponentType<>(ItemCodecHelper::readAdventureModePredicate, ItemCodecHelper::writeAdventureModePredicate, ObjectDataComponent::new); -# + public static final DataComponentType ATTRIBUTE_MODIFIERS = new DataComponentType<>(ItemCodecHelper::readItemAttributeModifiers, ItemCodecHelper::writeItemAttributeModifiers, ObjectDataComponent::new); -# + public static final IntComponentType CUSTOM_MODEL_DATA = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType HIDE_ADDITIONAL_TOOLTIP = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new); -# + public static final DataComponentType HIDE_TOOLTIP = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new); -# + public static final IntComponentType REPAIR_COST = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType CREATIVE_SLOT_LOCK = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new); -# + public static final BooleanComponentType ENCHANTMENT_GLINT_OVERRIDE = new BooleanComponentType(ByteBuf::readBoolean, ByteBuf::writeBoolean, BooleanDataComponent::new); -# + public static final DataComponentType INTANGIBLE_PROJECTILE = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final DataComponentType FOOD = new DataComponentType<>(ItemCodecHelper::readFoodProperties, ItemCodecHelper::writeFoodProperties, ObjectDataComponent::new); -# + public static final DataComponentType FIRE_RESISTANT = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new); -# + public static final DataComponentType TOOL = new DataComponentType<>(ItemCodecHelper::readToolData, ItemCodecHelper::writeToolData, ObjectDataComponent::new); -# + public static final DataComponentType STORED_ENCHANTMENTS = new DataComponentType<>(ItemCodecHelper::readItemEnchantments, ItemCodecHelper::writeItemEnchantments, ObjectDataComponent::new); -# + public static final DataComponentType DYED_COLOR = new DataComponentType<>(ItemCodecHelper::readDyedItemColor, ItemCodecHelper::writeDyedItemColor, ObjectDataComponent::new); -# + public static final IntComponentType MAP_COLOR = new IntComponentType((helper, input) -> input.readInt(), (helper, output, value) -> output.writeInt(value), IntDataComponent::new); -# + public static final IntComponentType MAP_ID = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType MAP_DECORATIONS = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final IntComponentType MAP_POST_PROCESSING = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType> CHARGED_PROJECTILES = new DataComponentType<>(listReader(ItemCodecHelper::readItemStack), listWriter(ItemCodecHelper::writeItemStack), ObjectDataComponent::new); -# + public static final DataComponentType> BUNDLE_CONTENTS = new DataComponentType<>(listReader(ItemCodecHelper::readItemStack), listWriter(ItemCodecHelper::writeItemStack), ObjectDataComponent::new); -# + public static final DataComponentType POTION_CONTENTS = new DataComponentType<>(ItemCodecHelper::readPotionContents, ItemCodecHelper::writePotionContents, ObjectDataComponent::new); -# + public static final DataComponentType> SUSPICIOUS_STEW_EFFECTS = new DataComponentType<>(listReader(ItemCodecHelper::readStewEffect), listWriter(ItemCodecHelper::writeStewEffect), ObjectDataComponent::new); -# + public static final DataComponentType WRITABLE_BOOK_CONTENT = new DataComponentType<>(ItemCodecHelper::readWritableBookContent, ItemCodecHelper::writeWritableBookContent, ObjectDataComponent::new); -# + public static final DataComponentType WRITTEN_BOOK_CONTENT = new DataComponentType<>(ItemCodecHelper::readWrittenBookContent, ItemCodecHelper::writeWrittenBookContent, ObjectDataComponent::new); -# + public static final DataComponentType TRIM = new DataComponentType<>(ItemCodecHelper::readArmorTrim, ItemCodecHelper::writeArmorTrim, ObjectDataComponent::new); -# + public static final DataComponentType DEBUG_STICK_STATE = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final DataComponentType ENTITY_DATA = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final DataComponentType BUCKET_ENTITY_DATA = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final DataComponentType BLOCK_ENTITY_DATA = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); -# + public static final DataComponentType> INSTRUMENT = new DataComponentType<>(ItemCodecHelper::readInstrument, ItemCodecHelper::writeInstrument, ObjectDataComponent::new); -# + public static final IntComponentType OMINOUS_BOTTLE_AMPLIFIER = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType RECIPES = new DataComponentType<>(ItemCodecHelper::readRecipes, ItemCodecHelper::writeRecipes, ObjectDataComponent::new); -# + public static final DataComponentType LODESTONE_TRACKER = new DataComponentType<>(ItemCodecHelper::readLodestoneTarget, ItemCodecHelper::writeLodestoneTarget, ObjectDataComponent::new); -# + public static final DataComponentType FIREWORK_EXPLOSION = new DataComponentType<>(ItemCodecHelper::readFireworkExplosion, ItemCodecHelper::writeFireworkExplosion, ObjectDataComponent::new); -# + public static final DataComponentType FIREWORKS = new DataComponentType<>(ItemCodecHelper::readFireworks, ItemCodecHelper::writeFireworks, ObjectDataComponent::new); -# + public static final DataComponentType PROFILE = new DataComponentType<>(ItemCodecHelper::readResolvableProfile, ItemCodecHelper::writeResolvableProfile, ObjectDataComponent::new); -# + public static final DataComponentType NOTE_BLOCK_SOUND = new DataComponentType<>(ItemCodecHelper::readResourceLocation, ItemCodecHelper::writeResourceLocation, ObjectDataComponent::new); -# + public static final DataComponentType> BANNER_PATTERNS = new DataComponentType<>(listReader(ItemCodecHelper::readBannerPatternLayer), listWriter(ItemCodecHelper::writeBannerPatternLayer), ObjectDataComponent::new); -# + public static final IntComponentType BASE_COLOR = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new); -# + public static final DataComponentType> POT_DECORATIONS = new DataComponentType<>(listReader(ItemCodecHelper::readVarInt), listWriter(ItemCodecHelper::writeVarInt), ObjectDataComponent::new); -# + public static final DataComponentType> CONTAINER = new DataComponentType<>(listReader(ItemCodecHelper::readOptionalItemStack), listWriter(MinecraftCodecHelper::writeOptionalItemStack), ObjectDataComponent::new); -# + public static final DataComponentType BLOCK_STATE = new DataComponentType<>(ItemCodecHelper::readBlockStateProperties, ItemCodecHelper::writeBlockStateProperties, ObjectDataComponent::new); -# + public static final DataComponentType> BEES = new DataComponentType<>(listReader(ItemCodecHelper::readBeehiveOccupant), listWriter(ItemCodecHelper::writeBeehiveOccupant), ObjectDataComponent::new); -# + public static final DataComponentType LOCK = new DataComponentType<>(ItemCodecHelper::readLock, ItemCodecHelper::writeLock, ObjectDataComponent::new); -# + public static final DataComponentType CONTAINER_LOOT = new DataComponentType<>(ItemCodecHelper::readAnyTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); + item: varint + # https://wiki.vg/Slot_Data#Structured_components addedComponentCount: varint removedComponentCount: varint components: SlotComponent[]$addedComponentCount @@ -539,17 +416,22 @@ FireworkExplosion: shape: varint => - - small_ball - - large_ball - - star - - creeper - - burst + - small_ball + - large_ball + - star + - creeper + - burst + # The RGB components of the color, encoded as an integer. colors: i32[]varint + # The RGB components of the color, encoded as an integer. fadeColors: i32[]varint + # Whether the firework has a trail. hasTrail: bool + # Whether the firework has a twinkle effect. hasTwinkle: bool BookPage: + # The raw text of the page. TextComponent, max 1024 characters. content: string filteredContent?: string @@ -561,15 +443,9 @@ showIcon: bool hiddenEffect?: EffectDetail - BlockSet: - type: varint - name: type ? - if 0: string - default: void - # TODO: This will require a custom type ; we need type - 1 length of blockIds - blockIds: type ? - if 0: void - default: ["arrayWithLengthOffset", {"count": "type", "type": "varint", "lengthOffset": -1}] + PotionEffect: + id: varint + details: EffectDetail BlockProperty: # Name of the block state property. @@ -584,7 +460,10 @@ maxValue?: string BlockPredicate: - blockSet?: BlockSet[]varint + blockSet?: ["registryEntryHolderSet", { + "base": { name: "name", type: "string" }, + "otherwise": { name: "blockIds", type: "varint" } + }] properties?: BlockProperty[]varint nbt: anonOptionalNbt @@ -858,19 +737,26 @@ }] if frog_variant: varint if optional_global_pos: ["option", "string"] - if painting_variant: - width: varint - height: varint - assetId: string + if painting_variant: ["registryEntryHolder", { + "baseName": "variantId", + "otherwise": { name: "variantData", type: "EntityMetadataPaintingVariant" } + }] if sniffer_state: varint if armadillo_state: varint if vector3: vec3f if quaternion: vec4f + EntityMetadataPaintingVariant: + width: i32 + height: i32 + assetId: string + title?: anonymousNbt + author?: anonymousNbt EntityMetadataWolfVariant: wildTexture: string tameTexture: string angryTexture: string biome: IDSet + entityMetadata: ["entityMetadataLoop", { "endVal": 255, "type": "entityMetadataEntry" }] minecraft_simple_recipe_format: category: varint @@ -1249,6 +1135,16 @@ details: []varint key: string value: string + # MC: ClientboundResourcePackPopPacket + packet_common_remove_resource_pack: + uuid?: UUID + # MC: ClientboundResourcePackPushPacket + packet_common_add_resource_pack: + uuid: UUID + url: string + hash: string + forced: bool + promptMessage?: anonymousNbt ServerLinkType: varint => - bug_report @@ -1441,16 +1337,6 @@ entries: []varint key: string value?: anonymousNbt - # MC: ClientboundResourcePackPopPacket - packet_remove_resource_pack: - uuid?: UUID - # MC: ClientboundResourcePackPushPacket - packet_add_resource_pack: - uuid: UUID - url: string - hash: string - forced: bool - promptMessage?: anonymousNbt ## (Store cookie and Transfer are Common) ## # MC: ClientboundUpdateEnabledFeaturesPacket packet_feature_flags: @@ -1489,8 +1375,8 @@ if ping: packet_ping if reset_chat: packet_reset_chat if registry_data: packet_registry_data - if remove_resource_pack: packet_remove_resource_pack - if add_resource_pack: packet_add_resource_pack + if remove_resource_pack: packet_common_remove_resource_pack + if add_resource_pack: packet_common_add_resource_pack if store_cookie: packet_common_store_cookie if transfer: packet_common_transfer if feature_flags: packet_feature_flags @@ -2040,7 +1926,8 @@ "initialize_chat", "update_game_mode", "update_listed", - "update_latency" + "update_latency", + "update_display_name" ] }] data: []varint @@ -2111,16 +1998,6 @@ packet_reset_score: entity_name: string objective_name?: string - # MC: ClientboundResourcePackPopPacket - packet_remove_resource_pack: - uuid?: UUID - # MC: ClientboundResourcePackPushPacket - packet_add_resource_pack: - uuid: UUID - url: string - hash: string - forced: bool - promptMessage?: anonymousNbt # MC: ClientboundRespawnPacket packet_respawn: worldState: SpawnInfo @@ -2768,8 +2645,8 @@ if entity_destroy: packet_entity_destroy if remove_entity_effect: packet_remove_entity_effect if reset_score: packet_reset_score - if remove_resource_pack: packet_remove_resource_pack - if add_resource_pack: packet_add_resource_pack + if remove_resource_pack: packet_common_remove_resource_pack + if add_resource_pack: packet_common_add_resource_pack if respawn: packet_respawn if entity_head_rotation: packet_entity_head_rotation if multi_block_change: packet_multi_block_change diff --git a/data/pc/1.21.1/protocol.json b/data/pc/1.21.1/protocol.json index 88a016fd8..bdaeb2a34 100644 --- a/data/pc/1.21.1/protocol.json +++ b/data/pc/1.21.1/protocol.json @@ -31,7 +31,6 @@ "anonOptionalNbt": "native", "registryEntryHolder": "native", "registryEntryHolderSet": "native", - "arrayWithLengthOffset": "native", "ByteArray": [ "buffer", { @@ -316,7 +315,7 @@ "type": "varint" }, { - "name": "uniqueId", + "name": "uuid", "type": "UUID" }, { @@ -442,29 +441,21 @@ [ { "name": "blocks", - "type": [ - "array", - { - "countType": "varint", - "type": "BlockSet" - } - ] - }, - { - "name": "hasSpeed", - "type": "bool" + "type": "IDSet" }, { "name": "speed", - "type": "f32" - }, - { - "name": "hasCorrectDropForBlocks", - "type": "bool" + "type": [ + "option", + "f32" + ] }, { "name": "correctDropForBlocks", - "type": "bool" + "type": [ + "option", + "bool" + ] } ] ] @@ -562,21 +553,19 @@ "potion_contents": [ "container", [ - { - "name": "hasPotionId", - "type": "bool" - }, { "name": "potionId", - "type": "optvarint" - }, - { - "name": "hasCustomColor", - "type": "bool" + "type": [ + "option", + "varint" + ] }, { "name": "customColor", - "type": "optvarint" + "type": [ + "option", + "varint" + ] }, { "name": "customEffects", @@ -584,21 +573,13 @@ "array", { "countType": "varint", - "type": [ - "container", - [ - { - "name": "effect", - "type": "varint" - }, - { - "name": "details", - "type": "EffectDetail" - } - ] - ] + "type": "PotionEffect" } ] + }, + { + "name": "customName", + "type": "string" } ] ], @@ -961,7 +942,7 @@ }, { "name": "position", - "type": "vec3f" + "type": "position" } ] ] @@ -996,21 +977,19 @@ "profile": [ "container", [ - { - "name": "hasName", - "type": "bool" - }, { "name": "name", - "type": "string" - }, - { - "name": "hasUniqueId", - "type": "bool" + "type": [ + "option", + "string" + ] }, { - "name": "uniqueId", - "type": "UUID" + "name": "uuid", + "type": [ + "option", + "UUID" + ] }, { "name": "properties", @@ -1029,13 +1008,12 @@ "name": "value", "type": "string" }, - { - "name": "hasSignature", - "type": "bool" - }, { "name": "signature", - "type": "string" + "type": [ + "option", + "string" + ] } ] ] @@ -1213,7 +1191,7 @@ "container", [ { - "name": "itemId", + "name": "item", "type": "varint" }, { @@ -1356,45 +1334,16 @@ } ] ], - "BlockSet": [ + "PotionEffect": [ "container", [ { - "name": "type", + "name": "id", "type": "varint" }, { - "name": "name", - "type": [ - "switch", - { - "compareTo": "type", - "fields": { - "0": "string" - }, - "default": "void" - } - ] - }, - { - "name": "blockIds", - "type": [ - "switch", - { - "compareTo": "type", - "fields": { - "0": "void" - }, - "default": [ - "arrayWithLengthOffset", - { - "count": "type", - "type": "varint", - "lengthOffset": -1 - } - ] - } - ] + "name": "details", + "type": "EffectDetail" } ] ], @@ -1440,10 +1389,16 @@ "type": [ "option", [ - "array", + "registryEntryHolderSet", { - "countType": "varint", - "type": "BlockSet" + "base": { + "name": "name", + "type": "string" + }, + "otherwise": { + "name": "blockIds", + "type": "varint" + } } ] ] @@ -1945,21 +1900,14 @@ "string" ], "painting_variant": [ - "container", - [ - { - "name": "width", - "type": "varint" - }, - { - "name": "height", - "type": "varint" - }, - { - "name": "assetId", - "type": "string" + "registryEntryHolder", + { + "baseName": "variantId", + "otherwise": { + "name": "variantData", + "type": "EntityMetadataPaintingVariant" } - ] + } ], "sniffer_state": "varint", "armadillo_state": "varint", @@ -1971,6 +1919,37 @@ } ] ], + "EntityMetadataPaintingVariant": [ + "container", + [ + { + "name": "width", + "type": "i32" + }, + { + "name": "height", + "type": "i32" + }, + { + "name": "assetId", + "type": "string" + }, + { + "name": "title", + "type": [ + "option", + "anonymousNbt" + ] + }, + { + "name": "author", + "type": [ + "option", + "anonymousNbt" + ] + } + ] + ], "EntityMetadataWolfVariant": [ "container", [ @@ -2806,6 +2785,46 @@ } ] ], + "packet_common_remove_resource_pack": [ + "container", + [ + { + "name": "uuid", + "type": [ + "option", + "UUID" + ] + } + ] + ], + "packet_common_add_resource_pack": [ + "container", + [ + { + "name": "uuid", + "type": "UUID" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "hash", + "type": "string" + }, + { + "name": "forced", + "type": "bool" + }, + { + "name": "promptMessage", + "type": [ + "option", + "anonymousNbt" + ] + } + ] + ], "ServerLinkType": [ "mapper", { @@ -3414,46 +3433,6 @@ } ] ], - "packet_remove_resource_pack": [ - "container", - [ - { - "name": "uuid", - "type": [ - "option", - "UUID" - ] - } - ] - ], - "packet_add_resource_pack": [ - "container", - [ - { - "name": "uuid", - "type": "UUID" - }, - { - "name": "url", - "type": "string" - }, - { - "name": "hash", - "type": "string" - }, - { - "name": "forced", - "type": "bool" - }, - { - "name": "promptMessage", - "type": [ - "option", - "anonymousNbt" - ] - } - ] - ], "packet_feature_flags": [ "container", [ @@ -3542,8 +3521,8 @@ "ping": "packet_ping", "reset_chat": "packet_reset_chat", "registry_data": "packet_registry_data", - "remove_resource_pack": "packet_remove_resource_pack", - "add_resource_pack": "packet_add_resource_pack", + "remove_resource_pack": "packet_common_remove_resource_pack", + "add_resource_pack": "packet_common_add_resource_pack", "store_cookie": "packet_common_store_cookie", "transfer": "packet_common_transfer", "feature_flags": "packet_feature_flags", @@ -5588,7 +5567,8 @@ "initialize_chat", "update_game_mode", "update_listed", - "update_latency" + "update_latency", + "update_display_name" ] } ] @@ -5892,46 +5872,6 @@ } ] ], - "packet_remove_resource_pack": [ - "container", - [ - { - "name": "uuid", - "type": [ - "option", - "UUID" - ] - } - ] - ], - "packet_add_resource_pack": [ - "container", - [ - { - "name": "uuid", - "type": "UUID" - }, - { - "name": "url", - "type": "string" - }, - { - "name": "hash", - "type": "string" - }, - { - "name": "forced", - "type": "bool" - }, - { - "name": "promptMessage", - "type": [ - "option", - "anonymousNbt" - ] - } - ] - ], "packet_respawn": [ "container", [ @@ -7668,8 +7608,8 @@ "entity_destroy": "packet_entity_destroy", "remove_entity_effect": "packet_remove_entity_effect", "reset_score": "packet_reset_score", - "remove_resource_pack": "packet_remove_resource_pack", - "add_resource_pack": "packet_add_resource_pack", + "remove_resource_pack": "packet_common_remove_resource_pack", + "add_resource_pack": "packet_common_add_resource_pack", "respawn": "packet_respawn", "entity_head_rotation": "packet_entity_head_rotation", "multi_block_change": "packet_multi_block_change", diff --git a/data/pc/1.21.3/protocol.json b/data/pc/1.21.3/protocol.json index 58b449500..85336fca0 100644 --- a/data/pc/1.21.3/protocol.json +++ b/data/pc/1.21.3/protocol.json @@ -1374,21 +1374,19 @@ "profile": [ "container", [ - { - "name": "hasName", - "type": "bool" - }, { "name": "name", - "type": "string" - }, - { - "name": "hasUniqueId", - "type": "bool" + "type": [ + "option", + "string" + ] }, { - "name": "uniqueId", - "type": "UUID" + "name": "uuid", + "type": [ + "option", + "UUID" + ] }, { "name": "properties", @@ -1407,13 +1405,12 @@ "name": "value", "type": "string" }, - { - "name": "hasSignature", - "type": "bool" - }, { "name": "signature", - "type": "string" + "type": [ + "option", + "string" + ] } ] ] diff --git a/data/pc/latest/proto.yml b/data/pc/latest/proto.yml index 6c17299b4..69c5fdafd 100644 --- a/data/pc/latest/proto.yml +++ b/data/pc/latest/proto.yml @@ -337,37 +337,22 @@ customColor?: varint customEffects: PotionEffect[]varint customName: string - # Name Type Description - # Number Of Effects VarInt Number of elements in the following array. - # Effect Type ID Array VarInt Enum The ID of the effect in the potion effect type registry. - # Duration VarInt The duration of the effect. if suspicious_stew_effects: effects: []varint + # The ID of the effect in the potion effect type registry. effect: varint + # The duration of the effect. duration: varint - # Name Type Description - # Number Of Pages VarInt Number of elements in the following array. - # Page Raw Content Array (100) String (1024) The raw text of the page. - # Has Filtered Content Boolean - # Filtered Content Optional String (1024) The content after passing through chat filters. Only present if Has Filtered Content is true. if writable_book_content: + # Max 100 pages pages: BookPage[]varint - # Name Type Description - # Raw Title String (32) The raw title of the book. - # Has Filtered Title Boolean - # Filtered Title Optional String (32) The title after going through chat filters. Only present if Has Filtered Title is true. - # Author String - # Generation VarInt - # Number Of Pages VarInt Number of elements in the following array. - # Page Raw Content Array (100) TextComponent (1024) The raw text of the page. - # Has Filtered Content Boolean - # Filtered Content Optional Text Component (1024) The content after passing through chat filters. Only present if Has Filtered Content is true. - # Resolved Boolean Whether entity selectors have already been resolved. if written_book_content: + # The raw title of the book, up to 32 characters. rawTitle: string filteredTitle?: string author: string generation: varint + # Max 100 pages pages: BookPage[]varint # Whether entity selectors have already been resolved. resolved: bool @@ -465,53 +450,28 @@ songLocation: string showInTooltip: bool if recipes: anonymousNbt - # Name Type Description - # Has Global Position Boolean Whether this lodestone points to a position, otherwise it spins randomly. - # Dimension Identifier The dimension the compass points to. Only present if Has Global Position is true. - # Position Position The position the compass points to. Only present if Has Global Position is true. - # Tracked Boolean Whether the component is removed when the associated lodestone is broken. if lodestone_tracker: + # Specified if this lodestone points to a position; otherwise it spins randomly. globalPosition?: dimension: string + # The position the compass points to. Only present if Has Global Position is true. position: position + # Whether the component is removed when the associated lodestone is broken. tracked: bool - # Name Type Description - # Shape VarInt Enum Can be one of the following: - # 0 - Small ball - # 1 - Large ball - # 2 - Star - # 3 - Creeper - # 4 - Burst - # Number Of Colors VarInt The number of elements in the following array. - # Colors Array of Int The RGB components of the color, encoded as an integer. - # Number Of Fade Colors VarInt The number of elements in the following array. - # Fade Colors Array of Int The RGB components of the color, encoded as an integer. - # Has Trail Boolean - # Has Twinkle Boolean if firework_explosion: FireworkExplosion if fireworks: flightDuration: varint explosions: FireworkExplosion[]varint - # Name Type Description - # Has Name Boolean - # Name Optional String (16) Only present if Has Name is true. - # Has Unique ID Boolean - # Unique ID Optional UUID Only present if Has Unique ID is true. - # Number of Properties VarInt Number of elements in the following array. - # Property Name Array String (64) - # Value String - # Has Signature Boolean - # Signature String (1024) Only present if Has Signature is true. if profile: - hasName: bool - name: string - hasUniqueId: bool - uniqueId: UUID + # If the profile has a name, max 16 characters. + name?: string + uuid?: UUID properties: []varint + # Max 64 characters property: string value: string - hasSignature: bool - signature: string + # Max 1024 characters + signature?: string if note_block_sound: string # Name Type Description # Number of Layers VarInt Number of elements in the following array. @@ -563,7 +523,7 @@ if 0: void default: item: varint -# https://wiki.vg/Slot_Data#Structured_components + # https://wiki.vg/Slot_Data#Structured_components addedComponentCount: varint removedComponentCount: varint components: SlotComponent[]$addedComponentCount @@ -572,17 +532,22 @@ FireworkExplosion: shape: varint => - - small_ball - - large_ball - - star - - creeper - - burst + - small_ball + - large_ball + - star + - creeper + - burst + # The RGB components of the color, encoded as an integer. colors: i32[]varint + # The RGB components of the color, encoded as an integer. fadeColors: i32[]varint + # Whether the firework has a trail. hasTrail: bool + # Whether the firework has a twinkle effect. hasTwinkle: bool BookPage: + # The raw text of the page. TextComponent, max 1024 characters. content: string filteredContent?: string