Skip to content

Commit

Permalink
Fix values for enum type in available_commands packet (#742)
Browse files Browse the repository at this point in the history
* Fix values for enum type in available commands packet

* Name parameters field in command overloads
  • Loading branch information
CreeperG16 committed Jul 24, 2023
1 parent 099a80d commit b04d094
Show file tree
Hide file tree
Showing 46 changed files with 1,522 additions and 1,346 deletions.
6 changes: 3 additions & 3 deletions data/bedrock/1.16.201/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ packet_available_commands:
# The list of overload parameters for this command
overloads: []varint
# Each of the parameters gets an array of posible overloads
_: []varint
parameters: []varint
# The name of the parameter shown to the user (the `amount` in `/xp <amount: int>`)
parameter_name: string
value_type: lu16 =>
Expand All @@ -1352,9 +1352,9 @@ packet_available_commands:
# In MC, this + prior field are combined to one 32bit bitfield
enum_type: lu16 =>
0x10: valid
0x20: enum
0x30: enum
0x100: suffixed
0x400: soft_enum
0x410: soft_enum
# Is this parameter required?
optional: bool
# Additinal options for this command (thanks macroshaft...)
Expand Down
116 changes: 62 additions & 54 deletions data/bedrock/1.16.201/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -5376,66 +5376,74 @@
{
"countType": "varint",
"type": [
"array",
{
"countType": "varint",
"type": [
"container",
[
{
"name": "parameter_name",
"type": "string"
},
{
"name": "value_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"1": "int",
"2": "float",
"3": "value",
"4": "wildcard_int",
"5": "operator",
"6": "target",
"14": "file_path",
"29": "string",
"37": "position",
"41": "message",
"43": "raw_text",
"46": "json",
"53": "command"
}
}
]
},
"container",
[
{
"name": "parameters",
"type": [
"array",
{
"name": "enum_type",
"countType": "varint",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"16": "valid",
"32": "enum",
"256": "suffixed",
"1024": "soft_enum"
"container",
[
{
"name": "parameter_name",
"type": "string"
},
{
"name": "value_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"1": "int",
"2": "float",
"3": "value",
"4": "wildcard_int",
"5": "operator",
"6": "target",
"14": "file_path",
"29": "string",
"37": "position",
"41": "message",
"43": "raw_text",
"46": "json",
"53": "command"
}
}
]
},
{
"name": "enum_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"16": "valid",
"48": "enum",
"256": "suffixed",
"1040": "soft_enum"
}
}
]
},
{
"name": "optional",
"type": "bool"
},
{
"name": "options",
"type": "CommandFlags"
}
}
]
]
},
{
"name": "optional",
"type": "bool"
},
{
"name": "options",
"type": "CommandFlags"
}
]
]
}
}
]
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions data/bedrock/1.16.210/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ packet_available_commands:
# The list of overload parameters for this command
overloads: []varint
# Each of the parameters gets an array of posible overloads
_: []varint
parameters: []varint
# The name of the parameter shown to the user (the `amount` in `/xp <amount: int>`)
parameter_name: string
value_type: lu16 =>
Expand All @@ -1391,9 +1391,9 @@ packet_available_commands:
# In MC, this + prior field are combined to one 32bit bitfield
enum_type: lu16 =>
0x10: valid
0x20: enum
0x30: enum
0x100: suffixed
0x400: soft_enum
0x410: soft_enum
# Is this parameter required?
optional: bool
# Additinal options for this command (thanks macroshaft...)
Expand Down Expand Up @@ -2588,4 +2588,4 @@ packet_debug_renderer:
# Alpha is the alpha value from the RGBA colour rendered on the debug.
alpha: lf32
# Duration is how long the debug will last in the world for. It is measured in milliseconds.
duration: li64
duration: li64
116 changes: 62 additions & 54 deletions data/bedrock/1.16.210/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -5547,66 +5547,74 @@
{
"countType": "varint",
"type": [
"array",
{
"countType": "varint",
"type": [
"container",
[
{
"name": "parameter_name",
"type": "string"
},
{
"name": "value_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"1": "int",
"2": "float",
"3": "value",
"4": "wildcard_int",
"5": "operator",
"6": "target",
"16": "file_path",
"32": "string",
"40": "position",
"44": "message",
"46": "raw_text",
"50": "json",
"63": "command"
}
}
]
},
"container",
[
{
"name": "parameters",
"type": [
"array",
{
"name": "enum_type",
"countType": "varint",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"16": "valid",
"32": "enum",
"256": "suffixed",
"1024": "soft_enum"
"container",
[
{
"name": "parameter_name",
"type": "string"
},
{
"name": "value_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"1": "int",
"2": "float",
"3": "value",
"4": "wildcard_int",
"5": "operator",
"6": "target",
"16": "file_path",
"32": "string",
"40": "position",
"44": "message",
"46": "raw_text",
"50": "json",
"63": "command"
}
}
]
},
{
"name": "enum_type",
"type": [
"mapper",
{
"type": "lu16",
"mappings": {
"16": "valid",
"48": "enum",
"256": "suffixed",
"1040": "soft_enum"
}
}
]
},
{
"name": "optional",
"type": "bool"
},
{
"name": "options",
"type": "CommandFlags"
}
}
]
]
},
{
"name": "optional",
"type": "bool"
},
{
"name": "options",
"type": "CommandFlags"
}
]
]
}
}
]
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions data/bedrock/1.16.220/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ packet_available_commands:
# The list of overload parameters for this command
overloads: []varint
# Each of the parameters gets an array of posible overloads
_: []varint
parameters: []varint
# The name of the parameter shown to the user (the `amount` in `/xp <amount: int>`)
parameter_name: string
value_type: lu16 =>
Expand All @@ -1524,9 +1524,9 @@ packet_available_commands:
# In MC, this + prior field are combined to one 32bit bitfield
enum_type: lu16 =>
0x10: valid
0x20: enum
0x30: enum
0x100: suffixed
0x400: soft_enum
0x410: soft_enum
# Is this parameter required?
optional: bool
# Additinal options for this command (thanks macroshaft...)
Expand Down Expand Up @@ -3063,4 +3063,4 @@ packet_debug_renderer:
# Alpha is the alpha value from the RGBA colour rendered on the debug.
alpha: lf32
# Duration is how long the debug will last in the world for. It is measured in milliseconds.
duration: li64
duration: li64
Loading

0 comments on commit b04d094

Please sign in to comment.