public abstract class StructureStart<C extends FeatureConfig> extends Object
Modifier and Type | Field and Description |
---|---|
protected BlockBox |
boundingBox |
protected List<StructurePiece> |
children |
private int |
chunkX |
private int |
chunkZ |
static StructureStart<?> |
DEFAULT |
private StructureFeature<C> |
feature |
protected ChunkRandom |
random |
private int |
references
The number of chunks that intersect the structures bounding box,
and have stored references to its starting chunk.
|
Constructor and Description |
---|
StructureStart(StructureFeature<C> feature,
int chunkX,
int chunkZ,
BlockBox box,
int references,
long seed) |
Modifier and Type | Method and Description |
---|---|
void |
generateStructure(StructureWorldAccess world,
StructureAccessor structureAccessor,
ChunkGenerator chunkGenerator,
Random random,
BlockBox box,
ChunkPos chunkPos) |
BlockBox |
getBoundingBox() |
List<StructurePiece> |
getChildren() |
int |
getChunkX() |
int |
getChunkZ() |
StructureFeature<?> |
getFeature() |
BlockPos |
getPos() |
protected int |
getReferenceCountToBeInExistingChunk() |
int |
getReferences() |
boolean |
hasChildren() |
void |
incrementReferences() |
abstract void |
init(DynamicRegistryManager registryManager,
ChunkGenerator chunkGenerator,
StructureManager manager,
int chunkX,
int chunkZ,
Biome biome,
C config) |
boolean |
isInExistingChunk() |
protected void |
randomUpwardTranslation(int seaLevel,
Random random,
int minSeaLevelDistance) |
protected void |
randomUpwardTranslation(Random random,
int minY,
int maxY) |
protected void |
setBoundingBoxFromChildren() |
CompoundTag |
toTag(int chunkX,
int chunkZ) |
public static final StructureStart<?> DEFAULT
private final StructureFeature<C extends FeatureConfig> feature
protected final List<StructurePiece> children
protected BlockBox boundingBox
private final int chunkX
private final int chunkZ
private int references
This number can be lower than the number of potential intersecting chunks, since it is only updated when an actual reference is created in such chunks (when they enter the corresponding chunk generation phase).
protected final ChunkRandom random
public StructureStart(StructureFeature<C> feature, int chunkX, int chunkZ, BlockBox box, int references, long seed)
public abstract void init(DynamicRegistryManager registryManager, ChunkGenerator chunkGenerator, StructureManager manager, int chunkX, int chunkZ, Biome biome, C config)
public BlockBox getBoundingBox()
public List<StructurePiece> getChildren()
public void generateStructure(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox box, ChunkPos chunkPos)
protected void setBoundingBoxFromChildren()
public CompoundTag toTag(int chunkX, int chunkZ)
protected void randomUpwardTranslation(int seaLevel, Random random, int minSeaLevelDistance)
protected void randomUpwardTranslation(Random random, int minY, int maxY)
public boolean hasChildren()
public int getChunkX()
public int getChunkZ()
public BlockPos getPos()
public boolean isInExistingChunk()
public void incrementReferences()
public int getReferences()
protected int getReferenceCountToBeInExistingChunk()
public StructureFeature<?> getFeature()