Class Structure
java.lang.Object
net.minecraft.world.level.levelgen.structure.Structure
- Direct Known Subclasses:
BuriedTreasureStructure
,EndCityStructure
,IglooStructure
,JigsawStructure
,MineshaftStructure
,NetherFortressStructure
,NetherFossilStructure
,OceanMonumentStructure
,OceanRuinStructure
,RuinedPortalStructure
,ShipwreckStructure
,SinglePieceStructure
,StrongholdStructure
,SwampHutStructure
,WoodlandMansionStructure
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Structure> private final ModifiableStructureInfo
private final Structure.StructureSettings
Neo: Field accesses are redirected togetModifiedStructureSettings()
with a coremod. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustBoundingBox
(BoundingBox boundingBox) void
afterPlace
(WorldGenLevel level, StructureManager structureManager, ChunkGenerator chunkGenerator, RandomSource random, BoundingBox boundingBox, ChunkPos chunkPos, PiecesContainer pieces) biomes()
protected abstract Optional
<Structure.GenerationStub> generate
(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos chunkPos, int references, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) private static int[]
getCornerHeights
(Structure.GenerationContext context, int minX, int maxX, int minZ, int maxZ) protected static int
getLowestY
(Structure.GenerationContext context, int maxX, int maxZ) protected static int
getLowestY
(Structure.GenerationContext context, int minX, int minZ, int maxX, int maxZ) protected BlockPos
getLowestYIn5by5BoxOffset7Blocks
(Structure.GenerationContext context, Rotation rotation) Deprecated.static int
getMeanFirstOccupiedHeight
(Structure.GenerationContext context, int minX, int maxX, int minZ, int maxZ) Returns The structure's settings, with modifications if called after modifiers are applied in server init..private static boolean
isValidBiome
(Structure.GenerationStub stub, Structure.GenerationContext context) Returns Cache of original structure data and structure data modified by structure modifiers.protected static Optional
<Structure.GenerationStub> onTopOfChunkCenter
(Structure.GenerationContext context, Heightmap.Types heightmapTypes, Consumer<StructurePiecesBuilder> generator) static <S extends Structure>
com.mojang.serialization.codecs.RecordCodecBuilder<S, Structure.StructureSettings> settingsCodec
(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<S> instance) static <S extends Structure>
com.mojang.serialization.MapCodec<S> simpleCodec
(Function<Structure.StructureSettings, S> factory) step()
abstract StructureType
<?> type()
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
settings
Neo: Field accesses are redirected togetModifiedStructureSettings()
with a coremod. -
modifiableStructureInfo
-
-
Constructor Details
-
Structure
-
-
Method Details
-
settingsCodec
public static <S extends Structure> com.mojang.serialization.codecs.RecordCodecBuilder<S,Structure.StructureSettings> settingsCodec(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<S> instance) -
simpleCodec
public static <S extends Structure> com.mojang.serialization.MapCodec<S> simpleCodec(Function<Structure.StructureSettings, S> factory) -
biomes
-
spawnOverrides
-
step
-
terrainAdaptation
-
adjustBoundingBox
-
generate
public StructureStart generate(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos chunkPos, int references, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) -
onTopOfChunkCenter
protected static Optional<Structure.GenerationStub> onTopOfChunkCenter(Structure.GenerationContext context, Heightmap.Types heightmapTypes, Consumer<StructurePiecesBuilder> generator) -
isValidBiome
private static boolean isValidBiome(Structure.GenerationStub stub, Structure.GenerationContext context) -
afterPlace
public void afterPlace(WorldGenLevel level, StructureManager structureManager, ChunkGenerator chunkGenerator, RandomSource random, BoundingBox boundingBox, ChunkPos chunkPos, PiecesContainer pieces) -
getCornerHeights
private static int[] getCornerHeights(Structure.GenerationContext context, int minX, int maxX, int minZ, int maxZ) -
getMeanFirstOccupiedHeight
public static int getMeanFirstOccupiedHeight(Structure.GenerationContext context, int minX, int maxX, int minZ, int maxZ) -
getLowestY
-
getLowestY
protected static int getLowestY(Structure.GenerationContext context, int minX, int minZ, int maxX, int maxZ) -
getLowestYIn5by5BoxOffset7Blocks
@Deprecated protected BlockPos getLowestYIn5by5BoxOffset7Blocks(Structure.GenerationContext context, Rotation rotation) Deprecated. -
findGenerationPoint
protected abstract Optional<Structure.GenerationStub> findGenerationPoint(Structure.GenerationContext context) -
findValidGenerationPoint
public Optional<Structure.GenerationStub> findValidGenerationPoint(Structure.GenerationContext context) -
type
-
modifiableStructureInfo
Returns Cache of original structure data and structure data modified by structure modifiers. Modified structure data is set by server after datapacks and serverconfigs load. Settings field reads are coremodded to redirect to this.- Returns:
- Cache of original structure data and structure data modified by structure modifiers
-
getModifiedStructureSettings
Returns The structure's settings, with modifications if called after modifiers are applied in server init..- Returns:
- The structure's settings, with modifications if called after modifiers are applied in server init.
-