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 Details

    • DEFAULT

      public static final StructureStart<?> DEFAULT
    • feature

      private final StructureFeature<C extends FeatureConfig> feature
    • children

      protected final List<StructurePiece> children
    • boundingBox

      protected BlockBox boundingBox
    • chunkX

      private final int chunkX
    • chunkZ

      private final int chunkZ
    • references

      private int references
      The 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

      protected final ChunkRandom 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

      public BlockBox getBoundingBox()
    • getChildren

      public List<StructurePiece> getChildren()
    • generateStructure

      public void generateStructure​(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox box, ChunkPos chunkPos)
    • setBoundingBoxFromChildren

      protected void setBoundingBoxFromChildren()
    • toTag

      public CompoundTag toTag​(int chunkX, int chunkZ)
    • randomUpwardTranslation

      protected void randomUpwardTranslation​(int seaLevel, Random random, int minSeaLevelDistance)
    • randomUpwardTranslation

      protected void randomUpwardTranslation​(Random random, int minY, int maxY)
    • hasChildren

      public boolean hasChildren()
    • getChunkX

      public int getChunkX()
    • getChunkZ

      public int getChunkZ()
    • getPos

      public BlockPos getPos()
    • isInExistingChunk

      public boolean isInExistingChunk()
    • incrementReferences

      public void incrementReferences()
    • getReferences

      public int getReferences()
    • getReferenceCountToBeInExistingChunk

      protected int getReferenceCountToBeInExistingChunk()
    • getFeature

      public StructureFeature<?> getFeature()