public class StructureConfig extends Object
StructureFeature
during chunk
generation.Modifier and Type | Field and Description |
---|---|
static com.mojang.serialization.Codec<StructureConfig> |
CODEC |
private int |
salt
Used together with the world seed and a grid cell's x,y coordinates to seed the RNG when deciding
whether a structure should really be placed in a grid cell or not.
|
private int |
separation
Defines the margin of each cell in the placement grid, which leads to guaranteeing
a certain minimum distance between each placed structure.
|
private int |
spacing
Defines the width and height of a cell in the structure placement grid in chunks.
|
Constructor and Description |
---|
StructureConfig(int spacing,
int separation,
int salt) |
Modifier and Type | Method and Description |
---|---|
int |
getSalt() |
int |
getSeparation() |
int |
getSpacing() |
public static final com.mojang.serialization.Codec<StructureConfig> CODEC
private final int spacing
For each cell in the grid, the chunk generator will attempt to place the start of a structure.
Minimum is 1, which means the structure will potentially be placed in every chunk. 2 leads to one structure per 2x2 chunks, and so on.
private final int separation
The margin is effectively subtracted from the width and height of a cell when trying to determine the actual starting chunk within the cell.
A value of 0 means that the structure can be placed in any chunk within a grid cell, which also means two structures from adjacent grid cells could be placed directly next to each other.
A value that equals spacing
- 1 will restrict placement of the structure to the
chunk at 0,0 of the grid cell.
This value must be between 0 and spacing
- 1, and is expressed in chunks.
private final int salt