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 static final org.slf4j.Loggerprivate Mirrorprivate 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 piece, StructurePieceAccessor pieces, RandomSource random) protected booleancanBeReplaced(LevelReader level, int x, int y, int z, BoundingBox box) static BoundingBoxcreateBoundingBox(Stream<StructurePiece> pieces) protected booleancreateChest(ServerLevelAccessor level, BoundingBox box, RandomSource random, BlockPos pos, ResourceKey<LootTable> lootTable, BlockState state) protected booleancreateChest(WorldGenLevel level, BoundingBox box, RandomSource random, int x, int y, int z, ResourceKey<LootTable> lootTable) protected booleancreateDispenser(WorldGenLevel level, BoundingBox box, RandomSource random, int x, int y, int z, Direction facing, ResourceKey<LootTable> lootTable) final CompoundTagprotected voidfillColumnDown(WorldGenLevel level, BlockState state, int x, int y, int z, BoundingBox box) static StructurePiecefindCollisionPiece(List<StructurePiece> pieces, BoundingBox boundingBox) protected voidgenerateAirBox(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) protected voidgenerateBox(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, RandomSource random, StructurePiece.BlockSelector blockSelector) protected voidgenerateBox(WorldGenLevel level, BoundingBox box, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, BlockState boundaryBlockState, BlockState insideBlockState, boolean existingOnly) Fill the given area with the selected blocksprotected voidgenerateBox(WorldGenLevel level, BoundingBox boundingBox, BoundingBox box, boolean alwaysReplace, RandomSource random, StructurePiece.BlockSelector blockSelector) protected voidgenerateBox(WorldGenLevel level, BoundingBox boundingBox, BoundingBox box, BlockState boundaryBlockState, BlockState insideBlockState, boolean existingOnly) protected voidgenerateMaybeBox(WorldGenLevel level, BoundingBox box, RandomSource random, float chance, int x1, int y1, int z1, int x2, int y2, int z2, BlockState edgeState, BlockState state, boolean requireNonAir, boolean requireSkylight) protected voidgenerateUpperHalfSphere(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState state, boolean excludeAir) protected BlockStategetBlock(BlockGetter level, int x, int y, int z, BoundingBox box) intprotected 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 chunkPos, int distance) protected booleanisInterior(LevelReader level, int x, int y, int z, BoundingBox box) protected booleanprotected static BoundingBoxmakeBoundingBox(int x, int y, int z, Direction direction, int offsetX, int offsetY, int offsetZ) protected voidmaybeGenerateBlock(WorldGenLevel level, BoundingBox box, RandomSource random, float chance, int x, int y, int z, BlockState state) voidmove(int x, int y, int z) protected voidplaceBlock(WorldGenLevel level, BlockState blockstate, int x, int y, int z, BoundingBox boundingbox) abstract voidpostProcess(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox box, ChunkPos chunkPos, BlockPos pos) static BlockStatereorient(BlockGetter level, BlockPos pos, BlockState state) voidsetGenDepth(int genDepth) voidsetOrientation(Direction orientation)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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 offsetX, int offsetY, int offsetZ) -
getRandomHorizontalDirection
-
createTag
-
addAdditionalSaveData
protected abstract void addAdditionalSaveData(StructurePieceSerializationContext context, CompoundTag tag) -
addChildren
-
postProcess
public abstract void postProcess(WorldGenLevel level, StructureManager structureManager, ChunkGenerator generator, RandomSource random, BoundingBox box, ChunkPos chunkPos, BlockPos pos) -
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 boundingbox) -
canBeReplaced
-
getBlock
-
isInterior
-
generateAirBox
protected void generateAirBox(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox box, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, BlockState boundaryBlockState, BlockState insideBlockState, boolean existingOnly) Fill the given area with the selected blocks -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox boundingBox, BoundingBox box, BlockState boundaryBlockState, BlockState insideBlockState, boolean existingOnly) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, RandomSource random, StructurePiece.BlockSelector blockSelector) -
generateBox
protected void generateBox(WorldGenLevel level, BoundingBox boundingBox, BoundingBox box, boolean alwaysReplace, RandomSource random, StructurePiece.BlockSelector blockSelector) -
generateMaybeBox
protected void generateMaybeBox(WorldGenLevel level, BoundingBox box, RandomSource random, float chance, int x1, int y1, int z1, int x2, int y2, int z2, BlockState edgeState, BlockState state, boolean requireNonAir, boolean requireSkylight) -
maybeGenerateBlock
protected void maybeGenerateBlock(WorldGenLevel level, BoundingBox box, RandomSource random, float chance, int x, int y, int z, BlockState state) -
generateUpperHalfSphere
protected void generateUpperHalfSphere(WorldGenLevel level, BoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState state, boolean excludeAir) -
fillColumnDown
protected void fillColumnDown(WorldGenLevel level, BlockState state, int x, int y, int z, BoundingBox box) -
isReplaceableByStructures
-
createChest
protected boolean createChest(WorldGenLevel level, BoundingBox box, RandomSource random, int x, int y, int z, ResourceKey<LootTable> lootTable) -
reorient
-
createChest
protected boolean createChest(ServerLevelAccessor level, BoundingBox box, RandomSource random, BlockPos pos, ResourceKey<LootTable> lootTable, @Nullable BlockState state) -
createDispenser
protected boolean createDispenser(WorldGenLevel level, BoundingBox box, RandomSource random, int x, int y, int z, Direction facing, ResourceKey<LootTable> lootTable) -
move
public void move(int x, int y, int z) -
createBoundingBox
-
findCollisionPiece
@Nullable public static StructurePiece findCollisionPiece(List<StructurePiece> pieces, BoundingBox boundingBox) -
getOrientation
-
setOrientation
-
getRotation
-
getMirror
-
getType
-