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 Directionprivate Rotationprivate final StructurePieceType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStructurePiece(StructurePieceType pType, int pGenDepth, BoundingBox pBoundingBox) StructurePiece(StructurePieceType pType, CompoundTag pTag) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddAdditionalSaveData(StructurePieceSerializationContext pContext, CompoundTag pTag) voidaddChildren(StructurePiece pPiece, StructurePieceAccessor pPieces, RandomSource pRandom) protected booleancanBeReplaced(LevelReader pLevel, int pX, int pY, int pZ, BoundingBox pBox) static BoundingBoxcreateBoundingBox(Stream<StructurePiece> pPieces) protected booleancreateChest(ServerLevelAccessor pLevel, BoundingBox pBox, RandomSource pRandom, BlockPos pPos, ResourceKey<LootTable> pLootTable, BlockState pState) protected booleancreateChest(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, int pX, int pY, int pZ, ResourceKey<LootTable> pLootTable) protected booleancreateDispenser(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, int pX, int pY, int pZ, Direction pFacing, ResourceKey<LootTable> pLootTable) final CompoundTagcreateTag(StructurePieceSerializationContext pContext) protected voidfillColumnDown(WorldGenLevel pLevel, BlockState pState, int pX, int pY, int pZ, BoundingBox pBox) static StructurePiecefindCollisionPiece(List<StructurePiece> pPieces, BoundingBox pBoundingBox) protected voidgenerateAirBox(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ) protected voidgenerateBox(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ, boolean pAlwaysReplace, RandomSource pRandom, StructurePiece.BlockSelector pBlockSelector) protected voidgenerateBox(WorldGenLevel pLevel, BoundingBox pBox, int pXMin, int pYMin, int pZMin, int pXMax, int pYMax, int pZMax, BlockState pBoundaryBlockState, BlockState pInsideBlockState, boolean pExistingOnly) Fill the given area with the selected blocksprotected voidgenerateBox(WorldGenLevel pLevel, BoundingBox pBoundingBox, BoundingBox pBox, boolean pAlwaysReplace, RandomSource pRandom, StructurePiece.BlockSelector pBlockSelector) protected voidgenerateBox(WorldGenLevel pLevel, BoundingBox pBoundingBox, BoundingBox pBox, BlockState pBoundaryBlockState, BlockState pInsideBlockState, boolean pExistingOnly) protected voidgenerateMaybeBox(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, float pChance, int pX1, int pY1, int pZ1, int pX2, int pY2, int pZ2, BlockState pEdgeState, BlockState pState, boolean pRequireNonAir, boolean pRequireSkylight) protected voidgenerateUpperHalfSphere(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ, BlockState pState, boolean pExcludeAir) protected BlockStategetBlock(BlockGetter pLevel, int pX, int pY, int pZ, BoundingBox pBox) intprotected static DirectiongetRandomHorizontalDirection(RandomSource pRandom) getType()protected BlockPos.MutableBlockPosgetWorldPos(int pX, int pY, int pZ) protected intgetWorldX(int pX, int pZ) protected intgetWorldY(int pY) protected intgetWorldZ(int pX, int pZ) booleanisCloseToChunk(ChunkPos pChunkPos, int pDistance) protected booleanisInterior(LevelReader pLevel, int pX, int pY, int pZ, BoundingBox pBox) protected booleanisReplaceableByStructures(BlockState pState) protected static BoundingBoxmakeBoundingBox(int pX, int pY, int pZ, Direction pDirection, int pOffsetX, int pOffsetY, int pOffsetZ) protected voidmaybeGenerateBlock(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, float pChance, int pX, int pY, int pZ, BlockState pState) voidmove(int pX, int pY, int pZ) protected voidplaceBlock(WorldGenLevel pLevel, BlockState pBlockstate, int pX, int pY, int pZ, BoundingBox pBoundingbox) abstract voidpostProcess(WorldGenLevel pLevel, StructureManager pStructureManager, ChunkGenerator pGenerator, RandomSource pRandom, BoundingBox pBox, ChunkPos pChunkPos, BlockPos pPos) static BlockStatereorient(BlockGetter pLevel, BlockPos pPos, BlockState pState) voidsetGenDepth(int pGenDepth) voidsetOrientation(Direction pOrientation)
-
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 pX, int pY, int pZ, Direction pDirection, int pOffsetX, int pOffsetY, int pOffsetZ) -
getRandomHorizontalDirection
-
createTag
-
addAdditionalSaveData
protected abstract void addAdditionalSaveData(StructurePieceSerializationContext pContext, CompoundTag pTag) -
addChildren
public void addChildren(StructurePiece pPiece, StructurePieceAccessor pPieces, RandomSource pRandom) -
postProcess
public abstract void postProcess(WorldGenLevel pLevel, StructureManager pStructureManager, ChunkGenerator pGenerator, RandomSource pRandom, BoundingBox pBox, ChunkPos pChunkPos, BlockPos pPos) -
getBoundingBox
-
getGenDepth
public int getGenDepth() -
setGenDepth
public void setGenDepth(int pGenDepth) -
isCloseToChunk
-
getLocatorPosition
-
getWorldPos
-
getWorldX
protected int getWorldX(int pX, int pZ) -
getWorldY
protected int getWorldY(int pY) -
getWorldZ
protected int getWorldZ(int pX, int pZ) -
placeBlock
protected void placeBlock(WorldGenLevel pLevel, BlockState pBlockstate, int pX, int pY, int pZ, BoundingBox pBoundingbox) -
canBeReplaced
-
getBlock
-
isInterior
-
generateAirBox
protected void generateAirBox(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ) -
generateBox
protected void generateBox(WorldGenLevel pLevel, BoundingBox pBox, int pXMin, int pYMin, int pZMin, int pXMax, int pYMax, int pZMax, BlockState pBoundaryBlockState, BlockState pInsideBlockState, boolean pExistingOnly) Fill the given area with the selected blocks -
generateBox
protected void generateBox(WorldGenLevel pLevel, BoundingBox pBoundingBox, BoundingBox pBox, BlockState pBoundaryBlockState, BlockState pInsideBlockState, boolean pExistingOnly) -
generateBox
protected void generateBox(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ, boolean pAlwaysReplace, RandomSource pRandom, StructurePiece.BlockSelector pBlockSelector) -
generateBox
protected void generateBox(WorldGenLevel pLevel, BoundingBox pBoundingBox, BoundingBox pBox, boolean pAlwaysReplace, RandomSource pRandom, StructurePiece.BlockSelector pBlockSelector) -
generateMaybeBox
protected void generateMaybeBox(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, float pChance, int pX1, int pY1, int pZ1, int pX2, int pY2, int pZ2, BlockState pEdgeState, BlockState pState, boolean pRequireNonAir, boolean pRequireSkylight) -
maybeGenerateBlock
protected void maybeGenerateBlock(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, float pChance, int pX, int pY, int pZ, BlockState pState) -
generateUpperHalfSphere
protected void generateUpperHalfSphere(WorldGenLevel pLevel, BoundingBox pBox, int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ, BlockState pState, boolean pExcludeAir) -
fillColumnDown
protected void fillColumnDown(WorldGenLevel pLevel, BlockState pState, int pX, int pY, int pZ, BoundingBox pBox) -
isReplaceableByStructures
-
createChest
protected boolean createChest(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, int pX, int pY, int pZ, ResourceKey<LootTable> pLootTable) -
reorient
-
createChest
protected boolean createChest(ServerLevelAccessor pLevel, BoundingBox pBox, RandomSource pRandom, BlockPos pPos, ResourceKey<LootTable> pLootTable, @Nullable BlockState pState) -
createDispenser
protected boolean createDispenser(WorldGenLevel pLevel, BoundingBox pBox, RandomSource pRandom, int pX, int pY, int pZ, Direction pFacing, ResourceKey<LootTable> pLootTable) -
move
public void move(int pX, int pY, int pZ) -
createBoundingBox
-
findCollisionPiece
@Nullable public static StructurePiece findCollisionPiece(List<StructurePiece> pPieces, BoundingBox pBoundingBox) -
getOrientation
-
setOrientation
-
getRotation
-
getMirror
-
getType
-