From c0de52956c890a984505ad92acdf5509d00a72e4 Mon Sep 17 00:00:00 2001 From: GroobleDierne Date: Wed, 27 Nov 2024 18:00:16 +0100 Subject: [PATCH] Add IDSet --- data/pc/1.21.3/protocol.json | 111 ++++++++--------------------------- data/pc/latest/proto.yml | 41 ++++--------- 2 files changed, 35 insertions(+), 117 deletions(-) diff --git a/data/pc/1.21.3/protocol.json b/data/pc/1.21.3/protocol.json index f3d1fb0ec..082a2cab5 100644 --- a/data/pc/1.21.3/protocol.json +++ b/data/pc/1.21.3/protocol.json @@ -110,6 +110,19 @@ } ] ], + "IDSet": [ + "registryEntryHolderSet", + { + "base": { + "name": "name", + "type": "string" + }, + "otherwise": { + "name": "ids", + "type": "varint" + } + } + ], "ContainerID": "varint", "SoundEvent": [ "container", @@ -572,19 +585,7 @@ [ { "name": "blocks", - "type": [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "ids", - "type": "varint" - } - } - ] + "type": "IDSet" }, { "name": "speed", @@ -668,19 +669,7 @@ "name": "allowedEntities", "type": [ "option", - [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "id", - "type": "varint" - } - } - ] + "IDSet" ] }, { @@ -702,19 +691,7 @@ [ { "name": "items", - "type": [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "id", - "type": "varint" - } - } - ] + "type": "IDSet" } ] ], @@ -1662,19 +1639,7 @@ [ { "name": "effects", - "type": [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "id", - "type": "varint" - } - } - ] + "type": "IDSet" } ] ], @@ -2324,19 +2289,7 @@ }, { "name": "biome", - "type": [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "ids", - "type": "varint" - } - } - ] + "type": "IDSet" } ] ], @@ -6233,7 +6186,7 @@ "container", [ { - "name": "contents", + "name": "recipe", "type": [ "container", [ @@ -6434,16 +6387,10 @@ "type": [ "option", [ - "registryEntryHolderSet", + "array", { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "ids", - "type": "varint" - } + "countType": "varint", + "type": "IDSet" } ] ] @@ -7916,19 +7863,7 @@ [ { "name": "input", - "type": [ - "registryEntryHolderSet", - { - "base": { - "name": "name", - "type": "string" - }, - "otherwise": { - "name": "ids", - "type": "varint" - } - } - ] + "type": "IDSet" }, { "name": "slotDisplay", diff --git a/data/pc/latest/proto.yml b/data/pc/latest/proto.yml index 1810b72ac..c87737e26 100644 --- a/data/pc/latest/proto.yml +++ b/data/pc/latest/proto.yml @@ -55,6 +55,10 @@ x: f64 y: f64 z: f64 + IDSet: ["registryEntryHolderSet", { + "base": { name: "name", type: "string" }, + "otherwise": { name: "ids", type: "varint" } + }] ContainerID: varint SoundEvent: soundName: string @@ -238,10 +242,7 @@ if damage_resistant: string if tool: rules: []varint - blocks: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "ids", type: "varint" } - }] + 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. @@ -266,18 +267,12 @@ }] model?: string cameraOverlay?: string - allowedEntities?: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "id", type: "varint" } - }] + allowedEntities?: IDSet dispensable: bool swappable: bool damageable: bool if repairable: - items: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "id", type: "varint" } - }] + items: IDSet if tooltip_style: string if death_protection: effects: ConsumeEffect[]varint @@ -579,10 +574,7 @@ effects: PotionEffect[]varint probability: f32 if remove_effects: - effects: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "id", type: "varint" } - }] + effects: IDSet if clear_all_effects: void if teleport_randomly: diameter: f32 @@ -900,10 +892,7 @@ wildTexture: string tameTexture: string angryTexture: string - biome: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "ids", type: "varint" } - }] + biome: IDSet entityMetadata: ["entityMetadataLoop", { "endVal": 255, "type": "entityMetadataEntry" }] tags: []varint @@ -2159,7 +2148,7 @@ packet_recipe_book_add: entries: []varint # RecipeDisplayEntry - contents: + recipe: displayId: varint display: type: varint => @@ -2212,10 +2201,7 @@ - stonecutter - smithing - campfire - craftingRequirements?: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "ids", type: "varint" } - }] + craftingRequirements?: IDSet[]varint flags: ["bitflags", { "type": "u8", "flags": ["notification", "highlight"] @@ -2629,10 +2615,7 @@ name: string items: varint[]varint stoneCutterRecipes: []varint - input: ["registryEntryHolderSet", { - "base": { name: "name", type: "string" }, - "otherwise": { name: "ids", type: "varint" } - }] + input: IDSet slotDisplay: SlotDisplay # MC: ClientboundUpdateTagsPacket