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 recordstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ModifiableStructureInfoprivate final Structure.StructureSettingsNeo: Field accesses are redirected togetModifiedStructureSettings()with a coremod. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustBoundingBox(BoundingBox boundingBox) voidafterPlace(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox chunkBB, ChunkPos chunkPos, PiecesContainer pieces) biomes()protected abstract Optional<Structure.GenerationStub> generate(Holder<Structure> selected, ResourceKey<Level> dimension, RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos sourceChunkPos, int references, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) private static int[]getCornerHeights(Structure.GenerationContext context, int minX, int sizeX, int minZ, int sizeZ) protected static intgetLowestY(Structure.GenerationContext context, int sizeX, int sizeZ) protected static intgetLowestY(Structure.GenerationContext context, int minX, int minZ, int sizeX, int sizeZ) protected BlockPosgetLowestYIn5by5BoxOffset7Blocks(Structure.GenerationContext context, Rotation rotation) Deprecated.static intgetMeanFirstOccupiedHeight(Structure.GenerationContext context, int minX, int sizeX, int minZ, int sizeZ) Returns The structure's settings, with modifications if called after modifiers are applied in server init..private static booleanisValidBiome(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 heightmap, Consumer<StructurePiecesBuilder> generator) static <S extends Structure>
RecordCodecBuilder<S, Structure.StructureSettings> simpleCodec(Function<Structure.StructureSettings, S> constructor) 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> RecordCodecBuilder<S, Structure.StructureSettings> settingsCodec(RecordCodecBuilder.Instance<S> i) -
simpleCodec
public static <S extends Structure> MapCodec<S> simpleCodec(Function<Structure.StructureSettings, S> constructor) -
biomes
-
spawnOverrides
-
step
-
terrainAdaptation
-
adjustBoundingBox
-
generate
public StructureStart generate(Holder<Structure> selected, ResourceKey<Level> dimension, RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos sourceChunkPos, int references, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) -
onTopOfChunkCenter
protected static Optional<Structure.GenerationStub> onTopOfChunkCenter(Structure.GenerationContext context, Heightmap.Types heightmap, Consumer<StructurePiecesBuilder> generator) -
isValidBiome
private static boolean isValidBiome(Structure.GenerationStub stub, Structure.GenerationContext context) -
afterPlace
public void afterPlace(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox chunkBB, ChunkPos chunkPos, PiecesContainer pieces) -
getCornerHeights
private static int[] getCornerHeights(Structure.GenerationContext context, int minX, int sizeX, int minZ, int sizeZ) -
getMeanFirstOccupiedHeight
public static int getMeanFirstOccupiedHeight(Structure.GenerationContext context, int minX, int sizeX, int minZ, int sizeZ) -
getLowestY
-
getLowestY
protected static int getLowestY(Structure.GenerationContext context, int minX, int minZ, int sizeX, int sizeZ) -
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.
-