Class StructureConfig
public class StructureConfig extends Object
StructureFeature
during chunk
generation.-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description StructureConfig(int spacing, int separation, int salt)
-
Method Summary
Modifier and Type Method Description int
getSalt()
int
getSeparation()
int
getSpacing()
-
Field Details
-
CODEC
-
spacing
private final int spacingDefines the width and height of a cell in the structure placement grid in chunks.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.
-
separation
private final int separationDefines the margin of each cell in the placement grid, which leads to guaranteeing a certain minimum distance between each placed structure.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. -
salt
private final int saltUsed 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. This is used to avoid that two types of structures that have the same spacing always occur in the same chunks of their placement grid, and thus in the same world chunk.
-
-
Constructor Details
-
StructureConfig
public StructureConfig(int spacing, int separation, int salt)
-
-
Method Details
-
getSpacing
public int getSpacing() -
getSeparation
public int getSeparation() -
getSalt
public int getSalt()
-