Skip to content

Commit

Permalink
pc1.21.3 protocol: fix slot itemId name and player_info bitfield (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat authored Jan 7, 2025
1 parent de5a5f3 commit 9de94fd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 70 deletions.
72 changes: 21 additions & 51 deletions data/pc/1.21.3/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@
"container",
[
{
"name": "item",
"name": "itemId",
"type": "varint"
},
{
Expand Down Expand Up @@ -6066,49 +6066,19 @@
{
"name": "action",
"type": [
"bitfield",
[
{
"name": "unused",
"size": 1,
"signed": false
},
{
"name": "update_priority",
"size": 1,
"signed": false
},
{
"name": "update_display_name",
"size": 1,
"signed": false
},
{
"name": "update_latency",
"size": 1,
"signed": false
},
{
"name": "update_listed",
"size": 1,
"signed": false
},
{
"name": "update_game_mode",
"size": 1,
"signed": false
},
{
"name": "initialize_chat",
"size": 1,
"signed": false
},
{
"name": "add_player",
"size": 1,
"signed": false
}
]
"bitflags",
{
"type": "u8",
"flags": [
"add_player",
"initialize_chat",
"update_game_mode",
"update_listed",
"update_latency",
"update_display_name",
"update_priority"
]
}
]
},
{
Expand All @@ -6131,7 +6101,7 @@
{
"compareTo": "../action/add_player",
"fields": {
"1": "game_profile"
"true": "game_profile"
},
"default": "void"
}
Expand All @@ -6144,7 +6114,7 @@
{
"compareTo": "../action/initialize_chat",
"fields": {
"1": "chat_session"
"true": "chat_session"
},
"default": "void"
}
Expand All @@ -6157,7 +6127,7 @@
{
"compareTo": "../action/update_game_mode",
"fields": {
"1": "varint"
"true": "varint"
},
"default": "void"
}
Expand All @@ -6170,7 +6140,7 @@
{
"compareTo": "../action/update_listed",
"fields": {
"1": "varint"
"true": "varint"
},
"default": "void"
}
Expand All @@ -6183,7 +6153,7 @@
{
"compareTo": "../action/update_latency",
"fields": {
"1": "varint"
"true": "varint"
},
"default": "void"
}
Expand All @@ -6196,7 +6166,7 @@
{
"compareTo": "../action/update_display_name",
"fields": {
"1": [
"true": [
"option",
"anonymousNbt"
]
Expand All @@ -6212,7 +6182,7 @@
{
"compareTo": "../action/update_priority",
"fields": {
"1": "varint"
"true": "varint"
},
"default": "void"
}
Expand Down
39 changes: 20 additions & 19 deletions data/pc/latest/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
_: itemCount ?
if 0: void
default:
item: varint
itemId: varint
# https://wiki.vg/Slot_Data#Structured_components
addedComponentCount: varint
removedComponentCount: varint
Expand Down Expand Up @@ -2099,39 +2099,40 @@
players: UUID[]varint
# MC: ClientboundPlayerInfoUpdatePacket
packet_player_info:
# action is a bitfield of the above
action: ["bitfield", [
{ "name": "unused", "size": 1, "signed": false },
{ "name": "update_priority", "size": 1, "signed": false },
{ "name": "update_display_name", "size": 1, "signed": false },
{ "name": "update_latency", "size": 1, "signed": false },
{ "name": "update_listed", "size": 1, "signed": false },
{ "name": "update_game_mode", "size": 1, "signed": false },
{ "name": "initialize_chat", "size": 1, "signed": false },
{ "name": "add_player", "size": 1, "signed": false }
]]
action: ["bitflags", {
"type": "u8",
"flags": [
"add_player",
"initialize_chat",
"update_game_mode",
"update_listed",
"update_latency",
"update_display_name",
"update_priority"
]
}]
data: []varint
uuid: UUID
player: ../action/add_player ?
if 1: game_profile
if true: game_profile
default: void
chatSession: ../action/initialize_chat ?
if 1: chat_session
if true: chat_session
default: void
gamemode: ../action/update_game_mode ?
if 1: varint
if true: varint
default: void
listed: ../action/update_listed ?
if 1: varint
if true: varint
default: void
latency: ../action/update_latency ?
if 1: varint
if true: varint
default: void
displayName: ../action/update_display_name ?
if 1: ["option", "anonymousNbt"]
if true: ["option", "anonymousNbt"]
default: void
listPriority: ../action/update_priority ?
if 1: varint
if true: varint
default: void

# MC: ClientboundPlayerLookAtPacket
Expand Down

0 comments on commit 9de94fd

Please sign in to comment.