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 class
StructurePiece.BlockRandomizer
-
Field Summary
Fields Modifier and Type Field Description protected static BlockState
AIR
private static Set<Block>
BLOCKS_NEEDING_POST_PROCESSING
protected BlockBox
boundingBox
protected int
chainLength
private Direction
facing
private BlockMirror
mirror
private BlockRotation
rotation
private StructurePieceType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
StructurePiece(StructurePieceType type, int length)
StructurePiece(StructurePieceType type, CompoundTag tag)
-
Method Summary
Modifier and Type Method Description protected void
addBlock(StructureWorldAccess structureWorldAccess, BlockState block, int x, int y, int z, BlockBox blockBox)
protected void
addBlockWithRandomThreshold(StructureWorldAccess structureWorldAccess, BlockBox bounds, Random random, float threshold, int x, int y, int z, BlockState blockState)
protected boolean
addChest(ServerWorldAccess serverWorldAccess, BlockBox boundingBox, Random random, BlockPos pos, Identifier lootTableId, BlockState block)
protected boolean
addChest(StructureWorldAccess structureWorldAccess, BlockBox boundingBox, Random random, int x, int y, int z, Identifier lootTableId)
protected boolean
addDispenser(StructureWorldAccess structureWorldAccess, BlockBox boundingBox, Random random, int x, int y, int z, Direction facing, Identifier lootTableId)
protected int
applyXTransform(int x, int z)
protected int
applyYTransform(int y)
protected int
applyZTransform(int x, int z)
protected void
fill(StructureWorldAccess structureWorldAccess, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
protected void
fillDownwards(StructureWorldAccess structureWorldAccess, BlockState blockState, int x, int y, int z, BlockBox blockBox)
protected void
fillHalfEllipsoid(StructureWorldAccess structureWorldAccess, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState block, boolean cantReplaceAir)
void
fillOpenings(StructurePiece start, List<StructurePiece> pieces, Random random)
protected void
fillWithOutline(StructureWorldAccess structureWorldAccess, BlockBox blockBox, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean cantReplaceAir, Random random, StructurePiece.BlockRandomizer blockRandomizer)
protected void
fillWithOutline(StructureWorldAccess structureWorldAccess, BlockBox blockBox, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir)
protected void
fillWithOutlineUnderSeaLevel(StructureWorldAccess structureWorldAccess, BlockBox blockBox, 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 boolean
generate(StructureWorldAccess structureWorldAccess, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos blockPos)
protected BlockState
getBlockAt(BlockView blockView, int x, int y, int z, BlockBox blockBox)
BlockBox
getBoundingBox()
int
getChainLength()
Direction
getFacing()
static StructurePiece
getOverlappingPiece(List<StructurePiece> pieces, BlockBox blockBox)
BlockRotation
getRotation()
CompoundTag
getTag()
StructurePieceType
getType()
boolean
intersectsChunk(ChunkPos chunkPos, int offset)
protected boolean
isTouchingLiquid(BlockView blockView, BlockBox blockBox)
protected boolean
isUnderSeaLevel(WorldView worldView, int x, int z, int y, BlockBox blockBox)
static BlockState
orientateChest(BlockView blockView, BlockPos blockPos, BlockState blockState)
void
setOrientation(Direction orientation)
protected abstract void
toNbt(CompoundTag tag)
void
translate(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 structureWorldAccess, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos blockPos) -
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 structureWorldAccess, BlockState block, int x, int y, int z, BlockBox blockBox) -
getBlockAt
-
isUnderSeaLevel
-
fill
protected void fill(StructureWorldAccess structureWorldAccess, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
fillWithOutline
protected void fillWithOutline(StructureWorldAccess structureWorldAccess, BlockBox blockBox, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState outline, BlockState inside, boolean cantReplaceAir) -
fillWithOutline
protected void fillWithOutline(StructureWorldAccess structureWorldAccess, BlockBox blockBox, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean cantReplaceAir, Random random, StructurePiece.BlockRandomizer blockRandomizer) -
fillWithOutlineUnderSeaLevel
protected void fillWithOutlineUnderSeaLevel(StructureWorldAccess structureWorldAccess, BlockBox blockBox, 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 structureWorldAccess, BlockBox bounds, Random random, float threshold, int x, int y, int z, BlockState blockState) -
fillHalfEllipsoid
protected void fillHalfEllipsoid(StructureWorldAccess structureWorldAccess, BlockBox bounds, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, BlockState block, boolean cantReplaceAir) -
fillDownwards
protected void fillDownwards(StructureWorldAccess structureWorldAccess, BlockState blockState, int x, int y, int z, BlockBox blockBox) -
addChest
protected boolean addChest(StructureWorldAccess structureWorldAccess, BlockBox boundingBox, Random random, int x, int y, int z, Identifier lootTableId) -
orientateChest
public static BlockState orientateChest(BlockView blockView, BlockPos blockPos, BlockState blockState) -
addChest
protected boolean addChest(ServerWorldAccess serverWorldAccess, BlockBox boundingBox, Random random, BlockPos pos, Identifier lootTableId, @Nullable BlockState block) -
addDispenser
protected boolean addDispenser(StructureWorldAccess structureWorldAccess, 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
-