Structure Configuration
Structure Configuration
The structure configuration file is a JSON text file that defines what schematic will be used, as a structure for the encounter, where it should exist vertically in the world, what materials is is allowed to overwrite, and what materials it should not be allowed to be placed on. There are two main objects in this file the defaultTrump array and the structures array:
{
"defaultTrump":["String"...],
"structures": [{Structure Configuration}...]
}
defaultTrump:
v0.4 OPTIONAL (default: null)
The defaultTrump array contains a list of material names that a structure without a defined trump array will be allowed to overwrite.
If the field is null, all structures must define their trump materials individually.
Structure
A single structure configuration contains a definition of a schematic. This structure can be used in as many encounters as needed. The format of a structure JSON object is:
{
"name": "String",
"file": "String",
"minY": "Integer",
"maxY": "Integer",
"pasteAir": "Boolean,
"trump": ["String"...],
"invalid": ["String"...]
}
name:
v0.1 REQUIRED
The name field is a string which uniquely identifies the structure.
Whenever an structure is referenced, this name is used.
"name": "Castle3"
file:
v0.1 REQUIRED
The file field is a string containing the location of the schematic file.
This path may include subdirectories.
The schematic file must be in a format readable by WorldEdit.
If a schematic cannot be found, the structure's definition is declared invalid, and the system will not use this definition.
v0.3.1 update:
It is important to note that the defined WEOffsetY within the schematic is used to define "ground level."
This means, anything below the offset will be allowed to overwrite any blocks.
This was added to allow basements and the like to not be hindered by the rules which govern grief detection.
"file": "schematics/keeps/Castle3.schematic"
minY:
v0.1 OPTIONAL (default: 0)
The minY field is an integer between 0 and 256 and used to define the minimum y coordinate the structure is allowed to be placed.
It is important to make sure this is below the maxY field, or there will never be any suitable locations.
"minY": 0
maxY:
v0.1 OPTIONAL (default: 0)
The maxY field is an integer between 0 and 256.
It is used to define the maximum y coordinate the structure is allowed to be placed.
It is important to make sure this is abover the minY field, or the structure will not be placed.
"maxY": 128
pasteAir:
v0.4.3 OPTIONAL (default: true)
The pasteAir field is a boolean value (true | false) which will cause the system to not overwrite
existing blocks with air contained in the schematic file.
"pasteAir": false
trump:
v0.1 OPTIONAL (default: null)
The trump array contains the names of the materials which the structure is allowed to overwrite.
If this array is null, the defaultTrump array will be used for this list.
It is important that the AIR material is in this list, or any existing AIR blocks will stop the structure from placing.
It is also important to note that if STONE or DIRT is in this list, it is likely the structure will
be placed underground.
An example of this directive is:
"trump": ["AIR","LONG_GRASS","YELLOW_FLOWER","RED_ROSE","SNOW"]
invalid:
v0.1 OPTIONAL (default: null)
The invalid array, like trump, is an array of material names.
This list defines materials on which the structure is not allowed to be placed.
Most commonly, this should include AIR.
If AIR is not present in this list, the structure will be allowed to be placed in the sky.
These materials represent what is not allowed as a foundation for the structure.
An example of the invalid directive is:
"invalid": ["AIR","STATIONARY_WATER","WATER"]
An example of a full structure configuration is:
{
"name": "Castle3",
"file": "schematics/keeps/Castle3.schematic",
"trump: null,
"invalid": [
"AIR",
"WATER",
"STATIONARY_WATER"
]
}
In this example, a structure known as "Castle3" will be loaded from the schematic file in the schematic/keeps subdirectory of the plugin directory. It will use the default trump list, and will not be allowed to be placed on top of water or air.
Comments