Skip to content

Commit

Permalink
Add IDSet
Browse files Browse the repository at this point in the history
  • Loading branch information
GroobleDierne committed Nov 27, 2024
1 parent 439f794 commit c0de529
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 117 deletions.
111 changes: 23 additions & 88 deletions data/pc/1.21.3/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@
}
]
],
"IDSet": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "ids",
"type": "varint"
}
}
],
"ContainerID": "varint",
"SoundEvent": [
"container",
Expand Down Expand Up @@ -572,19 +585,7 @@
[
{
"name": "blocks",
"type": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "ids",
"type": "varint"
}
}
]
"type": "IDSet"
},
{
"name": "speed",
Expand Down Expand Up @@ -668,19 +669,7 @@
"name": "allowedEntities",
"type": [
"option",
[
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "id",
"type": "varint"
}
}
]
"IDSet"
]
},
{
Expand All @@ -702,19 +691,7 @@
[
{
"name": "items",
"type": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "id",
"type": "varint"
}
}
]
"type": "IDSet"
}
]
],
Expand Down Expand Up @@ -1662,19 +1639,7 @@
[
{
"name": "effects",
"type": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "id",
"type": "varint"
}
}
]
"type": "IDSet"
}
]
],
Expand Down Expand Up @@ -2324,19 +2289,7 @@
},
{
"name": "biome",
"type": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "ids",
"type": "varint"
}
}
]
"type": "IDSet"
}
]
],
Expand Down Expand Up @@ -6233,7 +6186,7 @@
"container",
[
{
"name": "contents",
"name": "recipe",
"type": [
"container",
[
Expand Down Expand Up @@ -6434,16 +6387,10 @@
"type": [
"option",
[
"registryEntryHolderSet",
"array",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "ids",
"type": "varint"
}
"countType": "varint",
"type": "IDSet"
}
]
]
Expand Down Expand Up @@ -7916,19 +7863,7 @@
[
{
"name": "input",
"type": [
"registryEntryHolderSet",
{
"base": {
"name": "name",
"type": "string"
},
"otherwise": {
"name": "ids",
"type": "varint"
}
}
]
"type": "IDSet"
},
{
"name": "slotDisplay",
Expand Down
41 changes: 12 additions & 29 deletions data/pc/latest/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2159,7 +2148,7 @@
packet_recipe_book_add:
entries: []varint
# RecipeDisplayEntry
contents:
recipe:
displayId: varint
display:
type: varint =>
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c0de529

Please sign in to comment.