diff --git a/schemas/ajblueprint.schema.json b/schemas/blueprint-project.schema.json similarity index 98% rename from schemas/ajblueprint.schema.json rename to schemas/blueprint-project.schema.json index 98a0298b..b5a8f754 100644 --- a/schemas/ajblueprint.schema.json +++ b/schemas/blueprint-project.schema.json @@ -1,5 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Animated Java Blueprint Schema (Depreciated)", + "description": "THIS IS OUTDATED! DO NOT USE THIS SCHEMA!", "properties": { "meta": { "type": "object", diff --git a/schemas/example-plugin-blueprint.json b/schemas/example-plugin-blueprint.json new file mode 100644 index 00000000..47c78bcd --- /dev/null +++ b/schemas/example-plugin-blueprint.json @@ -0,0 +1,240 @@ +{ + "$schema": "./plugin-rig.schema.json", + "format_version": 1, + "settings": { + "id": "animated_java:blueprint" + }, + "textures": { + "custom_texture": { + "type": "custom", + "base64_string": "iVBORw0KGgoAAAANSUhEUgAAAAUA", + "animation": { + "frametime": 3, + "interpolate": true, + "frames": [0, 2, { "index": 1, "time": 10 }, 3] + } + }, + "reference_texture": { + "type": "reference", + "resource_location": "minecraft:block/stone" + } + }, + "texture_palettes": { + "default_palette": { + "active_state": "default", + "states": { + "default": { "texture": "custom_texture" }, + "alternative": { "texture": "reference_texture" } + } + } + }, + "nodes": { + "bone_node": { + "type": "bone", + "default_transformation": { + "matrix": [1, 0, 0, 0, 0, 0.99619, -0.08716, 0, 0, 0.08716, 0.99619, 0, 0, 0, 0, 1], + "decomposed": { + "left_rotation": [-0.04362, 0, 0, 0.99905] + }, + "rotation": [5, 180, 0], + "head_rotation": [5, 180] + }, + "display_properties": { + "billboard": "vertical", + "custom_brightness": 10, + "custom_name": "'Bone Node'", + "glow_color_override": 12345678, + "is_custom_name_visible": true, + "is_glowing": true, + "shadow_radius": 5.0, + "shadow_strength": 0.5, + "is_enchanted": true + }, + "elements": [ + { + "from": [0.0, 0.0, 0.0], + "to": [1.0, 1.0, 1.0], + "rotation": { + "angle": 0.0, + "axis": "y", + "origin": [0.5, 0.5, 0.5] + }, + "faces": { + "north": { + "uv": [0, 0, 16, 16], + "texture_provider": { "type": "texture", "texture": "custom_texture" } + }, + "east": { + "uv": [0, 0, 16, 16], + "texture_provider": { + "type": "texture", + "texture": "reference_texture" + } + }, + "south": { + "uv": [0, 0, 16, 16], + "texture_provider": { "type": "texture", "texture": "custom_texture" }, + "rotation": 90 + }, + "west": { + "uv": [0, 0, 16, 16], + "texture_provider": { + "type": "texture", + "texture": "reference_texture" + } + }, + "up": { + "uv": [0, 0, 16, 16], + "texture_provider": { "type": "texture", "texture": "custom_texture" } + }, + "down": { + "uv": [0, 0, 16, 16], + "texture_provider": { + "type": "texture_palette", + "texture_palette": "default_palette" + } + } + }, + "display_rotation": [90.0, 20.0, 0.0] + } + ] + }, + "item_display_node": { + "type": "item_display", + "default_transformation": { + "matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1.625, 0, 1], + "decomposed": { + "translation": [0, 1.625, 0] + }, + "position": [0, 1.625, 0] + }, + "display_properties": { + "billboard": "vertical", + "is_glowing": true, + "shadow_radius": 3.0, + "shadow_strength": 0.8, + "item": "minecraft:diamond_sword[damage=3]", + "item_display": "gui" + } + }, + "block_display_node": { + "type": "block_display", + "default_transformation": { + "matrix": [ + 0.97789, 0.12755, 0.39544, 0, -0.09059, 1.11318, -0.13506, 0, -0.38268, 0.08052, + 0.92036, 0, -0.625, 0, 0, 1 + ], + "decomposed": { + "translation": [-0.625, 0, 0], + "left_rotation": [-0.05124, -0.19285, 0.05124, 0.97855], + "scale": [1.0625, 1.125, 1] + }, + "position": [-0.625, 0, 0], + "rotation": [4.61854, 202.57734, 6.91757], + "head_rotation": [4.61854, 202.57734], + "scale": [1.0625, 1.125, 1] + }, + "display_properties": { + "billboard": "horizontal", + "custom_brightness": 15, + "custom_name": "'Block Display Node'", + "is_custom_brightness_enabled": true, + "is_custom_name_visible": true, + "block_state": "minecraft:cake[bites=3]" + } + }, + "text_display_node": { + "type": "text_display", + "display_properties": { + "custom_brightness": 5, + "is_custom_brightness_enabled": true, + "is_glowing": true, + "alignment": "left", + "background_color": 16711680, + "is_default_background": true, + "is_see_through": true, + "is_shadowed": true, + "line_width": 500, + "text": "{\"text\":\"This is a text display node\",\"bold\":true}", + "text_opacity": 12 + } + } + }, + "animations": { + "test_animation": { + "loop_mode": { + "type": "loop", + "loop_delay": "0.5" + }, + "blend_weight": "1.2", + "start_delay": "0.0", + "length": 3.0, + "global_keyframes": { + "texture": { + "0.0": { "default_palette": "default" }, + "1.5": { "default_palette": "alternative" } + }, + "event": { + "1.5": { "events": ["event_1", "event_2"] }, + "3.0": { "events": ["event_1"] } + } + }, + "node_keyframes": { + "bone_node": { + "position": { + "0.0": { + "value": ["0.0", "0.0", "0.0"], + "interpolation": { + "type": "linear", + "easing": "linear" + } + }, + "3.0": { + "value": ["2.0", "2.0", "2.0"], + "interpolation": { + "type": "linear", + "easing": "ease_in_out_quad" + } + } + }, + "rotation": { + "0.0": { + "value": ["0.0", "0.0", "0.0"], + "interpolation": { + "type": "linear", + "easing": "linear" + } + }, + "3.0": { + "value": ["90.0", "90.0", "90.0"], + "interpolation": { + "type": "bezier", + "left_handle_time": [-0.1, -0.1, -0.1], + "left_handle_value": [0, 0, 0], + "right_handle_time": [0.1, 0.1, 0.1], + "right_handle_value": [0, 0, 0] + } + } + }, + "scale": { + "1.5": { + "value": ["1.0", "1.0", "1.0"], + "interpolation": { + "type": "linear", + "easing": "linear" + } + }, + "3.0": { + "value": ["0.5", "0.5", "0.5"], + "interpolation": { + "type": "linear", + "easing": "ease_out_elastic", + "easing_arguments": [1.2] + } + } + } + } + } + } + } +} diff --git a/schemas/plugin-blueprint.schema.json b/schemas/plugin-blueprint.schema.json new file mode 100644 index 00000000..decbfd6b --- /dev/null +++ b/schemas/plugin-blueprint.schema.json @@ -0,0 +1,862 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Animated Java Plugin Blueprint", + "description": "A schema of the JSON file an Blueprint Project creates when exported for a Plugin environment.", + "type": "object", + "required": ["format_version", "settings"], + "properties": { + "format_version": { + "type": "number" + }, + "settings": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "$ref": "#/$defs/resource_location", + "description": "The unique id for this blueprint." + } + } + }, + "textures": { + "type": "object", + "default": {}, + "patternProperties": { + "^[a-z0-9_]+$": { + "$ref": "#/$defs/texture" + } + } + }, + "texture_palettes": { + "type": "object", + "default": {}, + "patternProperties": { + "^[a-z0-9_]+$": { + "$ref": "#/$defs/texture_palette" + } + } + }, + "nodes": { + "type": "object", + "default": {}, + "patternProperties": { + "^[a-z0-9_]+$": { + "$ref": "#/$defs/node" + } + } + }, + "animations": { + "type": "object", + "default": {}, + "patternProperties": { + "^[a-z0-9_]+$": { + "$ref": "#/$defs/dynamic_animation" + } + } + } + }, + "$defs": { + "texture": { + "type": "object", + "oneOf": [ + { + "required": ["type", "base64_string"], + "properties": { + "type": { + "const": "custom" + }, + "base64_string": { + "type": "string", + "description": "The base64-encoded string representing the image data." + }, + "mime_type": { + "type": "string", + "description": "The MIME type of the image (e.g., 'image/png', 'image/jpeg'). This field might not be strictly necessary, as Minecraft currently only supports PNG images. However, it could be useful to include if future updates add support for other image types.", + "default": "image/png" + }, + "animation": { + "type": "object", + "default": {}, + "properties": { + "interpolate": { + "type": "boolean", + "default": false + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + }, + "frametime": { + "type": "number", + "default": 1 + }, + "frames": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "object", + "required": ["index", "time"], + "properties": { + "index": { "type": "number" }, + "time": { "type": "number" } + } + } + ] + } + } + } + } + } + }, + { + "required": ["type", "resource_location"], + "properties": { + "type": { + "const": "reference" + }, + "resource_location": { + "$ref": "#/$defs/resource_location", + "description": "The resource location of the internal Minecraft texture." + } + } + } + ] + }, + "texture_palette": { + "type": "object", + "required": ["active_state", "states"], + "properties": { + "active_state": { + "type": "string", + "description": "The name of the currently active state. This value must match one of the keys defined in the 'states' map.", + "pattern": "^[a-z0-9_]+$" + }, + "states": { + "type": "object", + "description": "A map that links state names to objects representing individual states.", + "minProperties": 1, + "patternProperties": { + "^[a-z0-9_]+$": { + "type": "object", + "required": ["texture"], + "properties": { + "texture": { + "type": "string", + "description": "The key of the texture used for this state, referencing an entry from the 'textures' section.", + "pattern": "^[a-z0-9_]+$" + } + } + } + } + } + } + }, + "node": { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "type": "string" + }, + "default_transformation": { + "$ref": "#/$defs/node_transformation" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { "const": "bone" } + } + }, + "then": { + "type": "object", + "required": ["elements"], + "properties": { + "display_properties": { + "$ref": "#/$defs/bone_display_properties" + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/$defs/bone_element" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { "const": "item_display" } + } + }, + "then": { + "type": "object", + "properties": { + "display_properties": { + "$ref": "#/$defs/item_display_properties" + } + } + } + }, + { + "if": { + "properties": { + "type": { "const": "block_display" } + } + }, + "then": { + "type": "object", + "properties": { + "display_properties": { + "$ref": "#/$defs/block_display_properties" + } + } + } + }, + { + "if": { + "properties": { + "type": { "const": "text_display" } + } + }, + "then": { + "type": "object", + "properties": { + "display_properties": { + "$ref": "#/$defs/text_display_properties" + } + } + } + }, + { + "if": { + "properties": { + "type": { "const": "structure" } + } + }, + "then": {} + }, + { + "if": { + "properties": { + "type": { "const": "camera" } + } + }, + "then": {} + }, + { + "if": { + "properties": { + "type": { "const": "locator" } + } + }, + "then": {} + } + ] + }, + "node_transformation": { + "type": "object", + "default": {}, + "properties": { + "matrix": { + "$ref": "#/$defs/matrix", + "default": [ + 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, + 1.0 + ] + }, + "decomposed": { + "type": "object", + "properties": { + "translation": { + "$ref": "#/$defs/vector3", + "default": [0.0, 0.0, 0.0] + }, + "left_rotation": { + "$ref": "#/$defs/vector4", + "default": [0.0, 0.0, 0.0, 1.0] + }, + "scale": { + "$ref": "#/$defs/vector3", + "default": [1.0, 1.0, 1.0] + } + } + }, + "position": { + "$ref": "#/$defs/vector3", + "default": [0.0, 0.0, 0.0] + }, + "rotation": { + "$ref": "#/$defs/vector3", + "default": [0.0, 180.0, 0.0] + }, + "head_rotation": { + "$ref": "#/$defs/vector2", + "default": [0.0, 180.0] + }, + "scale": { + "$ref": "#/$defs/vector3", + "default": [1.0, 1.0, 1.0] + } + } + }, + "bone_element": { + "type": "object", + "required": ["from", "to", "rotation", "faces"], + "properties": { + "from": { + "$ref": "#/$defs/vector3" + }, + "to": { + "$ref": "#/$defs/vector3" + }, + "rotation": { + "type": "object", + "required": ["angle", "axis", "origin"], + "properties": { + "angle": { + "type": "number" + }, + "axis": { + "type": "string", + "enum": ["x", "y", "z"] + }, + "origin": { + "$ref": "#/$defs/vector3" + } + } + }, + "shade": { + "type": "boolean", + "default": true + }, + "light_emission": { + "type": "number", + "default": 0 + }, + "faces": { + "type": "object", + "minProperties": 1, + "additionalProperties": false, + "properties": { + "north": { "$ref": "#/$defs/bone_element_face" }, + "east": { "$ref": "#/$defs/bone_element_face" }, + "south": { "$ref": "#/$defs/bone_element_face" }, + "west": { "$ref": "#/$defs/bone_element_face" }, + "up": { "$ref": "#/$defs/bone_element_face" }, + "down": { "$ref": "#/$defs/bone_element_face" } + } + }, + "display_rotation": { + "$ref": "#/$defs/vector3", + "default": [0.0, 180.0, 0.0] + } + } + }, + "bone_element_face": { + "type": "object", + "required": ["uv", "texture_provider"], + "additionalProperties": false, + "properties": { + "uv": { + "$ref": "#/$defs/vector4" + }, + "tintindex": { + "type": "number", + "description": "Determines whether to tint the texture using a hardcoded tint index. The default value, -1, indicates not to use the tint. Any other number is provided to BlockColors to get the tint value corresponding to that index. However, most blocks do not have a tint value defined (in which case white is used). Furthermore, no vanilla block currently uses multiple tint values, and thus the tint index value is ignored (as long as it is set to something other than -1); it could be used for modded blocks that need multiple distinct tint values in the same block though.", + "default": -1 + }, + "texture_provider": { + "type": "object", + "oneOf": [ + { + "required": ["type", "texture"], + "properties": { + "type": { + "const": "texture" + }, + "texture": { + "type": "string", + "description": "A valid key from the 'textures' section." + } + } + }, + { + "required": ["type", "texture_palette"], + "properties": { + "type": { + "const": "texture_palette" + }, + "texture_palette": { + "type": "string", + "description": "A valid key from the 'texture_palettes' section." + } + } + } + ] + }, + "rotation": { + "type": "number", + "description": "Rotates the texture clockwise by the specified number of degrees. Can be 0, 90, 180, or 270. Defaults to 0. \n\nRotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertexes (selected implicitly, or explicitly though `uv`)", + "markdownDescription": "Rotates the texture clockwise by the specified number of degrees. Can be 0, 90, 180, or 270. Defaults to 0. \n\nRotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertexes (selected implicitly, or explicitly though `uv`)", + "default": 0 + } + } + }, + "common_display_properties": { + "type": "object", + "default": {}, + "properties": { + "billboard": { + "type": "string", + "enum": ["fixed", "vertical", "horizontal", "center"], + "default": "fixed" + }, + "custom_brightness": { + "type": "number", + "default": 0 + }, + "custom_name": { + "$ref": "#/$defs/optional_adventure_component", + "default": null + }, + "glow_color_override": { + "type": "number", + "default": 16777215 + }, + "is_custom_name_visible": { + "type": "boolean", + "default": false + }, + "is_glowing": { + "type": "boolean", + "default": false + }, + "shadow_radius": { + "type": "number", + "default": 0.0 + }, + "shadow_strength": { + "type": "number", + "default": 1.0 + } + } + }, + "item_display_properties": { + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/common_display_properties" + }, + { + "type": "object", + "properties": { + "item": { + "type": "string", + "default": "minecraft:air", + "description": "A string representing a detailed Minecraft item stack (e.g., 'minecraft:wooden_sword[damage=3]')." + }, + "item_display": { + "type": "string", + "enum": [ + "none", + "thirdperson_lefthand", + "thirdperson_righthand", + "firstperson_lefthand", + "firstperson_righthand", + "head", + "gui", + "ground", + "fixed" + ], + "default": "none" + } + } + } + ] + }, + "block_display_properties": { + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/common_display_properties" + }, + { + "type": "object", + "properties": { + "block_state": { + "type": "string", + "default": "minecraft:air", + "description": "A string representing Minecraft block data (e.g., 'minecraft:cake[bites=3]')." + } + } + } + ] + }, + "text_display_properties": { + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/common_display_properties" + }, + { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["center", "left", "right"], + "default": "center" + }, + "background_color": { + "type": "number", + "default": 1073741824 + }, + "is_default_background": { + "type": "boolean", + "default": false + }, + "is_see_through": { + "type": "boolean", + "default": false + }, + "is_shadowed": { + "type": "boolean", + "default": false + }, + "line_width": { + "type": "number", + "default": 200 + }, + "text": { + "$ref": "#/$defs/optional_adventure_component", + "default": null + }, + "text_opacity": { + "type": "number", + "default": -1 + } + } + } + ] + }, + "bone_display_properties": { + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/common_display_properties" + }, + { + "type": "object", + "properties": { + "is_enchanted": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "dynamic_animation": { + "type": "object", + "required": ["loop_mode", "length"], + "properties": { + "loop_mode": { + "oneOf": [ + { + "required": ["type"], + "properties": { + "type": { "const": "once" } + } + }, + { + "required": ["type"], + "properties": { + "type": { "const": "hold" } + } + }, + { + "required": ["type"], + "properties": { + "type": { "const": "loop" }, + "loop_delay": { + "$ref": "#/$defs/molang_expression", + "default": "0" + } + } + } + ] + }, + "blend_weight": { + "$ref": "#/$defs/molang_expression", + "default": "1" + }, + "start_delay": { + "$ref": "#/$defs/molang_expression", + "default": "0" + }, + "length": { + "type": "number" + }, + "global_keyframes": { + "type": "object", + "default": {}, + "properties": { + "texture": { + "type": "object", + "default": {}, + "description": "A collection of texture keyframes, identified by a floating-point timestamp.", + "patternProperties": { + "^\\d+\\.\\d+$": { + "$ref": "#/$defs/texture_keyframe" + } + } + }, + "event": { + "type": "object", + "default": {}, + "description": "A collection of event keyframes, identified by a floating-point timestamp.", + "patternProperties": { + "^\\d+\\.\\d+$": { + "$ref": "#/$defs/event_keyframe" + } + } + } + } + }, + "node_keyframes": { + "type": "object", + "default": {}, + "patternProperties": { + "^[a-z0-9_]+$": { + "type": "object", + "default": {}, + "properties": { + "position": { + "type": "object", + "default": {}, + "description": "A collection of position keyframes, identified by a floating-point timestamp.", + "patternProperties": { + "^\\d+\\.\\d+$": { + "$ref": "#/$defs/transformation_keyframe" + } + } + }, + "rotation": { + "type": "object", + "default": {}, + "description": "A collection of rotation keyframes, identified by a floating-point timestamp.", + "patternProperties": { + "^\\d+\\.\\d+$": { + "$ref": "#/$defs/transformation_keyframe" + } + } + }, + "scale": { + "type": "object", + "default": {}, + "description": "A collection of scale keyframes, identified by a floating-point timestamp.", + "patternProperties": { + "^\\d+\\.\\d+$": { + "$ref": "#/$defs/transformation_keyframe" + } + } + } + } + } + } + } + } + }, + "molang_expression": { + "type": "string", + "description": "A string representing a Molang expression." + }, + "molang_vector3": { + "type": "array", + "items": { "$ref": "#/$defs/molang_expression" }, + "minItems": 3, + "maxItems": 3 + }, + "texture_keyframe": { + "type": "object", + "default": {}, + "description": "Maps texture palettes to active states. Each key corresponds to a valid texture palette key from the 'texture_palette' section, and the value defines its active state.", + "patternProperties": { + "^[a-z0-9_]+$": { + "type": "string", + "pattern": "^[a-z0-9_]+$" + } + } + }, + "event_keyframe": { + "type": "object", + "required": ["events"], + "properties": { + "events": { + "type": "array", + "description": "A list of event names that can be used to trigger actions in the API.", + "items": { + "type": "string", + "pattern": "^[a-z0-9_]+$" + } + } + } + }, + "transformation_keyframe": { + "type": "object", + "required": ["value", "interpolation"], + "properties": { + "value": { + "$ref": "#/$defs/molang_vector3" + }, + "post": { + "$ref": "#/$defs/molang_vector3" + }, + "interpolation": { + "type": "object", + "oneOf": [ + { + "type": "object", + "required": ["type", "easing"], + "properties": { + "type": { + "const": "linear" + }, + "easing": { + "type": "string", + "enum": [ + "linear", + "step", + "ease_in_quad", + "ease_out_quad", + "ease_in_out_quad", + "ease_in_cubic", + "ease_out_cubic", + "ease_in_out_cubic", + "ease_in_quart", + "ease_out_quart", + "ease_in_out_quart", + "ease_in_quint", + "ease_out_quint", + "ease_in_out_quint", + "ease_in_sine", + "ease_out_sine", + "ease_in_out_sine", + "ease_in_expo", + "ease_out_expo", + "ease_in_out_expo", + "ease_in_circ", + "ease_out_circ", + "ease_in_out_circ", + "ease_in_back", + "ease_out_back", + "ease_in_out_back", + "ease_in_elastic", + "ease_out_elastic", + "ease_in_out_elastic", + "ease_in_bounce", + "ease_out_bounce", + "ease_in_out_bounce" + ] + }, + "easing_arguments": { + "type": "array", + "items": { + "type": "number" + }, + "default": [] + } + } + }, + { + "type": "object", + "required": [ + "type", + "left_handle_time", + "left_handle_value", + "right_handle_time", + "right_handle_value" + ], + "properties": { + "type": { + "const": "bezier" + }, + "left_handle_time": { + "$ref": "#/$defs/vector3" + }, + "left_handle_value": { + "$ref": "#/$defs/vector3" + }, + "right_handle_time": { + "$ref": "#/$defs/vector3" + }, + "right_handle_value": { + "$ref": "#/$defs/vector3" + } + } + }, + { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "const": "catmullrom" + } + } + }, + { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "const": "step" + } + } + } + ] + } + } + }, + "resource_location": { + "type": "string", + "pattern": "^[a-z0-9_\\-]+:[a-z0-9_\\-./]+$", + "description": "A string representing a Minecraft resource location." + }, + "optional_adventure_component": { + "type": ["string", "null"], + "description": "A string representing a serialized Adventure text component. This can be plain text (e.g., 'hello' or '\"hello world\"'), JSON-formatted text (e.g., '{\"text\":\"hello\",\"bold\":true}'), or an array of components (e.g., '[\"hello\",\"world\"]')." + }, + "matrix": { + "type": "array", + "items": { "type": "number" }, + "minItems": 16, + "maxItems": 16 + }, + "vector2": { + "type": "array", + "items": { "type": "number" }, + "minItems": 2, + "maxItems": 2 + }, + "vector3": { + "type": "array", + "items": { "type": "number" }, + "minItems": 3, + "maxItems": 3 + }, + "vector4": { + "type": "array", + "items": { "type": "number" }, + "minItems": 4, + "maxItems": 4 + } + } +} diff --git a/schemas/pluginJson.schema.json b/schemas/pluginJson.schema.json deleted file mode 100644 index 51e88d27..00000000 --- a/schemas/pluginJson.schema.json +++ /dev/null @@ -1,678 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/jsonExport", - "definitions": { - "jsonExport": { - "type": "object", - "required": ["settings", "nodes", "variants", "textures", "animations"], - "properties": { - "settings": { - "type": "object", - "required": [ - "export_namespace", - "bounding_box", - "custom_model_data_offset", - "baked_animations" - ], - "properties": { - "export_namespace": { - "type": "string", - "default": "armor_stand", - "description": "The namespace to export the project to. This is the namespace that will be used in the exported Resource Pack and Data Pack." - }, - "bounding_box": { - "type": "array", - "default": [48, 48], - "description": "Determines the culling box of the model. The model will stop rendering when this box is off-screen.", - "items": { - "type": "integer", - "minimum": 0 - }, - "minItems": 2, - "maxItems": 2 - }, - "display_item": { - "type": "string", - "default": "minecraft:white_dye", - "description": "The item to display the Blueprints models in-game. Multiple Blueprints can be placed on the same item and they will be merged automatically." - }, - "custom_model_data_offset": { - "type": "number", - "default": 0, - "description": "The offset to use for the Custom Model Data of the Display Item. Allows multiple Blueprints on the same item, but in separate, unaffiliated Resource Packs." - }, - "baked_animations": { - "type": "boolean", - "default": true, - "description": "Whether or not to bake the exported animations.\n\nBaked animations have their frames pre-calculated and stored in the exported JSON file, reducing the complexity of rendering the model in-game.\n\nSome Plugins may require this to be enabled to function correctly." - } - } - }, - "nodes": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/node" - } - } - }, - "variants": { - "type": "object", - "description": "The Rig's Variants", - "additionalProperties": false, - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/variant" - } - } - }, - "textures": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/texture" - } - } - }, - "animations": { "$ref": "#/definitions/dynamicAnimations" } - }, - "if": { - "properties": { - "settings": { - "properties": { - "baked_animations": { "const": true } - } - } - } - }, - "then": { - "properties": { - "animations": { "$ref": "#/definitions/bakedAnimations" } - } - } - }, - "vec2": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 }, - "vec3": { "type": "array", "items": { "type": "number" }, "minItems": 3, "maxItems": 3 }, - "vec3String": { - "type": "array", - "items": { "type": "string" }, - "minItems": 3, - "maxItems": 3 - }, - "vec4": { "type": "array", "items": { "type": "number" }, "minItems": 4, "maxItems": 4 }, - "vanillaModel": { - "type": "object", - "required": ["textures", "elements", "display"], - "properties": { - "textures": { - "type": "object", - "patternProperties": { ".+": { "type": "string" } } - }, - "elements": { - "type": "array", - "items": { - "type": "object", - "required": ["from", "to", "faces"], - "properties": { - "from": { "$ref": "#/definitions/vec3" }, - "to": { "$ref": "#/definitions/vec3" }, - "faces": { - "type": "object", - "properties": { - "north": { - "$ref": "#/definitions/vanillaElementFace" - }, - "east": { - "$ref": "#/definitions/vanillaElementFace" - }, - "south": { - "$ref": "#/definitions/vanillaElementFace" - }, - "west": { - "$ref": "#/definitions/vanillaElementFace" - }, - "up": { - "$ref": "#/definitions/vanillaElementFace" - }, - "down": { - "$ref": "#/definitions/vanillaElementFace" - } - } - } - } - } - }, - "display": { - "type": "object", - "properties": { - "head": { - "type": "object", - "properties": { "rotation": { "$ref": "#/definitions/vec3" } } - } - } - } - } - }, - "vanillaElementFace": { - "type": "object", - "properties": { - "uv": { - "type": "array", - "items": { "type": "number" }, - "minItems": 4, - "maxItems": 4 - }, - "texture": { "type": "string" } - } - }, - "variantModel": { - "type": "object", - "required": ["parent", "textures"], - "properties": { - "parent": { "type": "string" }, - "textures": { - "type": "object", - "patternProperties": { ".+": { "type": "string" } } - } - } - }, - "variantModelContainer": { - "type": "object", - "required": ["model", "custom_model_data"], - "properties": { - "model": { - "oneOf": [ - { - "type": "null", - "description": "If the model is null it means all of the textures for this model were replaced with the internal transparency texture" - }, - { "$ref": "#/definitions/vanillaModel" }, - { "$ref": "#/definitions/variantModel" } - ] - }, - "custom_model_data": { "type": "integer" } - } - }, - "nodeTransform": { - "type": "object", - "description": "The transformation of a node. Includes several different storage methods for the transformation. All of these methods contain the same data, it's up to the plugin developer to choose which method to use.", - "required": ["matrix", "pos", "rot", "scale"], - "properties": { - "matrix": { - "type": "array", - "description": "The transformation matrix of the node. The matrix is a 4x4 matrix in row-major order.", - "items": { "type": "number" }, - "minItems": 16, - "maxItems": 16 - }, - "transformation": { - "type": "object", - "description": "The decomposed matrix transformation of the node.", - "translation": { - "$ref": "#/definitions/vec3", - "description": "A vector3 representing the translation of the node." - }, - "left_rotation": { - "$ref": "#/definitions/vec4", - "description": "A quaternion representing the left rotation of the node." - }, - "scale": { - "$ref": "#/definitions/vec3", - "description": "A vector3 representing the scale of the node." - } - }, - "pos": { - "$ref": "#/definitions/vec3", - "description": "A vector3 representing the position of the node." - }, - "rot": { - "$ref": "#/definitions/vec3", - "description": "A vector3 representing the rotation of the node." - }, - "head_rot": { - "$ref": "#/definitions/vec2", - "description": "A vector2 representing the head rotation of the node.\n\nUsed for correctly rotating located entities, and cameras, as they don't have access to a Z axis." - }, - "scale": { - "$ref": "#/definitions/vec3", - "description": "A vector3 representing the scale of the node." - }, - "interpolation": { - "type": "string", - "description": "The instant-interpolation mode of the node.\n\n- `pre-post`", - "enum": ["pre-post", "step"] - }, - "commands": { "type": "string" }, - "execute_condition": { "type": "string" } - } - }, - "node": { - "type": "object", - "required": ["type", "name", "uuid", "default_transform"], - "properties": { - "type": { - "type": "string", - "enum": [ - "bone", - "struct", - "camera", - "locator", - "text_display", - "item_display", - "block_display" - ] - }, - "name": { "type": "string" }, - "uuid": { "type": "string" }, - "parent": { "type": "string" }, - "default_transform": { - "$ref": "#/definitions/nodeTransform", - "description": "The default transformation of the node." - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { "const": "bone" } - } - }, - "then": { - "required": ["bounding_box", "configs"], - "properties": { - "modelPath": { "type": "string" }, - "bounding_box": { - "type": "object", - "required": ["min", "max"], - "properties": { - "min": { "$ref": "#/definitions/vec3" }, - "max": { "$ref": "#/definitions/vec3" } - } - }, - "configs": { - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/boneConfig" - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { "const": "struct" } - } - }, - "then": {} - }, - { - "if": { - "properties": { - "type": { "const": "camera" } - } - }, - "then": {} - }, - { - "if": { - "properties": { - "type": { "const": "locator" } - } - }, - "then": { - "required": ["config"], - "properties": { - "config": { - "$ref": "#/definitions/locatorConfig" - } - } - } - }, - { - "if": { - "properties": { - "type": { "const": "text_display" } - } - }, - "then": { - "required": ["text", "align", "config"], - "properties": { - "text": {}, - "line_width": { "type": "number" }, - "background_color": { "type": "string" }, - "background_alpha": { "type": "number" }, - "align": { - "type": "string", - "enum": ["left", "center", "right"] - }, - "config": { - "$ref": "#/definitions/boneConfig" - } - } - } - }, - { - "if": { - "properties": { - "type": { "const": "block_display" } - } - }, - "then": { - "required": ["config", "block"], - "properties": { - "block": { "type": "string" }, - "config": { - "$ref": "#/definitions/boneConfig" - } - } - } - }, - { - "if": { - "properties": { - "type": { "const": "item_display" } - } - }, - "then": { - "required": ["config", "item"], - "properties": { - "item": { "type": "string" }, - "config": { - "$ref": "#/definitions/boneConfig" - } - } - } - } - ] - }, - "boneConfig": { - "type": "object", - "properties": { - "billboard": { - "type": "string", - "enum": ["fixed", "vertical", "horizontal", "center"] - }, - "override_brightness": { "type": "boolean", "default": false }, - "brightness_override": { "type": "number", "default": 1 }, - "enchanted": { "type": "boolean", "default": false }, - "glowing": { "type": "boolean", "default": false }, - "override_glow_color": { "type": "boolean", "default": false }, - "glow_color": { "type": "string", "default": "#ffffff" }, - "inherit_settings": { "type": "boolean", "default": true }, - "invisible": { "type": "boolean", "default": false }, - "nbt": { "type": "string", "default": "{}" }, - "shadow_radius": { "type": "number", "default": 0 }, - "shadow_strength": { "type": "number", "default": 1 }, - "use_nbt": { "type": "boolean", "default": false } - } - }, - "locatorConfig": { - "type": "object", - "properties": { - "use_entity": { "type": "boolean", "default": false }, - "entity_type": { "type": "string", "default": "minecraft:pig" }, - "summon_commands": { "type": "string", "default": "" }, - "ticking_commands": { "type": "string", "default": "" } - } - }, - "nodeStructure": { - "type": "object", - "required": ["uuid", "children"], - "properties": { - "uuid": { "type": "string" }, - "children": { - "type": "array", - "items": { "$ref": "#/definitions/nodeStructure" } - } - } - }, - "bakedAnimations": { - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "type": "object", - "required": [ - "name", - "duration", - "loop_delay", - "loop_mode", - "frames", - "modified_nodes" - ], - "additionalProperties": false, - "properties": { - "name": { "type": "string" }, - "duration": { "type": "number" }, - "loop_delay": { "type": "number" }, - "loop_mode": { "type": "string", "enum": ["none", "loop", "ping-pong"] }, - "modified_nodes": { "type": "array", "items": { "type": "string" } }, - "frames": { - "type": "array", - "items": { - "type": "object", - "required": ["time", "node_transforms"], - "properties": { - "time": { "type": "number" }, - "node_transforms": { - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/nodeTransform" - } - } - }, - "variant": { - "type": "object", - "description": "If included, this frame should change the variant of the model to the specified variant.", - "properties": { - "uuid": { - "type": "string", - "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - }, - "execute_condition": { "type": "string" } - } - } - } - } - } - } - } - } - }, - "dynamicAnimations": { - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "type": "object", - "required": ["name", "loop_mode", "duration", "excluded_nodes", "animators"], - "additionalProperties": true, - "properties": { - "uuid": { "type": "string" }, - "name": { "type": "string" }, - "loop_mode": { "type": "string", "enum": ["loop", "once", "hold"] }, - "duration": { "type": "number" }, - "loop_delay": { "type": "number" }, - "excluded_nodes": { - "type": "array", - "items": { "type": "string" } - }, - "animators": { - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "type": "array", - "items": { "$ref": "#/definitions/keyframe" } - } - } - } - } - } - } - }, - "keyframe": { - "type": "object", - "required": ["time", "channel"], - "properties": { - "time": { "type": "number" }, - "channel": { "type": "string" } - }, - "oneOf": [ - { - "required": ["value", "interpolation"], - "properties": { - "channel": { "enum": ["position", "rotation", "scale"] }, - "value": { "$ref": "#/definitions/vec3String" }, - "post": { "$ref": "#/definitions/vec3String" }, - "interpolation": { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { "const": "linear" }, - "easing": { "$ref": "#/definitions/easing" }, - "easingArgs": { - "type": "array", - "items": { "type": "number" } - } - } - }, - { - "type": "object", - "properties": { - "type": { "const": "bezier" } - } - }, - { - "type": "object", - "properties": { - "type": { "const": "catmullrom" } - } - }, - { - "type": "object", - "properties": { - "type": { "const": "step" } - } - } - ] - } - } - }, - { - "required": ["variant"], - "properties": { - "channel": { "const": "variant" }, - "variant": { "type": "string" }, - "execute_condition": { "type": "string" } - } - }, - { - "required": ["commands"], - "properties": { - "channel": { "const": "commands" }, - "commands": { "type": "string" }, - "execute_condition": { "type": "string" }, - "repeat": { "type": "boolean" }, - "repeat_frequency": { "type": "number", "min": 1 } - } - } - ] - }, - "variant": { - "type": "object", - "description": "A variant of the rig. Variants are used to change the appearance of the rig by swapping out different textures at runtime.", - "required": ["name", "display_name", "models", "texture_map", "excluded_nodes"], - "properties": { - "name": { - "type": "string", - "description": "The name of the variant." - }, - "display_name": { - "type": "string", - "description": "The display name of the variant. Only used for fancy display purposes such as UI elements." - }, - "texture_map": { - "type": "object", - "description": "A map of default texture UUID -> variant texture UUID. If a texture is not in this map, it will be assumed to be the same as the default texture.", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "type": "string", - "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - } - }, - "models": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "$ref": "#/definitions/variantModelContainer" - } - } - }, - "excluded_nodes": { - "type": "array", - "description": "A list of node UUIDs that should be excluded / ignored when this variant is applied.", - "items": { "type": "string" } - }, - "is_default": { - "type": "boolean", - "description": "Whether or not this variant is the default variant." - } - } - }, - "easing": { - "type": "string", - "enum": [ - "linear", - "step", - "easeInQuad", - "easeOutQuad", - "easeInOutQuad", - "easeInCubic", - "easeOutCubic", - "easeInOutCubic", - "easeInQuart", - "easeOutQuart", - "easeInOutQuart", - "easeInQuint", - "easeOutQuint", - "easeInOutQuint", - "easeInSine", - "easeOutSine", - "easeInOutSine", - "easeInExpo", - "easeOutExpo", - "easeInOutExpo", - "easeInCirc", - "easeOutCirc", - "easeInOutCirc", - "easeInBack", - "easeOutBack", - "easeInOutBack", - "easeInElastic", - "easeOutElastic", - "easeInOutElastic", - "easeInBounce", - "easeOutBounce", - "easeInOutBounce" - ] - }, - "texture": { - "type": "object", - "required": ["name", "src"], - "properties": { - "name": { "type": "string" }, - "src": { - "type": "string", - "description": "A data URL containing the texture image." - } - } - } - } -}