Class StructurePiece
java.lang.Object
net.minecraft.world.level.levelgen.structure.StructurePiece
- Direct Known Subclasses:
BuriedTreasurePieces.BuriedTreasurePiece, MineshaftPieces.MineShaftPiece, NetherFortressPieces.NetherBridgePiece, OceanMonumentPieces.OceanMonumentPiece, PoolElementStructurePiece, ScatteredFeaturePiece, StrongholdPieces.StrongholdPiece, TemplateStructurePiece
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BoundingBoxprotected static final BlockStateprotected intprivate Mirrorprivate @Nullable Directionprivate Rotationprivate final StructurePieceType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStructurePiece(StructurePieceType type, int genDepth, BoundingBox boundingBox) StructurePiece(StructurePieceType type, CompoundTag tag) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidvoidaddChildren(StructurePiece startPiece, StructurePieceAccessor structurePieceAccessor, RandomSource random) protected booleancanBeReplaced(LevelReader level, int x, int y, int z, BoundingBox chunkBB) static BoundingBoxcreateBoundingBox(Stream<StructurePiece> pieces) protected booleancreateChest(ServerLevelAccessor level, BoundingBox chunkBB, RandomSource random, BlockPos pos, ResourceKey<LootTable> lootTable, @Nullable BlockState blockState) protected booleancreateChest(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, int x, int y, int z, ResourceKey<LootTable> lootTable) protected booleancreateDispenser(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, int x, int y, int z, Direction facing, ResourceKey<LootTable> lootTable) final CompoundTagprotected voidfillColumnDown(WorldGenLevel level, BlockState blockState, int x, int startY, int z, BoundingBox chunkBB) static @Nullable StructurePiecefindCollisionPiece(List<StructurePiece> pieces, BoundingBox box) protected voidgenerateAirBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1) protected voidgenerateBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, boolean skipAir, RandomSource random, StructurePiece.BlockSelector selector) protected voidgenerateBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, BlockState edgeBlock, BlockState fillBlock, boolean skipAir) Fill the given area with the selected blocksprotected voidgenerateBox(WorldGenLevel level, BoundingBox chunkBB, BoundingBox boxBB, boolean skipAir, RandomSource random, StructurePiece.BlockSelector selector) protected voidgenerateBox(WorldGenLevel level, BoundingBox chunkBB, BoundingBox boxBB, BlockState edgeBlock, BlockState fillBlock, boolean skipAir) protected voidgenerateMaybeBox(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, float probability, int x0, int y0, int z0, int x1, int y1, int z1, BlockState edgeBlock, BlockState fillBlock, boolean skipAir, boolean hasToBeInside) protected voidgenerateUpperHalfSphere(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, BlockState fillBlock, boolean skipAir) protected BlockStategetBlock(BlockGetter level, int x, int y, int z, BoundingBox chunkBB) int@Nullable Directionprotected static DirectiongetType()protected BlockPos.MutableBlockPosgetWorldPos(int x, int y, int z) protected intgetWorldX(int x, int z) protected intgetWorldY(int y) protected intgetWorldZ(int x, int z) booleanisCloseToChunk(ChunkPos pos, int distance) protected booleanisInterior(LevelReader level, int x, int y, int z, BoundingBox chunkBB) protected booleanprotected static BoundingBoxmakeBoundingBox(int x, int y, int z, Direction direction, int width, int height, int depth) protected voidmaybeGenerateBlock(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, float probability, int x, int y, int z, BlockState blockState) voidmove(int dx, int dy, int dz) protected voidplaceBlock(WorldGenLevel level, BlockState blockState, int x, int y, int z, BoundingBox chunkBB) abstract voidpostProcess(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox chunkBB, ChunkPos chunkPos, BlockPos referencePos) static BlockStatereorient(BlockGetter level, BlockPos blockPos, BlockState blockState) voidsetGenDepth(int genDepth) voidsetOrientation(@Nullable Direction orientation)
-
Field Details
-
CAVE_AIR
-
boundingBox
-
orientation
-
mirror
-
rotation
-
genDepth
protected int genDepth -
type
-
SHAPE_CHECK_BLOCKS
-
-
Constructor Details
-
StructurePiece
-
StructurePiece
-
-
Method Details
-
makeBoundingBox
protected static BoundingBox makeBoundingBox(int x, int y, int z, Direction direction, int width, int height, int depth) -
getRandomHorizontalDirection
-
createTag
-
addAdditionalSaveData
protected abstract void addAdditionalSaveData(StructurePieceSerializationContext context, CompoundTag tag) -
addChildren
public void addChildren(StructurePiece startPiece, StructurePieceAccessor structurePieceAccessor, RandomSource random) -
postProcess
public abstract void postProcess(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox chunkBB, ChunkPos chunkPos, BlockPos referencePos) -
getBoundingBox
-
getGenDepth
public int getGenDepth() -
setGenDepth
public void setGenDepth(int genDepth) -
isCloseToChunk
-
getLocatorPosition
-
getWorldPos
-
getWorldX
protected int getWorldX(int x, int z) -
getWorldY
protected int getWorldY(int y) -
getWorldZ
protected int getWorldZ(int x, int z) -
placeBlock
protected void placeBlock(WorldGenLevel level, BlockState blockState, int x, int y, int z, BoundingBox chunkBB) -
canBeReplaced
-
getBlock
-
isInterior
-
generateAirBox
protected void generateAirBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, BlockState edgeBlock, BlockState fillBlock, boolean skipAir) Fill the given area with the selected blocks -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox chunkBB, BoundingBox boxBB, BlockState edgeBlock, BlockState fillBlock, boolean skipAir) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, boolean skipAir, RandomSource random, StructurePiece.BlockSelector selector) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox chunkBB, BoundingBox boxBB, boolean skipAir, RandomSource random, StructurePiece.BlockSelector selector) -
generateMaybeBox
protected void generateMaybeBox(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, float probability, int x0, int y0, int z0, int x1, int y1, int z1, BlockState edgeBlock, BlockState fillBlock, boolean skipAir, boolean hasToBeInside) -
maybeGenerateBlock
protected void maybeGenerateBlock(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, float probability, int x, int y, int z, BlockState blockState) -
generateUpperHalfSphere
protected void generateUpperHalfSphere(WorldGenLevel level, BoundingBox chunkBB, int x0, int y0, int z0, int x1, int y1, int z1, BlockState fillBlock, boolean skipAir) -
fillColumnDown
protected void fillColumnDown(WorldGenLevel level, BlockState blockState, int x, int startY, int z, BoundingBox chunkBB) -
isReplaceableByStructures
-
createChest
protected boolean createChest(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, int x, int y, int z, ResourceKey<LootTable> lootTable) -
reorient
-
createChest
protected boolean createChest(ServerLevelAccessor level, BoundingBox chunkBB, RandomSource random, BlockPos pos, ResourceKey<LootTable> lootTable, @Nullable BlockState blockState) -
createDispenser
protected boolean createDispenser(WorldGenLevel level, BoundingBox chunkBB, RandomSource random, int x, int y, int z, Direction facing, ResourceKey<LootTable> lootTable) -
move
public void move(int dx, int dy, int dz) -
createBoundingBox
-
findCollisionPiece
public static @Nullable StructurePiece findCollisionPiece(List<StructurePiece> pieces, BoundingBox box) -
getOrientation
-
setOrientation
-
getRotation
-
getMirror
-
getType
-