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