fix: remove incorrect type definitions in features (#353)

This commit is contained in:
Piotr Brzozowski
2025-06-10 12:03:17 +02:00
committed by GitHub
parent b8bc676bd0
commit c5da42a423
8 changed files with 76 additions and 88 deletions

View File

@@ -68,31 +68,26 @@
}, },
"filler": { "filler": {
"title": "Filler", "title": "Filler",
"type": "string",
"description": "The block to fill the inside of the geode.", "description": "The block to fill the inside of the geode.",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"inner_layer": { "inner_layer": {
"title": "Inner Layer", "title": "Inner Layer",
"type": "string",
"description": "The block that forms the inside layer of the geode shell.", "description": "The block that forms the inside layer of the geode shell.",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"alternate_inner_layer": { "alternate_inner_layer": {
"title": "Alternate Inner Layer", "title": "Alternate Inner Layer",
"type": "string",
"description": "The block that has a chance of generating instead of inner_layer.", "description": "The block that has a chance of generating instead of inner_layer.",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"middle_layer": { "middle_layer": {
"title": "Middle Layer", "title": "Middle Layer",
"type": "string",
"description": "The block that forms the middle layer of the geode shell.", "description": "The block that forms the middle layer of the geode shell.",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"outer_layer": { "outer_layer": {
"title": "Outer Layer", "title": "Outer Layer",
"type": "string",
"description": "The block that forms the outer shell of the geode.", "description": "The block that forms the outer shell of the geode.",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },

View File

@@ -43,7 +43,6 @@
{ {
"title": "Plant Body Block", "title": "Plant Body Block",
"description": "Plant body block.", "description": "Plant body block.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
{ {

View File

@@ -11,7 +11,6 @@
"places_block": { "places_block": {
"title": "Places Block", "title": "Places Block",
"description": "Reference to the block to be placed.", "description": "Reference to the block to be placed.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"search_range": { "search_range": {

View File

@@ -11,7 +11,6 @@
"fill_with": { "fill_with": {
"title": "Identifier", "title": "Identifier",
"description": "Reference to the block to fill the cave with.", "description": "Reference to the block to fill the cave with.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"width_modifier": { "width_modifier": {

View File

@@ -3,13 +3,34 @@
"description": "`minecraft:single_block_feature` places a single block in the world. The `may_place_on` and `may_replace` fields are allowlists which specify where the block can be placed. If these fields are omitted, the block can be placed anywhere. The block's internal survivability and placement rules can optionally be enforced with the `enforce_survivability_rules` and `enforce_placement_rules` fields. These rules are specified per-block and are typically designed to produce high quality gameplay or natural behavior. However, enabling this enforcement may make it harder to debug placement failures.\n Succeeds if: The block is successfully placed in the world.\n Fails if: The block fails to be placed.", "description": "`minecraft:single_block_feature` places a single block in the world. The `may_place_on` and `may_replace` fields are allowlists which specify where the block can be placed. If these fields are omitted, the block can be placed anywhere. The block's internal survivability and placement rules can optionally be enforced with the `enforce_survivability_rules` and `enforce_placement_rules` fields. These rules are specified per-block and are typically designed to produce high quality gameplay or natural behavior. However, enabling this enforcement may make it harder to debug placement failures.\n Succeeds if: The block is successfully placed in the world.\n Fails if: The block fails to be placed.",
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": [ "description", "places_block", "enforce_placement_rules", "enforce_survivability_rules" ], "required": ["description", "places_block", "enforce_placement_rules", "enforce_survivability_rules"],
"definitions": { "definitions": {
"block_side": { "block_side": {
"oneOf": [ "oneOf": [
{ "title": "Block", "description": "Reference to the block it may attach to.", "type": "string", "$ref": "../../../general/block/reference.json" }, { "title": "Block", "description": "Reference to the block it may attach to.", "$ref": "../../../general/block/reference.json" },
{ "type": "array", "items": { "title": "Block", "description": "Reference to the block it may attach to.", "type": "string", "$ref": "../../../general/block/reference.json" } } {
"type": "array",
"items": { "title": "Block", "description": "Reference to the blocks it may attach to.", "$ref": "../../../general/block/reference.json" }
}
] ]
},
"weighted_block_reference": {
"title": "Weighted Block Reference",
"description": "Reference to the block to be placed.",
"type": "object",
"required": ["block"],
"properties": {
"block": {
"title": "Block",
"description": "Reference to the block to be placed.",
"$ref": "../../../general/block/reference.json"
},
"weight": {
"title": "Weight",
"description": "Random weight of this block. A higher number will increase the probability of this block to be picked during placement.",
"type": "number"
}
}
} }
}, },
"properties": { "properties": {
@@ -21,7 +42,6 @@
{ {
"title": "Places Block", "title": "Places Block",
"description": "Reference to the block to be placed.", "description": "Reference to the block to be placed.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
{ {
@@ -30,17 +50,7 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "items": {
"title": "Block", "$ref": "#/definitions/weighted_block_reference"
"description": "Reference to the block to be placed.",
"type": "array",
"items": [
{ "title": "Block", "description": "Reference to the block to be placed.", "$ref": "../../../general/block/reference.json" },
{
"title": "Weight",
"description": "Random weight of this block. A higher number will increase the probability of this block to be picked during placement.",
"type": "number"
}
]
} }
} }
] ]
@@ -112,7 +122,6 @@
"items": { "items": {
"title": "Block", "title": "Block",
"description": "A block that may be replaced during placement. Omit this field to allow any block to be replaced.", "description": "A block that may be replaced during placement. Omit this field to allow any block to be replaced.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
} }
} }

View File

@@ -12,7 +12,7 @@
"title": "Structure Name", "title": "Structure Name",
"description": "Reference to the structure to be placed.", "description": "Reference to the structure to be placed.",
"type": "string", "type": "string",
"pattern": "^\\w+:(\\w|\/)+" "pattern": "^\\w+:(\\w|/)+"
}, },
"adjustment_radius": { "adjustment_radius": {
"title": "Adjustment Radius", "title": "Adjustment Radius",
@@ -60,7 +60,6 @@
"type": "array", "type": "array",
"items": { "items": {
"title": "Block", "title": "Block",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
} }
}, },
@@ -70,7 +69,6 @@
"type": "array", "type": "array",
"items": { "items": {
"title": "Block", "title": "Block",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
} }
} }

View File

@@ -111,7 +111,6 @@
"decoration_block": { "decoration_block": {
"title": "Decoration Block", "title": "Decoration Block",
"description": "The block used for decorating the trunk.", "description": "The block used for decorating the trunk.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"num_steps": { "num_steps": {
@@ -211,15 +210,15 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": [ "items": [
{ {
"$ref": "#/definitions/leaf_block" "$ref": "#/definitions/leaf_block"
}, },
{ {
"title": "Weight", "title": "Weight",
"description": "Weight used in random selection. Value is relative to other weights in the collection.", "description": "Weight used in random selection. Value is relative to other weights in the collection.",
"type": "number", "type": "number",
"minimum": 0 "minimum": 0
} }
] ]
}, },
"canopy_decoration": { "canopy_decoration": {
@@ -379,7 +378,6 @@
"leaf_block": { "leaf_block": {
"title": "Leaf Block", "title": "Leaf Block",
"description": "The block thata forms the canopy of the tree.", "description": "The block thata forms the canopy of the tree.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"trunk_width": { "trunk_width": {
@@ -414,7 +412,6 @@
"decoration_block": { "decoration_block": {
"title": "Decoration Block", "title": "Decoration Block",
"description": "The block used for decorating the trunk.", "description": "The block used for decorating the trunk.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"num_steps": { "num_steps": {
@@ -439,7 +436,6 @@
"trunk_block": { "trunk_block": {
"title": "Trunk Block", "title": "Trunk Block",
"description": "The block that forms the tree trunk.", "description": "The block that forms the tree trunk.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
} }
}, },
@@ -1130,7 +1126,6 @@
"decoration_block": { "decoration_block": {
"title": "Decoration Block", "title": "Decoration Block",
"description": "The block used for decorating the trunk.", "description": "The block used for decorating the trunk.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"num_steps": { "num_steps": {
@@ -1230,15 +1225,15 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": [ "items": [
{ {
"$ref": "#/definitions/leaf_block" "$ref": "#/definitions/leaf_block"
}, },
{ {
"title": "Weight", "title": "Weight",
"description": "Weight used in random selection. Value is relative to other weights in the collection.", "description": "Weight used in random selection. Value is relative to other weights in the collection.",
"type": "number", "type": "number",
"minimum": 0 "minimum": 0
} }
] ]
}, },
"canopy_decoration": { "canopy_decoration": {
@@ -1417,15 +1412,15 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": [ "items": [
{ {
"$ref": "#/definitions/leaf_block" "$ref": "#/definitions/leaf_block"
}, },
{ {
"title": "Weight", "title": "Weight",
"description": "Weight used in random selection. Value is relative to other weights in the collection.", "description": "Weight used in random selection. Value is relative to other weights in the collection.",
"type": "number", "type": "number",
"minimum": 0 "minimum": 0
} }
] ]
} }
} }
@@ -1451,7 +1446,6 @@
"root_block": { "root_block": {
"title": "Root Block", "title": "Root Block",
"description": "Block used for roots.", "description": "Block used for roots.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"above_root": { "above_root": {
@@ -1468,19 +1462,16 @@
"above_root_block": { "above_root_block": {
"title": "Above Root Block", "title": "Above Root Block",
"description": "The block placed on the top of the roots.", "description": "The block placed on the top of the roots.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"muddy_root_block": { "muddy_root_block": {
"title": "Muddy Root Block", "title": "Muddy Root Block",
"description": "The block used for muddy roots.", "description": "The block used for muddy roots.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"mud_block": { "mud_block": {
"title": "Mud Block", "title": "Mud Block",
"description": "The block used to determine if a muddy root should be placed.", "description": "The block used to determine if a muddy root should be placed.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"y_offset": { "y_offset": {

View File

@@ -14,14 +14,12 @@
"type": "array", "type": "array",
"items": { "items": {
"title": "Replace Block", "title": "Replace Block",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
} }
}, },
"ground_block": { "ground_block": {
"title": "Ground Block", "title": "Ground Block",
"description": "Block used to create a base for the vegetation patch.", "description": "Block used to create a base for the vegetation patch.",
"type": "string",
"$ref": "../../../general/block/reference.json" "$ref": "../../../general/block/reference.json"
}, },
"vegetation_feature": { "vegetation_feature": {