Package net.minecraft.structure
Class StructureStart<C extends FeatureConfig>
java.lang.Object
net.minecraft.structure.StructureStart<C>
- Direct Known Subclasses:
BuriedTreasureFeature.Start
,DesertPyramidFeature.Start
,EndCityFeature.Start
,IglooFeature.Start
,JungleTempleFeature.Start
,MarginedStructureStart
,MineshaftFeature.Start
,NetherFortressFeature.Start
,OceanMonumentFeature.Start
,OceanRuinFeature.Start
,RuinedPortalFeature.Start
,ShipwreckFeature.Start
,StrongholdFeature.Start
,SwampHutFeature.Start
,WoodlandMansionFeature.Start
public abstract class StructureStart<C extends FeatureConfig> extends Object
A structure start is created to describe a structure that will be generated by
chunk generation. It contains a definition of its pieces and is associated
with the chunk that the structure originates from.
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description StructureStart(StructureFeature<C> feature, int chunkX, int chunkZ, BlockBox box, int references, long seed)
-
Method Summary
Modifier and Type Method 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)
-
Field Details
-
DEFAULT
-
feature
-
children
-
boundingBox
-
chunkX
private final int chunkX -
chunkZ
private final int chunkZ -
references
private int referencesThe number of chunks that intersect the structures bounding box, and have stored references to its starting chunk.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).
-
random
-
-
Constructor Details
-
StructureStart
public StructureStart(StructureFeature<C> feature, int chunkX, int chunkZ, BlockBox box, int references, long seed)
-
-
Method Details
-
init
public abstract void init(DynamicRegistryManager registryManager, ChunkGenerator chunkGenerator, StructureManager manager, int chunkX, int chunkZ, Biome biome, C config) -
getBoundingBox
-
getChildren
-
generateStructure
public void generateStructure(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox box, ChunkPos chunkPos) -
setBoundingBoxFromChildren
protected void setBoundingBoxFromChildren() -
toTag
-
randomUpwardTranslation
-
randomUpwardTranslation
-
hasChildren
public boolean hasChildren() -
getChunkX
public int getChunkX() -
getChunkZ
public int getChunkZ() -
getPos
-
isInExistingChunk
public boolean isInExistingChunk() -
incrementReferences
public void incrementReferences() -
getReferences
public int getReferences() -
getReferenceCountToBeInExistingChunk
protected int getReferenceCountToBeInExistingChunk() -
getFeature
-