bta-proxy/packets-schema.json

137 lines
4.5 KiB
JSON

{
"type": "object",
"properties": {
"protocol_version": {
"type": "integer"
},
"game_version": {
"type": "string"
},
"packets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"server": { "type": "boolean" },
"client": { "type": "boolean" },
"fields": {
"type": "array",
"items": {
"$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", "enum": [ "string", "utfstring" ] },
"maxsize": { "type": "number" }
}
},
{
"properties": {
"type": { "type": "string", "enum": [ "bytes" ] },
"size": { "type": "number" },
"sizetype": {
"type": "string",
"enum": [
"ubyte", "byte",
"ushort", "short",
"uint", "int"
]
},
"maxsize": { "type": "number" }
},
"oneOf": [
{ "required": [ "size" ] },
{ "required": [ "sizetype", "maxsize" ] }
]
},
{
"properties": {
"type": { "type": "string", "const": "struct" },
"name": { "type": "string" },
"fields": {
"type": "array",
"items": { "$ref": "#/definitions/type" }
}
}
}
],
"properties": {
"if": { "$ref": "#/definitions/condition" },
"post": { "type": "array" },
"proptype": { "type": "string" }
},
"required": [ "type" ]
},
"field": {
"allOf": [
{
"properties": {
"name": { "type": "string" }
},
"required": [ "name" ]
},
{
"$ref": "#/definitions/type"
}
]
},
"condition": {
"type": "array"
}
},
"required": [
"protocol_version",
"game_version",
"packets"
]
}