Added rest of packet definitions

This commit is contained in:
Casey 2023-09-12 21:35:08 +03:00
parent 8e76e96373
commit a9aff18c94
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
2 changed files with 253 additions and 127 deletions

View File

@ -69,13 +69,31 @@
},
{
"properties": {
"type": { "type": "string", "enum": [ "string", "utfstring" ] },
"maxsize": { "type": "number" }
}
"type": { "type": "string", "const": "column_major_list" },
"fields": {
"type": "array",
"items": { "$ref": "#/definitions/field" }
},
"size": { "type": "number" },
"sizetype": { "type": "string" },
"maxsize": { "type": "integer" }
},
"required": [ "fields" ],
"oneOf": [
{ "required": [ "size" ] },
{ "required": [ "sizetype", "maxsize" ] }
]
},
{
"properties": {
"type": { "type": "string", "enum": [ "bytes" ] },
"type": { "type": "string", "enum": [ "string", "utfstring" ] },
"maxsize": { "type": "number" }
},
"required": [ "maxsize" ]
},
{
"properties": {
"type": { "type": "string", "const": "bytes" },
"size": { "type": "number" },
"sizetype": {
"type": "string",
@ -92,6 +110,25 @@
{ "required": [ "sizetype", "maxsize" ] }
]
},
{
"properties": {
"type": { "type": "string", "const": "bytes_compressed" },
"sizetype": {
"type": "string",
"enum": [
"ubyte", "byte",
"ushort", "short",
"uint", "int"
]
},
"maxsize": { "type": "number" },
"method": {
"type": "string",
"enum": [ "zlib", "gzip" ]
}
},
"required": [ "method", "maxsize", "sizetype" ]
},
{
"properties": {
"type": { "type": "string", "const": "struct" },

View File

@ -17,8 +17,8 @@
"client": true,
"fields": [
{ "name": "version_or_entity_id", "type": "int" },
{ "name": "username", "type": "string", "sizetype": "short", "maxsize": 32 },
{ "name": "pubkey", "type": "string", "sizetype": "short", "maxsize": 400 },
{ "name": "username", "type": "string", "maxsize": 32 },
{ "name": "pubkey", "type": "string", "maxsize": 400 },
{ "name": "seed", "type": "long" },
{ "name": "dimension", "type": "byte" },
{ "name": "world_type", "type": "byte" },
@ -30,56 +30,80 @@
"name": "Packet2Handshake",
"server": true,
"client": true,
"fields": []
"fields": [
{ "name": "username", "type": "string", "maxsize": 64 }
]
},
{
"id": 3,
"name": "Packet3Chat",
"server": true,
"client": true,
"fields": []
"fields": [
{ "name": "message", "type": "string", "maxsize": 1024 },
{ "name": "encrypted", "type": "bool" }
]
},
{
"id": 4,
"name": "Packet4UpdateTime",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "time", "type": "long" }
]
},
{
"id": 5,
"name": "Packet5PlayerInventory",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "slot", "type": "short" },
{ "name": "item", "type": "optional_itemstack_nbt" }
]
},
{
"id": 6,
"name": "Packet6SpawnPosition",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "y", "type": "int" },
{ "name": "z", "type": "int" }
]
},
{
"id": 7,
"name": "Packet7UseEntity",
"server": false,
"client": true,
"fields": []
"fields": [
{ "name": "player_entity_id", "type": "int" },
{ "name": "target_entity_id", "type": "int" },
{ "name": "is_left_click", "type": "bool" }
]
},
{
"id": 8,
"name": "Packet8UpdateHealth",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "health", "type": "short" }
]
},
{
"id": 9,
"name": "Packet9Respawn",
"server": true,
"client": true,
"fields": []
"fields": [
{ "name": "dimension", "type": "byte" },
{ "name": "world_type", "type": "byte" }
]
},
{
"id": 10,
@ -232,14 +256,14 @@
"client": false,
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "name", "type": "string", "sizetype": "short", "maxsize": 32 },
{ "name": "name", "type": "string", "maxsize": 32 },
{ "name": "x", "type": "int" },
{ "name": "y", "type": "int" },
{ "name": "z", "type": "int" },
{ "name": "rotation", "type": "ubyte" },
{ "name": "pitch", "type": "ubyte" },
{ "name": "item_id", "type": "short" },
{ "name": "nickname", "type": "string", "sizetype": "short", "maxsize": 64 },
{ "name": "nickname", "type": "string", "maxsize": 64 },
{ "name": "chat_color", "type": "byte" }
]
},
@ -303,7 +327,7 @@
{ "name": "yaw", "type": "byte" },
{ "name": "pitch", "type": "byte" },
{ "name": "data", "type": "synchedentitydata" },
{ "name": "nickname", "type": "string", "sizetype": "short", "maxsize": 64 },
{ "name": "nickname", "type": "string", "maxsize": 64 },
{ "name": "chat_color", "type": "byte" }
]
},
@ -314,7 +338,7 @@
"client": false,
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "title", "type": "string", "sizetype": "short", "maxsize": 128 },
{ "name": "title", "type": "string", "maxsize": 128 },
{ "name": "x", "type": "int" },
{ "name": "y", "type": "int" },
{ "name": "z", "type": "int" },
@ -361,154 +385,285 @@
"name": "Packet30Entity",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" }
]
},
{
"id": 31,
"name": "Packet31RelEntityMove",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "dx", "type": "byte" },
{ "name": "dy", "type": "byte" },
{ "name": "dz", "type": "byte" }
]
},
{
"id": 32,
"name": "Packet32EntityLook",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "yaw", "type": "byte" },
{ "name": "pitch", "type": "byte" }
]
},
{
"id": 33,
"name": "Packet33RelEntityMoveLook",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "dx", "type": "byte" },
{ "name": "dy", "type": "byte" },
{ "name": "dz", "type": "byte" },
{ "name": "yaw", "type": "byte" },
{ "name": "pitch", "type": "byte" }
]
},
{
"id": 34,
"name": "Packet34EntityTeleport",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "dx", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "double" },
{ "name": "dy", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "double" },
{ "name": "dz", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "double" },
{ "name": "yaw", "type": "byte" },
{ "name": "pitch", "type": "byte" }
]
},
{
"id": 35,
"name": "Packet35EntityNickname",
"server": true,
"client": true,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "nickname", "type": "string", "maxsize": 64 },
{ "name": "chat_color", "type": "ubyte" }
]
},
{
"id": 38,
"name": "Packet38EntityStatus",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "status", "type": "byte" },
{ "name": "attacked_at_yaw", "type": "float" }
]
},
{
"id": 39,
"name": "Packet39AttachEntity",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "vehicle_entity_id", "type": "int" }
]
},
{
"id": 40,
"name": "Packet40EntityMetadata",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "data", "type": "synchedentitydata" }
]
},
{
"id": 41,
"name": "Packet41EntityPlayerGamemode",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "gamemode", "type": "ubyte" }
]
},
{
"id": 50,
"name": "Packet50PreChunk",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "z", "type": "int" },
{ "name": "mode", "type": "bool" }
]
},
{
"id": 51,
"name": "Packet51MapChunk",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "y", "type": "short" },
{ "name": "z", "type": "int" },
{ "name": "xsize", "type": "ubyte", "post": [ "@", "add", 1 ], "proptype": "int" },
{ "name": "ysize", "type": "ubyte", "post": [ "@", "add", 1 ], "proptype": "int" },
{ "name": "zsize", "type": "ubyte", "post": [ "@", "add", 1 ], "proptype": "int" },
{ "name": "data", "type": "bytes_compressed", "sizetype": "int", "method": "zlib", "maxsize": 67108864 }
]
},
{
"id": 52,
"name": "Packet52MultiBlockChange",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "z", "type": "int" },
{
"name": "changes",
"type": "column_major_list",
"sizetype": "ushort",
"maxsize": 65535,
"fields": [
{ "name": "coord", "type": "short" },
{ "name": "type", "type": "short" },
{ "name": "meta", "type": "ubyte" }
]
}
]
},
{
"id": 53,
"name": "Packet53BlockChange",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "y", "type": "ubyte" },
{ "name": "z", "type": "int" },
{ "name": "type", "type": "short" },
{ "name": "meta", "type": "ubyte" }
]
},
{
"id": 54,
"name": "Packet54PlayNoteBlock",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "y", "type": "short" },
{ "name": "z", "type": "int" },
{ "name": "instrument", "type": "ubyte" },
{ "name": "pitch", "type": "ubyte" }
]
},
{
"id": 56,
"name": "Packet56RequestChunk",
"server": false,
"client": true,
"fields": []
"fields": [
{ "name": "x", "type": "int" },
{ "name": "z", "type": "int" }
]
},
{
"id": 60,
"name": "Packet60Explosion",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "x", "type": "double" },
{ "name": "y", "type": "double" },
{ "name": "z", "type": "double" },
{ "name": "size", "type": "float" },
{
"name": "changes",
"type": "list",
"sizetype": "int",
"maxsize": 16777216,
"item": {
"type": "struct",
"name": "Packet60Explosion_Change",
"fields": [
{ "name": "dx", "type": "byte" },
{ "name": "dy", "type": "byte" },
{ "name": "dz", "type": "byte" }
]
}
},
{ "name": "is_cannonball", "type": "bool" }
]
},
{
"id": 61,
"name": "Packet61PlaySoundEffect",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "sound_id", "type": "int" },
{ "name": "x", "type": "int" },
{ "name": "y", "type": "int" },
{ "name": "z", "type": "int" },
{ "name": "data", "type": "int" }
]
},
{
"id": 70,
"name": "Packet70Bed",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "status", "type": "byte" }
]
},
{
"id": 71,
"name": "Packet71Weather",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "entity_id", "type": "int" },
{ "name": "is_lightning", "type": "bool" },
{ "name": "x", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "float" },
{ "name": "y", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "float" },
{ "name": "z", "type": "int", "post": [ "@", "divide", 32.0 ], "proptype": "float" }
]
},
{
"id": 72,
"name": "Packet72UpdatePlayerProfile",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "username", "type": "string", "maxsize": 32 },
{ "name": "nickname", "type": "string", "maxsize": 64 },
{ "name": "score", "type": "int" },
{ "name": "chat_color", "type": "ubyte" },
{ "name": "is_online", "type": "bool" },
{ "name": "is_operator", "type": "bool" }
]
},
{
"id": 73,
"name": "Packet73WeatherStatus",
"server": true,
"client": false,
"fields": []
"fields": [
{ "name": "dimension", "type": "int" },
{ "name": "id", "type": "int" },
{ "name": "new_id", "type": "int" },
{ "name": "duration", "type": "long" },
{ "name": "intensity", "type": "float" },
{ "name": "power", "type": "float" }
]
},
{
"id": 100,
@ -516,23 +671,10 @@
"server": true,
"client": false,
"fields": [
{
"name": "window_id",
"type": "byte"
},
{
"name": "inventory_type",
"type": "byte"
},
{
"name": "title",
"type": "utfstring",
"sizetype": "short"
},
{
"name": "slots_count",
"type": "byte"
}
{ "name": "window_id", "type": "byte" },
{ "name": "inventory_type", "type": "byte" },
{ "name": "title", "type": "utfstring", "maxsize": 1024 },
{ "name": "slots_count", "type": "byte" }
]
},
{
@ -541,10 +683,7 @@
"server": true,
"client": true,
"fields": [
{
"name": "window_id",
"type": "byte"
}
{ "name": "window_id", "type": "byte" }
]
},
{
@ -553,28 +692,11 @@
"server": false,
"client": true,
"fields": [
{
"name": "window_id",
"type": "byte"
},
{
"name": "action",
"type": "byte"
},
{
"name": "args",
"type": "bytes",
"sizetype": "byte",
"maxsize": 255
},
{
"name": "action_id",
"type": "short"
},
{
"name": "itemstack",
"type": "optional_itemstack"
}
{ "name": "window_id", "type": "byte" },
{ "name": "action", "type": "byte" },
{ "name": "args", "type": "bytes", "sizetype": "byte", "maxsize": 255 },
{ "name": "action_id", "type": "short" },
{ "name": "itemstack", "type": "optional_itemstack" }
]
},
{
@ -583,18 +705,9 @@
"server": true,
"client": false,
"fields": [
{
"name": "window_id",
"type": "byte"
},
{
"name": "slot",
"type": "short"
},
{
"name": "itemstack",
"type": "optional_itemstack_nbt"
}
{ "name": "window_id", "type": "byte" },
{ "name": "slot", "type": "short" },
{ "name": "itemstack", "type": "optional_itemstack_nbt" }
]
},
{
@ -603,16 +716,11 @@
"server": true,
"client": false,
"fields": [
{
"name": "window_id",
"type": "byte"
},
{ "name": "window_id", "type": "byte" },
{
"name": "items",
"type": "list",
"item": {
"type": "optional_itemstack"
},
"item": { "type": "optional_itemstack" },
"sizetype": "short",
"maxsize": 32767
}
@ -648,11 +756,7 @@
"fields": [
{ "name": "window_id", "type": "byte" },
{ "name": "page", "type": "int" },
{
"name": "search_text",
"type": "utfstring",
"sizetype": "short"
}
{ "name": "search_text", "type": "utfstring", "maxsize": 1024 }
]
},
{
@ -676,9 +780,7 @@
{
"name": "lines",
"type": "list",
"item": {
"type": "string"
},
"item": { "type": "string", "maxsize": 64 },
"size": 4
},
{ "name": "picture", "type": "int" },
@ -710,12 +812,7 @@
{ "name": "x", "type": "int" },
{ "name": "y", "type": "short" },
{ "name": "z", "type": "int" },
{
"name": "spawn_type",
"type": "string",
"sizetype": "short",
"maxsize": 32
}
{ "name": "spawn_type", "type": "string", "maxsize": 32 }
]
},
{
@ -755,12 +852,7 @@
"server": true,
"client": false,
"fields": [
{
"name": "key",
"type": "string",
"sizetype": "short",
"maxsize": 384
}
{ "name": "key", "type": "string", "maxsize": 384 }
]
},
{
@ -790,10 +882,7 @@
"sizetype": "short",
"maxsize": 64
},
{
"name": "score",
"type": "int"
}
{ "name": "score", "type": "int" }
]
},
"sizetype": "int",
@ -869,7 +958,7 @@
"server": true,
"client": true,
"fields": [
{ "name": "reason", "type": "string", "sizetype": "short", "maxsize": 256 }
{ "name": "reason", "type": "string", "maxsize": 256 }
]
}
]