Class ScatteredStructureBuilder
java.lang.Object
cn.nukkit.level.generator.populator.impl.structure.utils.structure.ScatteredStructureBuilder
-
Constructor Summary
ConstructorDescriptionScatteredStructureBuilder
(ChunkManager level, ScatteredStructurePiece structure) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRandomBlock
(Map<Integer, Integer> blocks, int weight, int id) void
addRandomBlock
(Map<Integer, Integer> blocks, int weight, int id, int meta) void
fill
(BlockVector3 min, BlockVector3 max, int id) Fills a box with the given block.void
fill
(BlockVector3 min, BlockVector3 max, int id, int meta) Fills a box with the given block.void
fill
(BlockVector3 min, BlockVector3 max, int outerId, int outerMeta, int innerId, int innerMeta) Builds a box from one block, and fills it with another.void
fillWithRandomBlock
(BlockVector3 min, BlockVector3 max, NukkitRandom random, Map<Integer, Integer> blocks) Sets a box of blocks to have random types, chosen independently.int
getRandomBlock
(NukkitRandom random, Map<Integer, Integer> blocks) Chooses a random block from a weighted list.void
setBlock
(BlockVector3 pos, int id) Sets the block at a given point.void
setBlock
(BlockVector3 pos, int id, int meta) Sets the block at a given point.void
setBlockDownward
(BlockVector3 pos, int id) Builds a 1x1 column out of the given block, replacing non-solid blocks starting at a given location and proceeding downward until a solid block is reached.void
setBlockDownward
(BlockVector3 pos, int id, int meta) Builds a 1x1 column out of the given block, replacing non-solid blocks starting at a given location and proceeding downward until a solid block is reached.void
setBlockWithRandomBlock
(BlockVector3 pos, NukkitRandom random, Map<Integer, Integer> blocks) void
setTile
(BlockVector3 pos, String id) Sets the block entity at a given point.void
setTile
(BlockVector3 pos, String id, CompoundTag data) Sets the block entity at a given point.
-
Constructor Details
-
ScatteredStructureBuilder
-
-
Method Details
-
addRandomBlock
-
addRandomBlock
-
getRandomBlock
Chooses a random block from a weighted list.- Parameters:
random
- the PRNG to useblocks
- a map of blocks to integer weights- Returns:
- a random block full id
-
setTile
Sets the block entity at a given point.- Parameters:
pos
- a point relative to this structure's root pointid
- the new block entity id
-
setTile
Sets the block entity at a given point.- Parameters:
pos
- a point relative to this structure's root pointid
- the new block entity iddata
- extra nbt data
-
setBlock
Sets the block at a given point.- Parameters:
pos
- a point relative to this structure's root pointid
- the new block id
-
setBlock
Sets the block at a given point.- Parameters:
pos
- a point relative to this structure's root pointid
- the new block idmeta
- the new block meta
-
setBlockDownward
Builds a 1x1 column out of the given block, replacing non-solid blocks starting at a given location and proceeding downward until a solid block is reached.- Parameters:
pos
- the highest point to possibly replace, relative to this structure's root pointid
- the block id to fill
-
setBlockDownward
Builds a 1x1 column out of the given block, replacing non-solid blocks starting at a given location and proceeding downward until a solid block is reached.- Parameters:
pos
- the highest point to possibly replace, relative to this structure's root pointid
- the block id to fillmeta
- the block meta
-
setBlockWithRandomBlock
public void setBlockWithRandomBlock(BlockVector3 pos, NukkitRandom random, Map<Integer, Integer> blocks) -
fill
Fills a box with the given block.- Parameters:
min
- the minimum coordinates, relative to this structure's root pointmax
- the maximum coordinates, relative to this structure's root pointid
- the block id
-
fill
Fills a box with the given block.- Parameters:
min
- the minimum coordinates, relative to this structure's root pointmax
- the maximum coordinates, relative to this structure's root pointid
- the block idmeta
- the block meta
-
fill
public void fill(BlockVector3 min, BlockVector3 max, int outerId, int outerMeta, int innerId, int innerMeta) Builds a box from one block, and fills it with another.- Parameters:
min
- the minimum coordinates, relative to this structure's root pointmax
- the maximum coordinates, relative to this structure's root pointouterId
- the block id for the facesouterMeta
- the block meta for the facesinnerId
- the block id for the interiorinnerMeta
- the block meta for the interior
-
fillWithRandomBlock
public void fillWithRandomBlock(BlockVector3 min, BlockVector3 max, NukkitRandom random, Map<Integer, Integer> blocks) Sets a box of blocks to have random types, chosen independently.- Parameters:
min
- the minimum coordinates, relative to this structure's root pointmax
- the maximum coordinates, relative to this structure's root pointrandom
- the PRNG to useblocks
- a map of possible blocks to integer weights
-