mirror of
https://github.com/barkeser2002/node-minecraft-protocol.git
synced 2026-09-25 06:30:09 +03:00
136 lines
3.3 KiB
JSON
136 lines
3.3 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
"title": "protocol",
|
|
"definitions": {
|
|
"directions": {
|
|
"type": "object",
|
|
"properties": {
|
|
"toClient": {"$ref": "#/definitions/packets"},
|
|
"toServer": {"$ref": "#/definitions/packets"}
|
|
},
|
|
"required": [
|
|
"toClient",
|
|
"toServer"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"packets": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[a-z_]+$": {"$ref": "#/definitions/packet"}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"packet": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {"$ref": "#/definitions/id"},
|
|
"fields": {"$ref": "#/definitions/fields"}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"fields"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^0x[0-9a-f]{2}$"
|
|
},
|
|
"fields": {
|
|
"type": "array",
|
|
"items": {"$ref": "#/definitions/field"},
|
|
"additionalItems": false
|
|
},
|
|
"field": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {"$ref": "#/definitions/fieldName"},
|
|
"type": {"$ref": "#/definitions/fieldType"},
|
|
"typeArgs": {"$ref": "#/definitions/fieldTypeArgs"}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"type"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"fieldName": {
|
|
"type": "string",
|
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
},
|
|
"fieldType": {
|
|
"type": "string",
|
|
"pattern": "^[a-zA-Z]+$"
|
|
},
|
|
"fieldTypeArgs": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {"$ref": "#/definitions/fieldType"},
|
|
"countFor": {"$ref": "#/definitions/fieldTypeArgsCountFor"},
|
|
"count": {"$ref": "#/definitions/fieldTypeArgsCount"},
|
|
"fields": {"$ref": "#/definitions/fields"},
|
|
"typeArgs": {"$ref": "#/definitions/fieldTypeArgs"},
|
|
"field": {"$ref": "#/definitions/fieldName"},
|
|
"values": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": [
|
|
"integer",
|
|
"boolean",
|
|
"string"
|
|
]
|
|
},
|
|
"additionalItems": false,
|
|
"minItems": 1
|
|
},
|
|
"different": {
|
|
"type": "boolean"
|
|
},
|
|
"this": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"fieldTypeArgsCountFor": {
|
|
"type": "string",
|
|
"pattern": "^(this\\.)?[a-zA-Z0-9_]+$"
|
|
},
|
|
"fieldTypeArgsCount": {
|
|
"oneOf": [
|
|
{"$ref": "#/definitions/fieldTypeArgsCountFor"},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"field": {"$ref": "#/definitions/fieldName"},
|
|
"map": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[0-9]+$": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"default": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"field",
|
|
"map",
|
|
"default"
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[a-z]+$": {"$ref": "#/definitions/directions"}
|
|
},
|
|
"additionalProperties": false
|
|
}
|