From 91ceff66e29a136b8e11d66d28ad44d0559900c0 Mon Sep 17 00:00:00 2001 From: Xterionix <72647213+Xterionix@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:45:17 +0500 Subject: [PATCH] - Block culling rules (#251) --- source/general/block_culling/identifier.json | 9 ++ .../resource/block_culling/block_culling.json | 101 ++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 source/general/block_culling/identifier.json create mode 100644 source/resource/block_culling/block_culling.json diff --git a/source/general/block_culling/identifier.json b/source/general/block_culling/identifier.json new file mode 100644 index 00000000..2090c8ed --- /dev/null +++ b/source/general/block_culling/identifier.json @@ -0,0 +1,9 @@ +{ + "$id": "blockception.minecraft.block_culling.identifier", + "description": "The minecraft block culling rule identifier.", + "examples": ["namespace:rule"], + "pattern": "^[0-9a-zA-Z:_\\.\\-]+$", + "title": "Block Culling Rule Identifier", + "type": "string", + "defaultSnippets": [{ "label": "New Identifier", "body": "$1:$2" }] +} \ No newline at end of file diff --git a/source/resource/block_culling/block_culling.json b/source/resource/block_culling/block_culling.json new file mode 100644 index 00000000..5a1942b5 --- /dev/null +++ b/source/resource/block_culling/block_culling.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "blockception.minecraft.resource.block_culling", + "title": "Block Culling", + "description": "A resource pack file that helps the system determine how to change the appearance of this block.", + "type": "object", + "additionalProperties": false, + "properties": { + "format_version": { "$ref": "../../general/format_version.json" }, + "minecraft:block_culling_rules": { + "title": "Block Culling Rules", + "description": "JSON container used for descriptions, especially the identifier for the name of the culled version of the block.", + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "title": "Description", + "description": "Contains the identifier used by minecraft:geometry block components to refer to this culling data", + "type": "object", + "additionalProperties": false, + "properties": { + "identifier": { + "$ref": "../../general/block_culling/identifier.json", + "description": "Sets the identifier for this rule's description.", + "title": "Identifier" + } + } + }, + "rules": { + "title": "Rules", + "description": "List of all components used to identify geometry parts used in culling.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/rule" + } + } + } + } + }, + "definitions": { + "rule": { + "title": "Rule", + "description": "The rules that specifies a \"geometry_part\" and \"direction\"", + "type": "object", + "additionalProperties": false, + "properties": { + "geometry_part": { + "title": "Geometry Part", + "description": "Specifies the bone, cube, and face that the block will be culled. The cube and face fields are optional to allow culling a specific face. Omitting these fields will cull the whole bone.", + "type": "object", + "additionalProperties": false, + "properties": { + "bone": { + "title": "Bone", + "description": "The bone within the geometry part", + "type": "string" + }, + "cube": { + "title": "Cube", + "description": "The cube within the geometry part", + "type": "integer", + "minimum": 0 + }, + "face": { + "title": "Face", + "description": "The face within the geometry part", + "type": "string", + "enum": ["up", "down", "north", "south", "east", "west"] + } + } + }, + "direction": { + "title": "Direction", + "description": "Specifies the direction of the neighbor block to check for culling. This direction rotates with a block's Transform component.", + "type": "string", + "enum": ["up", "down", "north", "south", "east", "west"] //TODO: Check if "side" and "all" work here too + } + } + } + }, + "examples": [ + { + "format_version": "1.20.60", + "minecraft:block_culling_rules": { + "description": { + "identifier": ":" + }, + "rules": [ + { + "part": { + "bone": "", + "cube": 0, + "face": "" + } + } + ] + } + } + ] +}