Package net.minecraft.structure
Class StructurePiece
java.lang.Object
net.minecraft.structure.StructurePiece
- Direct Known Subclasses:
BuriedTreasureGenerator.Piece,MineshaftGenerator.MineshaftPart,NetherFortressGenerator.Piece,OceanMonumentGenerator.Piece,PoolStructurePiece,SimpleStructurePiece,StrongholdGenerator.Piece,StructurePieceWithDimensions
public abstract class StructurePiece extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStructurePiece.BlockRandomizer -
Field Summary
Fields Modifier and Type Field Description protected static BlockStateAIRprivate static Set<Block>BLOCKS_NEEDING_POST_PROCESSINGprotected BlockBoxboundingBoxprotected intchainLengthprivate Directionfacingprivate BlockMirrormirrorprivate BlockRotationrotationprivate StructurePieceTypetype -
Constructor Summary
Constructors Modifier Constructor Description protectedStructurePiece(StructurePieceType type, int length)StructurePiece(StructurePieceType type, NbtCompound nbt) -
Method Summary
Modifier and Type Method Description protected voidaddBlock(StructureWorldAccess world, BlockState block, int x, int int2, int int3, BlockBox box)protected voidaddBlockWithRandomThreshold(StructureWorldAccess world, BlockBox bounds, Random random, float threshold, int x, int y, int z, BlockState state)protected booleanaddChest(ServerWorldAccess world, BlockBox boundingBox, Random random, BlockPos pos, Identifier lootTableId, BlockState block)protected booleanaddChest(StructureWorldAccess world, BlockBox boundingBox, Random random, int x, int y, int z, Identifier lootTableId)protected booleanaddDispenser(StructureWorldAccess world, BlockBox boundingBox, Random random, int x, int y, int z, Direction facing, Identifier lootTableId)protected intapplyXTransform(int x, int z)protected intapplyYTransform(int y)protected intapplyZTransform(int x, int z)protected voidfill(StructureWorldAccess world, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)protected voidfillDownwards(StructureWorldAccess world, BlockState state, int x, int int2, int int3, BlockBox box)protected voidfillHalfEllipsoid(StructureWorldAccess world, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState block, boolean cantReplaceAir)voidfillOpenings(StructurePiece start, List<StructurePiece> pieces, Random random)protected voidfillWithOutline(StructureWorldAccess world, BlockBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean cantReplaceAir, Random random, StructurePiece.BlockRandomizer randomizer)protected voidfillWithOutline(StructureWorldAccess world, BlockBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir)protected voidfillWithOutlineUnderSeaLevel(StructureWorldAccess world, BlockBox box, Random random, float blockChance, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir, boolean stayBelowSeaLevel)abstract booleangenerate(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos pos)protected BlockStategetBlockAt(BlockView world, int x, int int2, int int3, BlockBox box)BlockBoxgetBoundingBox()intgetChainLength()DirectiongetFacing()static StructurePiecegetOverlappingPiece(List<StructurePiece> pieces, BlockBox blockBox)BlockRotationgetRotation()NbtCompoundgetTag()StructurePieceTypegetType()booleanintersectsChunk(ChunkPos pos, int offset)protected booleanisTouchingLiquid(BlockView blockView, BlockBox blockBox)protected booleanisUnderSeaLevel(WorldView world, int x, int z, int y, BlockBox box)static BlockStateorientateChest(BlockView world, BlockPos pos, BlockState state)voidsetOrientation(Direction orientation)protected abstract voidtoNbt(NbtCompound tag)voidtranslate(int x, int y, int z)
-
Field Details
-
AIR
-
BLOCKS_NEEDING_POST_PROCESSING
-
boundingBox
-
facing
-
mirror
-
rotation
-
chainLength
protected int chainLength -
type
-
-
Constructor Details
-
StructurePiece
-
StructurePiece
-
-
Method Details
-
getTag
-
toNbt
-
fillOpenings
-
generate
public abstract boolean generate(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos pos) -
getBoundingBox
-
getChainLength
public int getChainLength() -
intersectsChunk
-
getOverlappingPiece
-
isTouchingLiquid
-
applyXTransform
protected int applyXTransform(int x, int z) -
applyYTransform
protected int applyYTransform(int y) -
applyZTransform
protected int applyZTransform(int x, int z) -
addBlock
protected void addBlock(StructureWorldAccess world, BlockState block, int x, int int2, int int3, BlockBox box) -
getBlockAt
-
isUnderSeaLevel
-
fill
protected void fill(StructureWorldAccess world, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
fillWithOutline
protected void fillWithOutline(StructureWorldAccess world, BlockBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir) -
fillWithOutline
protected void fillWithOutline(StructureWorldAccess world, BlockBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean cantReplaceAir, Random random, StructurePiece.BlockRandomizer randomizer) -
fillWithOutlineUnderSeaLevel
protected void fillWithOutlineUnderSeaLevel(StructureWorldAccess world, BlockBox box, Random random, float blockChance, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir, boolean stayBelowSeaLevel) -
addBlockWithRandomThreshold
protected void addBlockWithRandomThreshold(StructureWorldAccess world, BlockBox bounds, Random random, float threshold, int x, int y, int z, BlockState state) -
fillHalfEllipsoid
protected void fillHalfEllipsoid(StructureWorldAccess world, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState block, boolean cantReplaceAir) -
fillDownwards
protected void fillDownwards(StructureWorldAccess world, BlockState state, int x, int int2, int int3, BlockBox box) -
addChest
protected boolean addChest(StructureWorldAccess world, BlockBox boundingBox, Random random, int x, int y, int z, Identifier lootTableId) -
orientateChest
-
addChest
protected boolean addChest(ServerWorldAccess world, BlockBox boundingBox, Random random, BlockPos pos, Identifier lootTableId, @Nullable BlockState block) -
addDispenser
protected boolean addDispenser(StructureWorldAccess world, BlockBox boundingBox, Random random, int x, int y, int z, Direction facing, Identifier lootTableId) -
translate
public void translate(int x, int y, int z) -
getFacing
-
setOrientation
-
getRotation
-
getType
-