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 BlockBoxboundingBoxprotected List<StructurePiece>childrenprivate intchunkXprivate intchunkZstatic StructureStart<?>DEFAULTprivate StructureFeature<C>featureprotected ChunkRandomrandomprivate intreferencesThe 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 voidgenerateStructure(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox box, ChunkPos chunkPos)BlockBoxgetBoundingBox()List<StructurePiece>getChildren()intgetChunkX()intgetChunkZ()StructureFeature<?>getFeature()BlockPosgetPos()protected intgetReferenceCountToBeInExistingChunk()intgetReferences()booleanhasChildren()voidincrementReferences()abstract voidinit(DynamicRegistryManager registryManager, ChunkGenerator chunkGenerator, StructureManager manager, int chunkX, int chunkZ, Biome biome, C config)booleanisInExistingChunk()protected voidrandomUpwardTranslation(int seaLevel, Random random, int minSeaLevelDistance)protected voidrandomUpwardTranslation(Random random, int minY, int maxY)protected voidsetBoundingBoxFromChildren()CompoundTagtoTag(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
-