diff --git a/data/pc/1.21.1/proto.yml b/data/pc/1.21.1/proto.yml index 4477a5d6f..621afc736 100644 --- a/data/pc/1.21.1/proto.yml +++ b/data/pc/1.21.1/proto.yml @@ -34,12 +34,7 @@ registryEntryHolder: native registryEntryHolderSet: native ByteArray: ["buffer", { "countType": "varint" }] - string: [ - "pstring", - { - "countType": "varint" - } - ] + string: ["pstring", { "countType": "varint" }] vec2f: x: f32 y: f32 @@ -61,63 +56,63 @@ "otherwise": { name: "ids", type: "varint" } }] SlotComponentType: varint => - - custom_data - - max_stack_size - - max_damage - - damage - - unbreakable - - custom_name - - item_name - - lore - - rarity - - enchantments - - can_place_on - - can_break - - attribute_modifiers - - custom_model_data - - hide_additional_tooltip - - hide_tooltip - - repair_cost - - creative_slot_lock - - enchantment_glint_override - - intangible_projectile - - food - - fire_resistant - - tool - - stored_enchantments - - dyed_color - - map_color - - map_id - - map_decorations - - map_post_processing - - charged_projectiles - - bundle_contents - - potion_contents - - suspicious_stew_effects - - writable_book_content - - written_book_content - - trim - - debug_stick_state - - entity_data - - bucket_entity_data - - block_entity_data - - instrument - - ominous_bottle_amplifier - - jukebox_playable - - recipes - - lodestone_tracker - - firework_explosion - - fireworks - - profile - - note_block_sound - - banner_patterns - - base_color - - pot_decorations - - container - - block_state - - bees - - lock - - container_loot + - custom_data + - max_stack_size + - max_damage + - damage + - unbreakable + - custom_name + - item_name + - lore + - rarity + - enchantments + - can_place_on + - can_break + - attribute_modifiers + - custom_model_data + - hide_additional_tooltip + - hide_tooltip + - repair_cost + - creative_slot_lock + - enchantment_glint_override + - intangible_projectile + - food + - fire_resistant + - tool + - stored_enchantments + - dyed_color + - map_color + - map_id + - map_decorations + - map_post_processing + - charged_projectiles + - bundle_contents + - potion_contents + - suspicious_stew_effects + - writable_book_content + - written_book_content + - trim + - debug_stick_state + - entity_data + - bucket_entity_data + - block_entity_data + - instrument + - ominous_bottle_amplifier + - jukebox_playable + - recipes + - lodestone_tracker + - firework_explosion + - fireworks + - profile + - note_block_sound + - banner_patterns + - base_color + - pot_decorations + - container + - block_state + - bees + - lock + - container_loot SlotComponent: type: SlotComponentType @@ -143,7 +138,7 @@ level: varint showTooltip: bool if can_place_on or can_break: - predicates: BlockPredicate[]varint + predicates: ItemBlockPredicate[]varint showTooltip: bool if attribute_modifiers: attributes: []varint @@ -219,7 +214,7 @@ potionId?: varint # The RGB components of the color, encoded as an integer. customColor?: varint - customEffects: PotionEffect[]varint + customEffects: ItemPotionEffect[]varint customName: string if suspicious_stew_effects: effects: []varint @@ -229,7 +224,7 @@ duration: varint if writable_book_content: # Max 100 pages - pages: BookPage[]varint + pages: ItemBookPage[]varint if written_book_content: # The raw title of the book, up to 32 characters. rawTitle: string @@ -237,7 +232,7 @@ author: string generation: varint # Max 100 pages - pages: BookPage[]varint + pages: ItemBookPage[]varint # Whether entity selectors have already been resolved. resolved: bool # Name Type Description @@ -342,10 +337,10 @@ position: position # Whether the component is removed when the associated lodestone is broken. tracked: bool - if firework_explosion: FireworkExplosion + if firework_explosion: ItemFireworkExplosion if fireworks: flightDuration: varint - explosions: FireworkExplosion[]varint + explosions: ItemFireworkExplosion[]varint if profile: # If the profile has a name, max 16 characters. name?: string @@ -401,20 +396,12 @@ if lock: anonymousNbt if container_loot: anonymousNbt - Slot: - itemCount: i8 - _: itemCount ? - if 0: void - default: - item: varint - # https://wiki.vg/Slot_Data#Structured_components - addedComponentCount: varint - removedComponentCount: varint - components: SlotComponent[]$addedComponentCount - removeComponents: []$removedComponentCount - type: SlotComponentType + # TODO: see latest todo + ItemSoundEvent: + soundName: string + fixedRange?: f32 - FireworkExplosion: + ItemFireworkExplosion: shape: varint => - small_ball - large_ball @@ -430,24 +417,19 @@ # Whether the firework has a twinkle effect. hasTwinkle: bool - BookPage: - # The raw text of the page. TextComponent, max 1024 characters. - content: string - filteredContent?: string - - EffectDetail: + ItemEffectDetail: amplifier: varint duration: varint ambient: bool showParticles: bool showIcon: bool - hiddenEffect?: EffectDetail + hiddenEffect?: ItemEffectDetail - PotionEffect: + ItemPotionEffect: id: varint - details: EffectDetail + details: ItemEffectDetail - BlockProperty: + ItemBlockProperty: # Name of the block state property. name: string # Whether this is an exact value match, as opposed to ranged. @@ -459,126 +441,144 @@ # Maximum value of the block state property range. Only present in ranged match mode. maxValue?: string - BlockPredicate: + ItemBlockPredicate: blockSet?: ["registryEntryHolderSet", { "base": { name: "name", type: "string" }, "otherwise": { name: "blockIds", type: "varint" } }] - properties?: BlockProperty[]varint + properties?: ItemBlockProperty[]varint nbt: anonOptionalNbt + ItemBookPage: + # The raw text of the page. TextComponent, max 1024 characters. + content: string + filteredContent?: string + + Slot: + itemCount: varint + _: itemCount ? + if 0: void + default: + item: varint + # https://wiki.vg/Slot_Data#Structured_components + addedComponentCount: varint + removedComponentCount: varint + components: SlotComponent[]$addedComponentCount + removeComponents: []$removedComponentCount + type: SlotComponentType + Particle: # See client/net/minecraft/core/particles/ParticleTypes.java type: varint => - - angry_villager - - block - - block_marker - - bubble - - cloud - - crit - - damage_indicator - - dragon_breath - - dripping_lava - - falling_lava - - landing_lava - - dripping_water - - falling_water - - dust - - dust_color_transition - - effect - - elder_guardian - - enchanted_hit - - enchant - - end_rod - - entity_effect - - explosion_emitter - - explosion - - gust - - small_gust - - gust_emitter_large - - gust_emitter_small - - sonic_boom - - falling_dust - - firework - - fishing - - flame - - infested - - cherry_leaves - - sculk_soul - - sculk_charge - - sculk_charge_pop - - soul_fire_flame - - soul - - flash - - happy_villager - - composter - - heart - - instant_effect - - item - - vibration - - item_slime - - item_cobweb - - item_snowball - - large_smoke - - lava - - mycelium - - note - - poof - - portal - - rain - - smoke - - white_smoke - - sneeze - - spit - - squid_ink - - sweep_attack - - totem_of_undying - - underwater - - splash - - witch - - bubble_pop - - current_down - - bubble_column_up - - nautilus - - dolphin - - campfire_cosy_smoke - - campfire_signal_smoke - - dripping_honey - - falling_honey - - landing_honey - - falling_nectar - - falling_spore_blossom - - ash - - crimson_spore - - warped_spore - - spore_blossom_air - - dripping_obsidian_tear - - falling_obsidian_tear - - landing_obsidian_tear - - reverse_portal - - white_ash - - small_flame - - snowflake - - dripping_dripstone_lava - - falling_dripstone_lava - - dripping_dripstone_water - - falling_dripstone_water - - glow_squid_ink - - glow - - wax_on - - wax_off - - electric_spark - - scrape - - shriek - - egg_crack - - dust_plume - - trial_spawner_detected_player - - trial_spawner_detected_player_ominous - - vault_connection - - dust_pillar - - ominous_spawning - - raid_omen - - trial_omen + - angry_villager + - block + - block_marker + - bubble + - cloud + - crit + - damage_indicator + - dragon_breath + - dripping_lava + - falling_lava + - landing_lava + - dripping_water + - falling_water + - dust + - dust_color_transition + - effect + - elder_guardian + - enchanted_hit + - enchant + - end_rod + - entity_effect + - explosion_emitter + - explosion + - gust + - small_gust + - gust_emitter_large + - gust_emitter_small + - sonic_boom + - falling_dust + - firework + - fishing + - flame + - infested + - cherry_leaves + - sculk_soul + - sculk_charge + - sculk_charge_pop + - soul_fire_flame + - soul + - flash + - happy_villager + - composter + - heart + - instant_effect + - item + - vibration + - item_slime + - item_cobweb + - item_snowball + - large_smoke + - lava + - mycelium + - note + - poof + - portal + - rain + - smoke + - white_smoke + - sneeze + - spit + - squid_ink + - sweep_attack + - totem_of_undying + - underwater + - splash + - witch + - bubble_pop + - current_down + - bubble_column_up + - nautilus + - dolphin + - campfire_cosy_smoke + - campfire_signal_smoke + - dripping_honey + - falling_honey + - landing_honey + - falling_nectar + - falling_spore_blossom + - ash + - crimson_spore + - warped_spore + - spore_blossom_air + - dripping_obsidian_tear + - falling_obsidian_tear + - landing_obsidian_tear + - reverse_portal + - white_ash + - small_flame + - snowflake + - dripping_dripstone_lava + - falling_dripstone_lava + - dripping_dripstone_water + - falling_dripstone_water + - glow_squid_ink + - glow + - wax_on + - wax_off + - electric_spark + - scrape + - shriek + - egg_crack + - dust_plume + - trial_spawner_detected_player + - trial_spawner_detected_player_ominous + - vault_connection + - dust_pillar + - ominous_spawning + - raid_omen + - trial_omen ## ## Tips for reviewing particle data (as of 1.20.5) ## Inside the registry code, each particle can have an associated "options" type and ## each options type can add additional data to be encoded. diff --git a/data/pc/1.21.1/protocol.json b/data/pc/1.21.1/protocol.json index bdaeb2a34..0b817f426 100644 --- a/data/pc/1.21.1/protocol.json +++ b/data/pc/1.21.1/protocol.json @@ -269,7 +269,7 @@ "array", { "countType": "varint", - "type": "BlockPredicate" + "type": "ItemBlockPredicate" } ] }, @@ -288,7 +288,7 @@ "array", { "countType": "varint", - "type": "BlockPredicate" + "type": "ItemBlockPredicate" } ] }, @@ -573,7 +573,7 @@ "array", { "countType": "varint", - "type": "PotionEffect" + "type": "ItemPotionEffect" } ] }, @@ -619,7 +619,7 @@ "array", { "countType": "varint", - "type": "BookPage" + "type": "ItemBookPage" } ] } @@ -653,7 +653,7 @@ "array", { "countType": "varint", - "type": "BookPage" + "type": "ItemBookPage" } ] }, @@ -954,7 +954,7 @@ } ] ], - "firework_explosion": "FireworkExplosion", + "firework_explosion": "ItemFireworkExplosion", "fireworks": [ "container", [ @@ -968,7 +968,7 @@ "array", { "countType": "varint", - "type": "FireworkExplosion" + "type": "ItemFireworkExplosion" } ] } @@ -1171,73 +1171,23 @@ } ] ], - "Slot": [ + "ItemSoundEvent": [ "container", [ { - "name": "itemCount", - "type": "i8" + "name": "soundName", + "type": "string" }, { - "anon": true, + "name": "fixedRange", "type": [ - "switch", - { - "compareTo": "itemCount", - "fields": { - "0": "void" - }, - "default": [ - "container", - [ - { - "name": "item", - "type": "varint" - }, - { - "name": "addedComponentCount", - "type": "varint" - }, - { - "name": "removedComponentCount", - "type": "varint" - }, - { - "name": "components", - "type": [ - "array", - { - "count": "addedComponentCount", - "type": "SlotComponent" - } - ] - }, - { - "name": "removeComponents", - "type": [ - "array", - { - "count": "removedComponentCount", - "type": [ - "container", - [ - { - "name": "type", - "type": "SlotComponentType" - } - ] - ] - } - ] - } - ] - ] - } + "option", + "f32" ] } ] ], - "FireworkExplosion": [ + "ItemFireworkExplosion": [ "container", [ { @@ -1286,23 +1236,7 @@ } ] ], - "BookPage": [ - "container", - [ - { - "name": "content", - "type": "string" - }, - { - "name": "filteredContent", - "type": [ - "option", - "string" - ] - } - ] - ], - "EffectDetail": [ + "ItemEffectDetail": [ "container", [ { @@ -1329,12 +1263,12 @@ "name": "hiddenEffect", "type": [ "option", - "EffectDetail" + "ItemEffectDetail" ] } ] ], - "PotionEffect": [ + "ItemPotionEffect": [ "container", [ { @@ -1343,11 +1277,11 @@ }, { "name": "details", - "type": "EffectDetail" + "type": "ItemEffectDetail" } ] ], - "BlockProperty": [ + "ItemBlockProperty": [ "container", [ { @@ -1381,7 +1315,7 @@ } ] ], - "BlockPredicate": [ + "ItemBlockPredicate": [ "container", [ { @@ -1411,7 +1345,7 @@ "array", { "countType": "varint", - "type": "BlockProperty" + "type": "ItemBlockProperty" } ] ] @@ -1422,6 +1356,88 @@ } ] ], + "ItemBookPage": [ + "container", + [ + { + "name": "content", + "type": "string" + }, + { + "name": "filteredContent", + "type": [ + "option", + "string" + ] + } + ] + ], + "Slot": [ + "container", + [ + { + "name": "itemCount", + "type": "varint" + }, + { + "anon": true, + "type": [ + "switch", + { + "compareTo": "itemCount", + "fields": { + "0": "void" + }, + "default": [ + "container", + [ + { + "name": "item", + "type": "varint" + }, + { + "name": "addedComponentCount", + "type": "varint" + }, + { + "name": "removedComponentCount", + "type": "varint" + }, + { + "name": "components", + "type": [ + "array", + { + "count": "addedComponentCount", + "type": "SlotComponent" + } + ] + }, + { + "name": "removeComponents", + "type": [ + "array", + { + "count": "removedComponentCount", + "type": [ + "container", + [ + { + "name": "type", + "type": "SlotComponentType" + } + ] + ] + } + ] + } + ] + ] + } + ] + } + ] + ], "Particle": [ "container", [ diff --git a/data/pc/1.21.3/protocol.json b/data/pc/1.21.3/protocol.json index 85336fca0..0cce80490 100644 --- a/data/pc/1.21.3/protocol.json +++ b/data/pc/1.21.3/protocol.json @@ -125,256 +125,6 @@ } ], "ContainerID": "varint", - "SoundEvent": [ - "container", - [ - { - "name": "soundName", - "type": "string" - }, - { - "name": "fixedRange", - "type": [ - "option", - "f32" - ] - } - ] - ], - "RecipeDisplay": [ - "container", - [ - { - "name": "type", - "type": [ - "mapper", - { - "type": "varint", - "mappings": { - "0": "crafting_shapeless", - "1": "crafting_shaped", - "2": "furnace", - "3": "stonecutter", - "4": "smithing" - } - } - ] - }, - { - "name": "data", - "type": [ - "switch", - { - "compareTo": "type", - "fields": { - "crafting_shapeless": [ - "container", - [ - { - "name": "ingredients", - "type": [ - "array", - { - "countType": "varint", - "type": "SlotDisplay" - } - ] - }, - { - "name": "result", - "type": "SlotDisplay" - }, - { - "name": "craftingStation", - "type": "SlotDisplay" - } - ] - ], - "crafting_shaped": [ - "container", - [ - { - "name": "width", - "type": "varint" - }, - { - "name": "height", - "type": "varint" - }, - { - "name": "ingredients", - "type": [ - "array", - { - "countType": "varint", - "type": "SlotDisplay" - } - ] - }, - { - "name": "result", - "type": "SlotDisplay" - }, - { - "name": "craftingStation", - "type": "SlotDisplay" - } - ] - ], - "furnace": [ - "container", - [ - { - "name": "ingredient", - "type": "SlotDisplay" - }, - { - "name": "fuel", - "type": "SlotDisplay" - }, - { - "name": "result", - "type": "SlotDisplay" - }, - { - "name": "craftingStation", - "type": "SlotDisplay" - }, - { - "name": "duration", - "type": "varint" - }, - { - "name": "experience", - "type": "f32" - } - ] - ], - "stonecutter": [ - "container", - [ - { - "name": "ingredient", - "type": "SlotDisplay" - }, - { - "name": "result", - "type": "SlotDisplay" - }, - { - "name": "craftingStation", - "type": "SlotDisplay" - } - ] - ], - "smithing": [ - "container", - [ - { - "name": "template", - "type": "SlotDisplay" - }, - { - "name": "base", - "type": "SlotDisplay" - }, - { - "name": "addition", - "type": "SlotDisplay" - }, - { - "name": "result", - "type": "SlotDisplay" - }, - { - "name": "craftingStation", - "type": "SlotDisplay" - } - ] - ] - } - } - ] - } - ] - ], - "SlotDisplay": [ - "container", - [ - { - "name": "type", - "type": [ - "mapper", - { - "type": "varint", - "mappings": { - "0": "empty", - "1": "any_fuel", - "2": "item", - "3": "item_stack", - "4": "tag", - "5": "smithing_trim", - "6": "with_remainder", - "7": "composite" - } - } - ] - }, - { - "name": "data", - "type": [ - "switch", - { - "compareTo": "type", - "fields": { - "empty": "void", - "any_fuel": "void", - "item": "varint", - "item_stack": "Slot", - "tag": "string", - "simthing_trim": [ - "container", - [ - { - "name": "base", - "type": "SlotDisplay" - }, - { - "name": "material", - "type": "SlotDisplay" - }, - { - "name": "pattern", - "type": "SlotDisplay" - } - ] - ], - "with_remainder": [ - "container", - [ - { - "name": "input", - "type": "SlotDisplay" - }, - { - "name": "remainder", - "type": "SlotDisplay" - } - ] - ], - "composite": [ - "array", - { - "countType": "varint", - "type": "SlotDisplay" - } - ] - } - } - ] - } - ] - ], "SlotComponentType": [ "mapper", { @@ -531,7 +281,7 @@ "array", { "countType": "varint", - "type": "BlockPredicate" + "type": "ItemBlockPredicate" } ] }, @@ -550,7 +300,7 @@ "array", { "countType": "varint", - "type": "BlockPredicate" + "type": "ItemBlockPredicate" } ] }, @@ -690,7 +440,7 @@ "baseName": "soundId", "otherwise": { "name": "data", - "type": "SoundEvent" + "type": "ItemSoundEvent" } } ] @@ -705,7 +455,7 @@ "array", { "countType": "varint", - "type": "ConsumeEffect" + "type": "ItemConsumeEffect" } ] } @@ -804,7 +554,7 @@ "baseName": "soundId", "otherwise": { "name": "data", - "type": "SoundEvent" + "type": "ItemSoundEvent" } } ] @@ -863,7 +613,7 @@ "array", { "countType": "varint", - "type": "ConsumeEffect" + "type": "ItemConsumeEffect" } ] } @@ -970,7 +720,7 @@ "array", { "countType": "varint", - "type": "PotionEffect" + "type": "ItemPotionEffect" } ] }, @@ -1016,7 +766,7 @@ "array", { "countType": "varint", - "type": "BookPage" + "type": "ItemBookPage" } ] } @@ -1050,7 +800,7 @@ "array", { "countType": "varint", - "type": "BookPage" + "type": "ItemBookPage" } ] }, @@ -1351,7 +1101,7 @@ } ] ], - "firework_explosion": "FireworkExplosion", + "firework_explosion": "ItemFireworkExplosion", "fireworks": [ "container", [ @@ -1365,7 +1115,7 @@ "array", { "countType": "varint", - "type": "FireworkExplosion" + "type": "ItemFireworkExplosion" } ] } @@ -1568,73 +1318,23 @@ } ] ], - "Slot": [ + "ItemSoundEvent": [ "container", [ { - "name": "itemCount", - "type": "varint" + "name": "soundName", + "type": "string" }, { - "anon": true, + "name": "fixedRange", "type": [ - "switch", - { - "compareTo": "itemCount", - "fields": { - "0": "void" - }, - "default": [ - "container", - [ - { - "name": "item", - "type": "varint" - }, - { - "name": "addedComponentCount", - "type": "varint" - }, - { - "name": "removedComponentCount", - "type": "varint" - }, - { - "name": "components", - "type": [ - "array", - { - "count": "addedComponentCount", - "type": "SlotComponent" - } - ] - }, - { - "name": "removeComponents", - "type": [ - "array", - { - "count": "removedComponentCount", - "type": [ - "container", - [ - { - "name": "type", - "type": "SlotComponentType" - } - ] - ] - } - ] - } - ] - ] - } + "option", + "f32" ] } ] ], - "FireworkExplosion": [ + "ItemFireworkExplosion": [ "container", [ { @@ -1683,23 +1383,7 @@ } ] ], - "BookPage": [ - "container", - [ - { - "name": "content", - "type": "string" - }, - { - "name": "filteredContent", - "type": [ - "option", - "string" - ] - } - ] - ], - "EffectDetail": [ + "ItemEffectDetail": [ "container", [ { @@ -1726,12 +1410,12 @@ "name": "hiddenEffect", "type": [ "option", - "EffectDetail" + "ItemEffectDetail" ] } ] ], - "PotionEffect": [ + "ItemPotionEffect": [ "container", [ { @@ -1740,11 +1424,102 @@ }, { "name": "details", - "type": "EffectDetail" + "type": "ItemEffectDetail" } ] ], - "ConsumeEffect": [ + "ItemBlockProperty": [ + "container", + [ + { + "name": "name", + "type": "string" + }, + { + "name": "isExactMatch", + "type": "bool" + }, + { + "name": "exactValue", + "type": [ + "option", + "string" + ] + }, + { + "name": "minValue", + "type": [ + "option", + "string" + ] + }, + { + "name": "maxValue", + "type": [ + "option", + "string" + ] + } + ] + ], + "ItemBlockPredicate": [ + "container", + [ + { + "name": "blockSet", + "type": [ + "option", + [ + "registryEntryHolderSet", + { + "base": { + "name": "name", + "type": "string" + }, + "otherwise": { + "name": "blockIds", + "type": "varint" + } + } + ] + ] + }, + { + "name": "properties", + "type": [ + "option", + [ + "array", + { + "countType": "varint", + "type": "ItemBlockProperty" + } + ] + ] + }, + { + "name": "nbt", + "type": "anonOptionalNbt" + } + ] + ], + "ItemBookPage": [ + "container", + [ + { + "name": "content", + "type": "string" + }, + { + "name": "filteredContent", + "type": [ + "option", + "string" + ] + } + ] + ], + "ItemConsumeEffect": [ "container", [ { @@ -1779,7 +1554,7 @@ "array", { "countType": "varint", - "type": "PotionEffect" + "type": "ItemPotionEffect" } ] }, @@ -1819,7 +1594,7 @@ "baseName": "soundId", "otherwise": { "name": "data", - "type": "SoundEvent" + "type": "ItemSoundEvent" } } ] @@ -1827,83 +1602,74 @@ ] ] } - } - ] - } - ] - ], - "BlockProperty": [ - "container", - [ - { - "name": "name", - "type": "string" - }, - { - "name": "isExactMatch", - "type": "bool" - }, - { - "name": "exactValue", - "type": [ - "option", - "string" - ] - }, - { - "name": "minValue", - "type": [ - "option", - "string" - ] - }, - { - "name": "maxValue", - "type": [ - "option", - "string" + } ] } ] ], - "BlockPredicate": [ + "Slot": [ "container", [ { - "name": "blockSet", - "type": [ - "option", - [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "blockIds", - "type": "varint" - } - } - ] - ] + "name": "itemCount", + "type": "varint" }, { - "name": "properties", + "anon": true, "type": [ - "option", - [ - "array", - { - "countType": "varint", - "type": "BlockProperty" - } - ] + "switch", + { + "compareTo": "itemCount", + "fields": { + "0": "void" + }, + "default": [ + "container", + [ + { + "name": "item", + "type": "varint" + }, + { + "name": "addedComponentCount", + "type": "varint" + }, + { + "name": "removedComponentCount", + "type": "varint" + }, + { + "name": "components", + "type": [ + "array", + { + "count": "addedComponentCount", + "type": "SlotComponent" + } + ] + }, + { + "name": "removeComponents", + "type": [ + "array", + { + "count": "removedComponentCount", + "type": [ + "container", + [ + { + "name": "type", + "type": "SlotComponentType" + } + ] + ] + } + ] + } + ] + ] + } ] - }, - { - "name": "nbt", - "type": "anonOptionalNbt" } ] ], @@ -4141,6 +3907,240 @@ "play": { "toClient": { "types": { + "SlotDisplay": [ + "container", + [ + { + "name": "type", + "type": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "empty", + "1": "any_fuel", + "2": "item", + "3": "item_stack", + "4": "tag", + "5": "smithing_trim", + "6": "with_remainder", + "7": "composite" + } + } + ] + }, + { + "name": "data", + "type": [ + "switch", + { + "compareTo": "type", + "fields": { + "empty": "void", + "any_fuel": "void", + "item": "varint", + "item_stack": "Slot", + "tag": "string", + "simthing_trim": [ + "container", + [ + { + "name": "base", + "type": "SlotDisplay" + }, + { + "name": "material", + "type": "SlotDisplay" + }, + { + "name": "pattern", + "type": "SlotDisplay" + } + ] + ], + "with_remainder": [ + "container", + [ + { + "name": "input", + "type": "SlotDisplay" + }, + { + "name": "remainder", + "type": "SlotDisplay" + } + ] + ], + "composite": [ + "array", + { + "countType": "varint", + "type": "SlotDisplay" + } + ] + } + } + ] + } + ] + ], + "RecipeDisplay": [ + "container", + [ + { + "name": "type", + "type": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "crafting_shapeless", + "1": "crafting_shaped", + "2": "furnace", + "3": "stonecutter", + "4": "smithing" + } + } + ] + }, + { + "name": "data", + "type": [ + "switch", + { + "compareTo": "type", + "fields": { + "crafting_shapeless": [ + "container", + [ + { + "name": "ingredients", + "type": [ + "array", + { + "countType": "varint", + "type": "SlotDisplay" + } + ] + }, + { + "name": "result", + "type": "SlotDisplay" + }, + { + "name": "craftingStation", + "type": "SlotDisplay" + } + ] + ], + "crafting_shaped": [ + "container", + [ + { + "name": "width", + "type": "varint" + }, + { + "name": "height", + "type": "varint" + }, + { + "name": "ingredients", + "type": [ + "array", + { + "countType": "varint", + "type": "SlotDisplay" + } + ] + }, + { + "name": "result", + "type": "SlotDisplay" + }, + { + "name": "craftingStation", + "type": "SlotDisplay" + } + ] + ], + "furnace": [ + "container", + [ + { + "name": "ingredient", + "type": "SlotDisplay" + }, + { + "name": "fuel", + "type": "SlotDisplay" + }, + { + "name": "result", + "type": "SlotDisplay" + }, + { + "name": "craftingStation", + "type": "SlotDisplay" + }, + { + "name": "duration", + "type": "varint" + }, + { + "name": "experience", + "type": "f32" + } + ] + ], + "stonecutter": [ + "container", + [ + { + "name": "ingredient", + "type": "SlotDisplay" + }, + { + "name": "result", + "type": "SlotDisplay" + }, + { + "name": "craftingStation", + "type": "SlotDisplay" + } + ] + ], + "smithing": [ + "container", + [ + { + "name": "template", + "type": "SlotDisplay" + }, + { + "name": "base", + "type": "SlotDisplay" + }, + { + "name": "addition", + "type": "SlotDisplay" + }, + { + "name": "result", + "type": "SlotDisplay" + }, + { + "name": "craftingStation", + "type": "SlotDisplay" + } + ] + ] + } + } + ] + } + ] + ], "SpawnInfo": [ "container", [ diff --git a/data/pc/latest/proto.yml b/data/pc/latest/proto.yml index 69c5fdafd..d0e98f82c 100644 --- a/data/pc/latest/proto.yml +++ b/data/pc/latest/proto.yml @@ -34,12 +34,7 @@ registryEntryHolder: native registryEntryHolderSet: native ByteArray: ["buffer", { "countType": "varint" }] - string: [ - "pstring", - { - "countType": "varint" - } - ] + string: ["pstring", { "countType": "varint" }] vec2f: x: f32 y: f32 @@ -61,136 +56,77 @@ "otherwise": { name: "ids", type: "varint" } }] ContainerID: varint - SoundEvent: - soundName: string - fixedRange?: f32 - RecipeDisplay: - type: varint => - - crafting_shapeless - - crafting_shaped - - furnace - - stonecutter - - smithing - data: type ? - if crafting_shapeless: - ingredients: SlotDisplay[]varint - result: SlotDisplay - craftingStation: SlotDisplay - if crafting_shaped: - width: varint - height: varint - ingredients: SlotDisplay[]varint - result: SlotDisplay - craftingStation: SlotDisplay - if furnace: - ingredient: SlotDisplay - fuel: SlotDisplay - result: SlotDisplay - craftingStation: SlotDisplay - duration: varint - experience: f32 - if stonecutter: - ingredient: SlotDisplay - result: SlotDisplay - craftingStation: SlotDisplay - if smithing: - template: SlotDisplay - base: SlotDisplay - addition: SlotDisplay - result: SlotDisplay - craftingStation: SlotDisplay - SlotDisplay: - type: varint => - - empty - - any_fuel - - item - - item_stack - - tag - - smithing_trim - - with_remainder - - composite - data: type ? - if empty or any_fuel: void - if item: varint - if item_stack: Slot - if tag: string - if simthing_trim: - base: SlotDisplay - material: SlotDisplay - pattern: SlotDisplay - if with_remainder: - input: SlotDisplay - remainder: SlotDisplay - if composite: SlotDisplay[]varint SlotComponentType: varint => - - custom_data - - max_stack_size - - max_damage - - damage - - unbreakable - - custom_name - - item_name - - item_model - - lore - - rarity - - enchantments - - can_place_on - - can_break - - attribute_modifiers - - custom_model_data - - hide_additional_tooltip - - hide_tooltip - - repair_cost - - creative_slot_lock - - enchantment_glint_override - - intangible_projectile - - food - - consumable - - use_remainder - - use_cooldown - - damage_resistant - - tool - - enchantable - - equippable - - repairable - - glider - - tooltip_style - - death_protection - - stored_enchantments - - dyed_color - - map_color - - map_id - - map_decorations - - map_post_processing - - charged_projectiles - - bundle_contents - - potion_contents - - suspicious_stew_effects - - writable_book_content - - written_book_content - - trim - - debug_stick_state - - entity_data - - bucket_entity_data - - block_entity_data - - instrument - - ominous_bottle_amplifier - - jukebox_playable - - recipes - - lodestone_tracker - - firework_explosion - - fireworks - - profile - - note_block_sound - - banner_patterns - - base_color - - pot_decorations - - container - - block_state - - bees - - lock - - container_loot + - custom_data + - max_stack_size + - max_damage + - damage + - unbreakable + - custom_name + - item_name + - item_model + - lore + - rarity + - enchantments + - can_place_on + - can_break + - attribute_modifiers + - custom_model_data + - hide_additional_tooltip + - hide_tooltip + - repair_cost + - creative_slot_lock + - enchantment_glint_override + - intangible_projectile + - food + - consumable + - use_remainder + - use_cooldown + - damage_resistant + - tool + - enchantable + - equippable + - repairable + - glider + - tooltip_style + - death_protection + - stored_enchantments + - dyed_color + - map_color + - map_id + - map_decorations + - map_post_processing + - charged_projectiles + - bundle_contents + - potion_contents + - suspicious_stew_effects + - writable_book_content + - written_book_content + - trim + - debug_stick_state + - entity_data + - bucket_entity_data + - block_entity_data + - instrument + - ominous_bottle_amplifier + - jukebox_playable + - recipes + - lodestone_tracker + - firework_explosion + - fireworks + - profile + - note_block_sound + - banner_patterns + - base_color + - pot_decorations + - container + - block_state + - bees + - lock + - container_loot + # Instead of sending NBT for items over the network, Minecraft since 1.20.5 sends a + # list of components that make up the item. This saves bandwidth by not encoding tag names. SlotComponent: type: SlotComponentType ## Ref: client/net/minecraft/core/component/DataComponents.java @@ -216,7 +152,7 @@ level: varint showTooltip: bool if can_place_on or can_break: - predicates: BlockPredicate[]varint + predicates: ItemBlockPredicate[]varint showTooltip: bool if attribute_modifiers: attributes: []varint @@ -267,10 +203,10 @@ - brush sound: ["registryEntryHolder", { "baseName": "soundId", - "otherwise": { name: "data", type: "SoundEvent" } + "otherwise": { name: "data", type: "ItemSoundEvent" } }] makes_particles: bool - effects: ConsumeEffect[]varint + effects: ItemConsumeEffect[]varint if use_remainder: Slot if use_cooldown: seconds: f32 @@ -299,7 +235,7 @@ - body sound: ["registryEntryHolder", { "baseName": "soundId", - "otherwise": { name: "data", type: "SoundEvent" } + "otherwise": { name: "data", type: "ItemSoundEvent" } }] model?: string cameraOverlay?: string @@ -311,7 +247,7 @@ items: IDSet if tooltip_style: string if death_protection: - effects: ConsumeEffect[]varint + effects: ItemConsumeEffect[]varint if stored_enchantments: enchantments: []varint # The ID of the enchantment in the enchantment registry. @@ -335,7 +271,7 @@ potionId?: varint # The RGB components of the color, encoded as an integer. customColor?: varint - customEffects: PotionEffect[]varint + customEffects: ItemPotionEffect[]varint customName: string if suspicious_stew_effects: effects: []varint @@ -345,7 +281,7 @@ duration: varint if writable_book_content: # Max 100 pages - pages: BookPage[]varint + pages: ItemBookPage[]varint if written_book_content: # The raw title of the book, up to 32 characters. rawTitle: string @@ -353,7 +289,7 @@ author: string generation: varint # Max 100 pages - pages: BookPage[]varint + pages: ItemBookPage[]varint # Whether entity selectors have already been resolved. resolved: bool # Name Type Description @@ -458,10 +394,10 @@ position: position # Whether the component is removed when the associated lodestone is broken. tracked: bool - if firework_explosion: FireworkExplosion + if firework_explosion: ItemFireworkExplosion if fireworks: flightDuration: varint - explosions: FireworkExplosion[]varint + explosions: ItemFireworkExplosion[]varint if profile: # If the profile has a name, max 16 characters. name?: string @@ -517,20 +453,12 @@ if lock: anonymousNbt if container_loot: anonymousNbt - Slot: - itemCount: varint - _: itemCount ? - if 0: void - default: - item: varint - # https://wiki.vg/Slot_Data#Structured_components - addedComponentCount: varint - removedComponentCount: varint - components: SlotComponent[]$addedComponentCount - removeComponents: []$removedComponentCount - type: SlotComponentType + # TODO: add to ClientboundExplodePacket and ClientboundSoundEntityPacket and ClientboundSoundPacket (and maybe other) packet which also use HolderSet + ItemSoundEvent: + soundName: string + fixedRange?: f32 - FireworkExplosion: + ItemFireworkExplosion: shape: varint => - small_ball - large_ball @@ -546,24 +474,44 @@ # Whether the firework has a twinkle effect. hasTwinkle: bool - BookPage: - # The raw text of the page. TextComponent, max 1024 characters. - content: string - filteredContent?: string - - EffectDetail: + ItemEffectDetail: amplifier: varint duration: varint ambient: bool showParticles: bool showIcon: bool - hiddenEffect?: EffectDetail + hiddenEffect?: ItemEffectDetail - PotionEffect: + ItemPotionEffect: id: varint - details: EffectDetail + details: ItemEffectDetail + + ItemBlockProperty: + # Name of the block state property. + name: string + # Whether this is an exact value match, as opposed to ranged. + isExactMatch: bool + # Value of the block state property. Only present in exact match mode. + exactValue?: string + # Minimum value of the block state property range. Only present in ranged match mode. + minValue?: string + # Maximum value of the block state property range. Only present in ranged match mode. + maxValue?: string - ConsumeEffect: + ItemBlockPredicate: + blockSet?: ["registryEntryHolderSet", { + "base": { name: "name", type: "string" }, + "otherwise": { name: "blockIds", type: "varint" } + }] + properties?: ItemBlockProperty[]varint + nbt: anonOptionalNbt + + ItemBookPage: + # The raw text of the page. TextComponent, max 1024 characters. + content: string + filteredContent?: string + + ItemConsumeEffect: type: varint => - apply_effects - remove_effects @@ -572,7 +520,7 @@ - play_sound _: type ? if apply_effects: - effects: PotionEffect[]varint + effects: ItemPotionEffect[]varint probability: f32 if remove_effects: effects: IDSet @@ -582,143 +530,136 @@ if play_sound: sound: ["registryEntryHolder", { "baseName": "soundId", - "otherwise": { name: "data", type: "SoundEvent" } + "otherwise": { name: "data", type: "ItemSoundEvent" } }] - BlockProperty: - # Name of the block state property. - name: string - # Whether this is an exact value match, as opposed to ranged. - isExactMatch: bool - # Value of the block state property. Only present in exact match mode. - exactValue?: string - # Minimum value of the block state property range. Only present in ranged match mode. - minValue?: string - # Maximum value of the block state property range. Only present in ranged match mode. - maxValue?: string - - BlockPredicate: - blockSet?: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "blockIds", type: "varint" } - }] - properties?: BlockProperty[]varint - nbt: anonOptionalNbt + Slot: + itemCount: varint + _: itemCount ? + if 0: void + default: + item: varint + # https://wiki.vg/Slot_Data#Structured_components + addedComponentCount: varint + removedComponentCount: varint + components: SlotComponent[]$addedComponentCount + removeComponents: []$removedComponentCount + type: SlotComponentType Particle: # See client/net/minecraft/core/particles/ParticleTypes.java type: varint => - - angry_villager - - block - - block_marker - - bubble - - cloud - - crit - - damage_indicator - - dragon_breath - - dripping_lava - - falling_lava - - landing_lava - - dripping_water - - falling_water - - dust - - dust_color_transition - - effect - - elder_guardian - - enchanted_hit - - enchant - - end_rod - - entity_effect - - explosion_emitter - - explosion - - gust - - small_gust - - gust_emitter_large - - gust_emitter_small - - sonic_boom - - falling_dust - - firework - - fishing - - flame - - infested - - cherry_leaves - - sculk_soul - - sculk_charge - - sculk_charge_pop - - soul_fire_flame - - soul - - flash - - happy_villager - - composter - - heart - - instant_effect - - item - - vibration - - trail - - item_slime - - item_cobweb - - item_snowball - - large_smoke - - lava - - mycelium - - note - - poof - - portal - - rain - - smoke - - white_smoke - - sneeze - - spit - - squid_ink - - sweep_attack - - totem_of_undying - - underwater - - splash - - witch - - bubble_pop - - current_down - - bubble_column_up - - nautilus - - dolphin - - campfire_cosy_smoke - - campfire_signal_smoke - - dripping_honey - - falling_honey - - landing_honey - - falling_nectar - - falling_spore_blossom - - ash - - crimson_spore - - warped_spore - - spore_blossom_air - - dripping_obsidian_tear - - falling_obsidian_tear - - landing_obsidian_tear - - reverse_portal - - white_ash - - small_flame - - snowflake - - dripping_dripstone_lava - - falling_dripstone_lava - - dripping_dripstone_water - - falling_dripstone_water - - glow_squid_ink - - glow - - wax_on - - wax_off - - electric_spark - - scrape - - shriek - - egg_crack - - dust_plume - - trial_spawner_detected_player - - trial_spawner_detected_player_ominous - - vault_connection - - dust_pillar - - ominous_spawning - - raid_omen - - trial_omen - - block_crumble + - angry_villager + - block + - block_marker + - bubble + - cloud + - crit + - damage_indicator + - dragon_breath + - dripping_lava + - falling_lava + - landing_lava + - dripping_water + - falling_water + - dust + - dust_color_transition + - effect + - elder_guardian + - enchanted_hit + - enchant + - end_rod + - entity_effect + - explosion_emitter + - explosion + - gust + - small_gust + - gust_emitter_large + - gust_emitter_small + - sonic_boom + - falling_dust + - firework + - fishing + - flame + - infested + - cherry_leaves + - sculk_soul + - sculk_charge + - sculk_charge_pop + - soul_fire_flame + - soul + - flash + - happy_villager + - composter + - heart + - instant_effect + - item + - vibration + - trail + - item_slime + - item_cobweb + - item_snowball + - large_smoke + - lava + - mycelium + - note + - poof + - portal + - rain + - smoke + - white_smoke + - sneeze + - spit + - squid_ink + - sweep_attack + - totem_of_undying + - underwater + - splash + - witch + - bubble_pop + - current_down + - bubble_column_up + - nautilus + - dolphin + - campfire_cosy_smoke + - campfire_signal_smoke + - dripping_honey + - falling_honey + - landing_honey + - falling_nectar + - falling_spore_blossom + - ash + - crimson_spore + - warped_spore + - spore_blossom_air + - dripping_obsidian_tear + - falling_obsidian_tear + - landing_obsidian_tear + - reverse_portal + - white_ash + - small_flame + - snowflake + - dripping_dripstone_lava + - falling_dripstone_lava + - dripping_dripstone_water + - falling_dripstone_water + - glow_squid_ink + - glow + - wax_on + - wax_off + - electric_spark + - scrape + - shriek + - egg_crack + - dust_plume + - trial_spawner_detected_player + - trial_spawner_detected_player_ominous + - vault_connection + - dust_pillar + - ominous_spawning + - raid_omen + - trial_omen + - block_crumble ## ## Tips for reviewing particle data (as of 1.20.5) ## Inside the registry code, each particle can have an associated "options" type and ## each options type can add additional data to be encoded. @@ -1571,7 +1512,64 @@ if custom_report_details: packet_common_custom_report_details if server_links: packet_common_server_links ^play.toClient.types: - # World state information for spawn and respawn packets + SlotDisplay: + type: varint => + - empty + - any_fuel + - item + - item_stack + - tag + - smithing_trim + - with_remainder + - composite + data: type ? + if empty or any_fuel: void + if item: varint + if item_stack: Slot + if tag: string + if simthing_trim: + base: SlotDisplay + material: SlotDisplay + pattern: SlotDisplay + if with_remainder: + input: SlotDisplay + remainder: SlotDisplay + if composite: SlotDisplay[]varint + RecipeDisplay: + type: varint => + - crafting_shapeless + - crafting_shaped + - furnace + - stonecutter + - smithing + data: type ? + if crafting_shapeless: + ingredients: SlotDisplay[]varint + result: SlotDisplay + craftingStation: SlotDisplay + if crafting_shaped: + width: varint + height: varint + ingredients: SlotDisplay[]varint + result: SlotDisplay + craftingStation: SlotDisplay + if furnace: + ingredient: SlotDisplay + fuel: SlotDisplay + result: SlotDisplay + craftingStation: SlotDisplay + duration: varint + experience: f32 + if stonecutter: + ingredient: SlotDisplay + result: SlotDisplay + craftingStation: SlotDisplay + if smithing: + template: SlotDisplay + base: SlotDisplay + addition: SlotDisplay + result: SlotDisplay + craftingStation: SlotDisplay # World state information for spawn and respawn packets SpawnInfo: dimension: varint @@ -2190,6 +2188,7 @@ packet_reset_score: entity_name: string objective_name?: string + ## (remove_resource_pack is common) # MC: ClientboundRespawnPacket packet_respawn: worldState: SpawnInfo