bta-proxy/packets-schema.json

295 lines
5.9 KiB
JSON
Raw Permalink Normal View History

{
2023-09-12 21:54:16 +03:00
"type": "object",
"properties": {
"protocol_version": {
"type": "integer"
},
"game_version": {
"type": "string"
},
"packets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
2023-09-12 21:54:16 +03:00
},
"name": {
"type": "string"
2023-09-12 21:54:16 +03:00
},
"server": {
"type": "boolean"
},
"client": {
"type": "boolean"
},
"fields": {
"type": "array",
"items": {
2023-09-12 21:54:16 +03:00
"$ref": "#/definitions/field"
}
}
},
"required": [
"id",
"name"
]
}
}
},
"definitions": {
"type": {
"type": "object",
"oneOf": [
{
"properties": {
"type": {
"type": "string",
"enum": [
"bool",
"byte",
"ubyte",
"short",
"ushort",
"int",
"uint",
"long",
"ulong",
"float",
"double",
"itemstack",
"optional_itemstack",
"itemstack_nbt",
"optional_itemstack_nbt",
"compoundtag",
"synchedentitydata"
]
}
}
},
{
"properties": {
"type": {
"type": "string",
"const": "list"
},
"item": {
"$ref": "#/definitions/type"
},
"size": {
"type": "number"
},
"sizetype": {
"type": "string"
},
"maxsize": {
"type": "integer"
}
},
"required": [
"item"
],
"oneOf": [
{
"required": [
"size"
]
},
{
"required": [
"sizetype",
"maxsize"
]
}
]
},
{
"properties": {
"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": [
"string",
"utfstring"
]
},
"maxsize": {
"type": "number"
}
},
"required": [
"maxsize"
]
},
{
"properties": {
"type": {
"type": "string",
"const": "bytes"
},
"size": {
"type": "number"
},
"sizetype": {
"type": "string",
"enum": [
"ubyte",
"byte",
"ushort",
"short",
"uint",
"int"
]
},
"maxsize": {
"type": "number"
}
},
"oneOf": [
{
"required": [
"size"
]
},
{
"required": [
"sizetype",
"maxsize"
]
}
2023-09-12 21:54:16 +03:00
]
},
{
"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"
},
"name": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/type"
}
}
}
}
2023-09-12 21:54:16 +03:00
],
"properties": {
"if": {
"$ref": "#/definitions/condition"
},
"post": {
"type": "array"
},
2023-09-12 21:54:16 +03:00
"proptype": {
"type": "string"
}
},
"required": [
"type"
]
},
"field": {
"allOf": [
{
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
},
2023-09-12 21:54:16 +03:00
{
"$ref": "#/definitions/type"
}
2023-09-12 21:54:16 +03:00
]
},
2023-09-12 21:54:16 +03:00
"condition": {
"type": "array"
}
},
"required": [
"protocol_version",
"game_version",
"packets"
]
}