From bad3e5d6d5b74453c0edaf5f3e4e761509a7f8f7 Mon Sep 17 00:00:00 2001 From: QuazChick <79767058+QuazChick@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:47:16 +0100 Subject: [PATCH] Added client biome schema (#319) --- README.md | 1 + source/compress_specification.json | 1 + source/resource/biomes/biomes.json | 26 +++++++++++++ .../format/components/fog_appearance.json | 15 +++++++ .../biomes/format/components/sky_color.json | 17 ++++++++ .../format/components/water_appearance.json | 17 ++++++++ .../biomes/format/minecraft.client_biome.json | 39 +++++++++++++++++++ vscode-settings.json | 16 ++++++++ 8 files changed, 132 insertions(+) create mode 100644 source/resource/biomes/biomes.json create mode 100644 source/resource/biomes/format/components/fog_appearance.json create mode 100644 source/resource/biomes/format/components/sky_color.json create mode 100644 source/resource/biomes/format/components/water_appearance.json create mode 100644 source/resource/biomes/format/minecraft.client_biome.json diff --git a/README.md b/README.md index 74a5d22a..a96a7f98 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ JSON validation can give snippets for sub items, as well as description, but thi - [Animations](resource/animations/animations.json) - [Animation Controllers](resource/animation_controllers/animation_controller.json) - [Attachables](resource/attachables/attachables.json) +- [Biomes](resource/biomes/biomes.json) - [Biomes client](resource/biomes_client.json) - [Blocks](resource/blocks.json) - [Entity](resource/entity/entities.json) diff --git a/source/compress_specification.json b/source/compress_specification.json index 085c2705..9c4e3c4c 100644 --- a/source/compress_specification.json +++ b/source/compress_specification.json @@ -29,6 +29,7 @@ { "Source": "./resource/animation_controllers/animation_controller.json", "Destination": "../resource/animation_controllers/animation_controller.json" }, { "Source": "./resource/animations/actor_animation.json", "Destination": "../resource/animations/actor_animation.json" }, { "Source": "./resource/attachables/attachables.json", "Destination": "../resource/attachables/attachables.json" }, + { "Source": "./resource/biomes/biomes.json", "Destination": "../resource/biomes/biomes.json" }, { "Source": "./resource/biomes_client.json", "Destination": "../resource/biomes_client.json" }, { "Source": "./resource/blocks.json", "Destination": "../resource/blocks.json" }, { "Source": "./resource/entity/entity.json", "Destination": "../resource/entity/entity.json" }, diff --git a/source/resource/biomes/biomes.json b/source/resource/biomes/biomes.json new file mode 100644 index 00000000..8ac91ecd --- /dev/null +++ b/source/resource/biomes/biomes.json @@ -0,0 +1,26 @@ +{ + "$id": "blockception.minecraft.resource.biomes", + "title": "Client Biome", + "description": "Minecraft client_biome files define client-side settings for biomes in resource packs. This is the new preferred location for per-biome settings that used to be in biomes_client.json.", + "type": "object", + "required": ["format_version", "minecraft:client_biome"], + "additionalProperties": false, + "properties": { + "format_version": { "$ref": "../../general/format_version.json" }, + "minecraft:client_biome": { "$ref": "./format/minecraft.client_biome.json" } + }, + "defaultSnippets": [ + { + "label": "New client biome", + "body": { + "format_version": "${1:1.21.40}", + "minecraft:client_biome": { + "description": { + "identifier": "${3:${TM_FILENAME/[\\.].*//}}" + }, + "components": "^{$4}" + } + } + } + ] +} diff --git a/source/resource/biomes/format/components/fog_appearance.json b/source/resource/biomes/format/components/fog_appearance.json new file mode 100644 index 00000000..465008ad --- /dev/null +++ b/source/resource/biomes/format/components/fog_appearance.json @@ -0,0 +1,15 @@ +{ + "$id": "blockception.minecraft.resource.biomes.minecraft.fog_appearance", + "title": "Fog Appearance", + "description": "Set the fog settings used during rendering. Biomes without this component will have default fog settings.", + "type": "object", + "required": ["fog_identifier"], + "additionalProperties": false, + "properties": { + "fog_identifier": { + "title": "Fog Identifier", + "description": "Identifier of fog definition to use.", + "type": "string" + } + } +} diff --git a/source/resource/biomes/format/components/sky_color.json b/source/resource/biomes/format/components/sky_color.json new file mode 100644 index 00000000..81a31706 --- /dev/null +++ b/source/resource/biomes/format/components/sky_color.json @@ -0,0 +1,17 @@ +{ + "$id": "blockception.minecraft.resource.biomes.minecraft.sky_color", + "title": "Sky Color", + "description": "Set the sky color used during rendering. Biomes without this component will have default sky color behavior.", + "type": "object", + "required": ["sky_color"], + "additionalProperties": false, + "properties": { + "sky_color": { + "title": "Sky Color", + "description": "RGB color of the sky.", + "type": "string", + "format": "color-hex", + "examples": ["#FFFFFF"] + } + } +} diff --git a/source/resource/biomes/format/components/water_appearance.json b/source/resource/biomes/format/components/water_appearance.json new file mode 100644 index 00000000..f3d5b00d --- /dev/null +++ b/source/resource/biomes/format/components/water_appearance.json @@ -0,0 +1,17 @@ +{ + "$id": "blockception.minecraft.resource.biomes.minecraft.water_appearance", + "title": "Water Appearance", + "description": "Set the water surface color used during rendering. Biomes without this component will have default water surface color behavior.", + "type": "object", + "required": ["surface_color"], + "additionalProperties": false, + "properties": { + "surface_color": { + "title": "Surface Color", + "description": "RGB color of the water surface.", + "type": "string", + "format": "color-hex", + "examples": ["#FFFFFF"] + } + } +} diff --git a/source/resource/biomes/format/minecraft.client_biome.json b/source/resource/biomes/format/minecraft.client_biome.json new file mode 100644 index 00000000..49efd610 --- /dev/null +++ b/source/resource/biomes/format/minecraft.client_biome.json @@ -0,0 +1,39 @@ +{ + "$id": "blockception.minecraft.resource.biomes", + "title": "Client Biome Definitions", + "description": "A client biome definition.", + "type": "object", + "additionalProperties": false, + "required": ["description", "components"], + "definitions": { + "components_ref": { + "type": "object", + "title": "Components", + "description": "Any components that this Client Biome uses.", + "additionalProperties": false, + "properties": { + // Components + "minecraft:fog_appearance": { "$ref": "./components/fog_appearance.json" }, + "minecraft:sky_color": { "$ref": "./components/sky_color.json" }, + "minecraft:water_appearance": { "$ref": "./components/water_appearance.json" } + } + } + }, + "properties": { + "description": { + "title": "Client Biome Description", + "description": "Contains non-component settings for a Client Biome.", + "type": "object", + "additionalProperties": false, + "required": ["identifier"], + "properties": { + "identifier": { + "title": "Identifier", + "description": "The name of the Client Biome, used by other features like the '/locate biome' command. Must match the name of a Biome defined by the game or a behavior pack.", + "type": "string" + } + } + }, + "components": { "$ref": "#/definitions/components_ref" } + } +} diff --git a/vscode-settings.json b/vscode-settings.json index 1a91922c..d3a90875 100644 --- a/vscode-settings.json +++ b/vscode-settings.json @@ -60,6 +60,22 @@ "fileMatch": ["attachables/*.{json,jsonc,json5}", "attachables/**/*.{json,jsonc,json5}", "*.{attachable,attach,at}.{json,jsonc,json5}"], "url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/resource/attachables/attachables.json" }, + { + "fileMatch": [ + "resource_packs/*/biomes/*.{json,jsonc,json5}", + "*resource*pack*/biomes/*.{json,jsonc,json5}", + "*Resource*Pack*/biomes/*.{json,jsonc,json5}", + "*RP*/biomes/*.{json,jsonc,json5}", + "*rp*/biomes/*.{json,jsonc,json5}", + "resource_packs/*/biomes/**/*.{json,jsonc,json5}", + "*resource*pack*/biomes/**/*.{json,jsonc,json5}", + "*Resource*Pack*/biomes/**/*.{json,jsonc,json5}", + "*RP*/biomes/**/*.{json,jsonc,json5}", + "*rp*/biomes/**/*.{json,jsonc,json5}", + "*.{client_biome}.{json,jsonc,json5}" + ], + "url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/resource/biomes/biomes.json" + }, { "fileMatch": ["biomes_client.{json,jsonc,json5}"], "url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/resource/biomes_client.json"