Skip to content

Commit ffa565f

Browse files
fix(bedrock/proto): mismatched field type in TransactionActions (#1157)
* fix(bedrock/proto): mismatched field type in TransactionActions * chore(bedrock/proto): regenerate protocol * fix(bedrock/proto): revert incorrect changes * chore(bedrock/proto): regenerate protocol * refactor * backport --------- Co-authored-by: extremeheat <extreme@protonmail.ch>
1 parent d08d2cf commit ffa565f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1804
-1364
lines changed

data/bedrock/1.16.220/protocol.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@
11551155
[
11561156
{
11571157
"name": "inventory_id",
1158-
"type": "WindowIDVarint"
1158+
"type": "WindowIDZigzag32"
11591159
}
11601160
]
11611161
],
@@ -2882,6 +2882,41 @@
28822882
}
28832883
}
28842884
],
2885+
"WindowIDZigzag32": [
2886+
"mapper",
2887+
{
2888+
"type": "zigzag32",
2889+
"mappings": {
2890+
"0": "inventory",
2891+
"1": "first",
2892+
"100": "last",
2893+
"119": "offhand",
2894+
"120": "armor",
2895+
"121": "creative",
2896+
"122": "hotbar",
2897+
"123": "fixed_inventory",
2898+
"124": "ui",
2899+
"-100": "drop_contents",
2900+
"-24": "beacon",
2901+
"-23": "trading_output",
2902+
"-22": "trading_use_inputs",
2903+
"-21": "trading_input_2",
2904+
"-20": "trading_input_1",
2905+
"-17": "enchant_output",
2906+
"-16": "enchant_material",
2907+
"-15": "enchant_input",
2908+
"-13": "anvil_output",
2909+
"-12": "anvil_result",
2910+
"-11": "anvil_material",
2911+
"-10": "container_input",
2912+
"-5": "crafting_use_ingredient",
2913+
"-4": "crafting_result",
2914+
"-3": "crafting_remove_ingredient",
2915+
"-2": "crafting_add_ingredient",
2916+
"-1": "none"
2917+
}
2918+
}
2919+
],
28852920
"WindowType": [
28862921
"mapper",
28872922
{

data/bedrock/1.16.220/types.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ TransactionActions: []varint
506506
99999: craft
507507
_: source_type?
508508
if container or craft:
509-
inventory_id: WindowIDVarint
509+
inventory_id: WindowIDZigzag32
510510
if world_interaction:
511511
flags: varint
512512
if craft or craft_slot:
@@ -1107,7 +1107,7 @@ StructureBlockSettings:
11071107
# List of Window IDs. When a new container is opened (container_open), a new sequential Window ID is created.
11081108
# Below window IDs are hard-coded and created when the game starts and the server does not
11091109
# send a `container_open` for them.
1110-
WindowID: i8 =>
1110+
WindowID_: =>
11111111
-100: drop_contents
11121112
-24: beacon
11131113
-23: trading_output
@@ -1136,34 +1136,9 @@ WindowID: i8 =>
11361136
123: fixed_inventory
11371137
124: ui
11381138

1139-
WindowIDVarint: varint =>
1140-
-100: drop_contents
1141-
-24: beacon
1142-
-23: trading_output
1143-
-22: trading_use_inputs
1144-
-21: trading_input_2
1145-
-20: trading_input_1
1146-
-17: enchant_output
1147-
-16: enchant_material
1148-
-15: enchant_input
1149-
-13: anvil_output
1150-
-12: anvil_result
1151-
-11: anvil_material
1152-
-10: container_input
1153-
-5: crafting_use_ingredient
1154-
-4: crafting_result
1155-
-3: crafting_remove_ingredient
1156-
-2: crafting_add_ingredient
1157-
-1: none
1158-
0: inventory
1159-
1: first
1160-
100: last
1161-
119: offhand
1162-
120: armor
1163-
121: creative
1164-
122: hotbar
1165-
123: fixed_inventory
1166-
124: ui
1139+
WindowID: i8 => WindowID_
1140+
WindowIDVarint: varint => WindowID_
1141+
WindowIDZigzag32: zigzag32 => WindowID_
11671142

11681143
WindowType: i8 =>
11691144
-9: none

data/bedrock/1.17.0/protocol.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@
11611161
[
11621162
{
11631163
"name": "inventory_id",
1164-
"type": "WindowIDVarint"
1164+
"type": "WindowIDZigzag32"
11651165
}
11661166
]
11671167
],
@@ -2928,6 +2928,41 @@
29282928
}
29292929
}
29302930
],
2931+
"WindowIDZigzag32": [
2932+
"mapper",
2933+
{
2934+
"type": "zigzag32",
2935+
"mappings": {
2936+
"0": "inventory",
2937+
"1": "first",
2938+
"100": "last",
2939+
"119": "offhand",
2940+
"120": "armor",
2941+
"121": "creative",
2942+
"122": "hotbar",
2943+
"123": "fixed_inventory",
2944+
"124": "ui",
2945+
"-100": "drop_contents",
2946+
"-24": "beacon",
2947+
"-23": "trading_output",
2948+
"-22": "trading_use_inputs",
2949+
"-21": "trading_input_2",
2950+
"-20": "trading_input_1",
2951+
"-17": "enchant_output",
2952+
"-16": "enchant_material",
2953+
"-15": "enchant_input",
2954+
"-13": "anvil_output",
2955+
"-12": "anvil_result",
2956+
"-11": "anvil_material",
2957+
"-10": "container_input",
2958+
"-5": "crafting_use_ingredient",
2959+
"-4": "crafting_result",
2960+
"-3": "crafting_remove_ingredient",
2961+
"-2": "crafting_add_ingredient",
2962+
"-1": "none"
2963+
}
2964+
}
2965+
],
29312966
"WindowType": [
29322967
"mapper",
29332968
{

data/bedrock/1.17.0/types.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ TransactionActions: []varint
509509
99999: craft
510510
_: source_type?
511511
if container or craft:
512-
inventory_id: WindowIDVarint
512+
inventory_id: WindowIDZigzag32
513513
if world_interaction:
514514
flags: varint
515515
if craft or craft_slot:
@@ -1124,7 +1124,7 @@ StructureBlockSettings:
11241124
# List of Window IDs. When a new container is opened (container_open), a new sequential Window ID is created.
11251125
# Below window IDs are hard-coded and created when the game starts and the server does not
11261126
# send a `container_open` for them.
1127-
WindowID: i8 =>
1127+
WindowID_: =>
11281128
-100: drop_contents
11291129
-24: beacon
11301130
-23: trading_output
@@ -1153,34 +1153,9 @@ WindowID: i8 =>
11531153
123: fixed_inventory
11541154
124: ui
11551155

1156-
WindowIDVarint: varint =>
1157-
-100: drop_contents
1158-
-24: beacon
1159-
-23: trading_output
1160-
-22: trading_use_inputs
1161-
-21: trading_input_2
1162-
-20: trading_input_1
1163-
-17: enchant_output
1164-
-16: enchant_material
1165-
-15: enchant_input
1166-
-13: anvil_output
1167-
-12: anvil_result
1168-
-11: anvil_material
1169-
-10: container_input
1170-
-5: crafting_use_ingredient
1171-
-4: crafting_result
1172-
-3: crafting_remove_ingredient
1173-
-2: crafting_add_ingredient
1174-
-1: none
1175-
0: inventory
1176-
1: first
1177-
100: last
1178-
119: offhand
1179-
120: armor
1180-
121: creative
1181-
122: hotbar
1182-
123: fixed_inventory
1183-
124: ui
1156+
WindowID: i8 => WindowID_
1157+
WindowIDVarint: varint => WindowID_
1158+
WindowIDZigzag32: zigzag32 => WindowID_
11841159

11851160
WindowType: i8 =>
11861161
-9: none

data/bedrock/1.17.10/protocol.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@
11611161
[
11621162
{
11631163
"name": "inventory_id",
1164-
"type": "WindowIDVarint"
1164+
"type": "WindowIDZigzag32"
11651165
}
11661166
]
11671167
],
@@ -2928,6 +2928,41 @@
29282928
}
29292929
}
29302930
],
2931+
"WindowIDZigzag32": [
2932+
"mapper",
2933+
{
2934+
"type": "zigzag32",
2935+
"mappings": {
2936+
"0": "inventory",
2937+
"1": "first",
2938+
"100": "last",
2939+
"119": "offhand",
2940+
"120": "armor",
2941+
"121": "creative",
2942+
"122": "hotbar",
2943+
"123": "fixed_inventory",
2944+
"124": "ui",
2945+
"-100": "drop_contents",
2946+
"-24": "beacon",
2947+
"-23": "trading_output",
2948+
"-22": "trading_use_inputs",
2949+
"-21": "trading_input_2",
2950+
"-20": "trading_input_1",
2951+
"-17": "enchant_output",
2952+
"-16": "enchant_material",
2953+
"-15": "enchant_input",
2954+
"-13": "anvil_output",
2955+
"-12": "anvil_result",
2956+
"-11": "anvil_material",
2957+
"-10": "container_input",
2958+
"-5": "crafting_use_ingredient",
2959+
"-4": "crafting_result",
2960+
"-3": "crafting_remove_ingredient",
2961+
"-2": "crafting_add_ingredient",
2962+
"-1": "none"
2963+
}
2964+
}
2965+
],
29312966
"WindowType": [
29322967
"mapper",
29332968
{

data/bedrock/1.17.10/types.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ TransactionActions: []varint
509509
99999: craft
510510
_: source_type?
511511
if container or craft:
512-
inventory_id: WindowIDVarint
512+
inventory_id: WindowIDZigzag32
513513
if world_interaction:
514514
flags: varint
515515
if craft or craft_slot:
@@ -1124,7 +1124,7 @@ StructureBlockSettings:
11241124
# List of Window IDs. When a new container is opened (container_open), a new sequential Window ID is created.
11251125
# Below window IDs are hard-coded and created when the game starts and the server does not
11261126
# send a `container_open` for them.
1127-
WindowID: i8 =>
1127+
WindowID_: =>
11281128
-100: drop_contents
11291129
-24: beacon
11301130
-23: trading_output
@@ -1153,34 +1153,9 @@ WindowID: i8 =>
11531153
123: fixed_inventory
11541154
124: ui
11551155

1156-
WindowIDVarint: varint =>
1157-
-100: drop_contents
1158-
-24: beacon
1159-
-23: trading_output
1160-
-22: trading_use_inputs
1161-
-21: trading_input_2
1162-
-20: trading_input_1
1163-
-17: enchant_output
1164-
-16: enchant_material
1165-
-15: enchant_input
1166-
-13: anvil_output
1167-
-12: anvil_result
1168-
-11: anvil_material
1169-
-10: container_input
1170-
-5: crafting_use_ingredient
1171-
-4: crafting_result
1172-
-3: crafting_remove_ingredient
1173-
-2: crafting_add_ingredient
1174-
-1: none
1175-
0: inventory
1176-
1: first
1177-
100: last
1178-
119: offhand
1179-
120: armor
1180-
121: creative
1181-
122: hotbar
1182-
123: fixed_inventory
1183-
124: ui
1156+
WindowID: i8 => WindowID_
1157+
WindowIDVarint: varint => WindowID_
1158+
WindowIDZigzag32: zigzag32 => WindowID_
11841159

11851160
WindowType: i8 =>
11861161
-9: none

data/bedrock/1.17.30/protocol.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@
11611161
[
11621162
{
11631163
"name": "inventory_id",
1164-
"type": "WindowIDVarint"
1164+
"type": "WindowIDZigzag32"
11651165
}
11661166
]
11671167
],
@@ -3022,6 +3022,41 @@
30223022
}
30233023
}
30243024
],
3025+
"WindowIDZigzag32": [
3026+
"mapper",
3027+
{
3028+
"type": "zigzag32",
3029+
"mappings": {
3030+
"0": "inventory",
3031+
"1": "first",
3032+
"100": "last",
3033+
"119": "offhand",
3034+
"120": "armor",
3035+
"121": "creative",
3036+
"122": "hotbar",
3037+
"123": "fixed_inventory",
3038+
"124": "ui",
3039+
"-100": "drop_contents",
3040+
"-24": "beacon",
3041+
"-23": "trading_output",
3042+
"-22": "trading_use_inputs",
3043+
"-21": "trading_input_2",
3044+
"-20": "trading_input_1",
3045+
"-17": "enchant_output",
3046+
"-16": "enchant_material",
3047+
"-15": "enchant_input",
3048+
"-13": "anvil_output",
3049+
"-12": "anvil_result",
3050+
"-11": "anvil_material",
3051+
"-10": "container_input",
3052+
"-5": "crafting_use_ingredient",
3053+
"-4": "crafting_result",
3054+
"-3": "crafting_remove_ingredient",
3055+
"-2": "crafting_add_ingredient",
3056+
"-1": "none"
3057+
}
3058+
}
3059+
],
30253060
"WindowType": [
30263061
"mapper",
30273062
{

0 commit comments

Comments
 (0)