java.lang.Object
cn.nukkit.level.generator.populator.impl.structure.utils.structure.ScatteredStructureBuilder

@PowerNukkitXOnly @Since("1.19.21-r2") public class ScatteredStructureBuilder extends Object
  • Constructor Details

  • Method Details

    • addRandomBlock

      public void addRandomBlock(Map<Integer,Integer> blocks, int weight, int id)
    • addRandomBlock

      public void addRandomBlock(Map<Integer,Integer> blocks, int weight, int id, int meta)
    • getRandomBlock

      public int getRandomBlock(NukkitRandom random, Map<Integer,Integer> blocks)
      Chooses a random block from a weighted list.
      Parameters:
      random - the PRNG to use
      blocks - a map of blocks to integer weights
      Returns:
      a random block full id
    • setTile

      public void setTile(BlockVector3 pos, String id)
      Sets the block entity at a given point.
      Parameters:
      pos - a point relative to this structure's root point
      id - the new block entity id
    • setTile

      public void setTile(BlockVector3 pos, String id, CompoundTag data)
      Sets the block entity at a given point.
      Parameters:
      pos - a point relative to this structure's root point
      id - the new block entity id
      data - extra nbt data
    • setBlock

      public void setBlock(BlockVector3 pos, int id)
      Sets the block at a given point.
      Parameters:
      pos - a point relative to this structure's root point
      id - the new block id
    • setBlock

      public void setBlock(BlockVector3 pos, int id, int meta)
      Sets the block at a given point.
      Parameters:
      pos - a point relative to this structure's root point
      id - the new block id
      meta - the new block meta
    • setBlockDownward

      public 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.
      Parameters:
      pos - the highest point to possibly replace, relative to this structure's root point
      id - the block id to fill
    • setBlockDownward

      public 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.
      Parameters:
      pos - the highest point to possibly replace, relative to this structure's root point
      id - the block id to fill
      meta - the block meta
    • setBlockWithRandomBlock

      public void setBlockWithRandomBlock(BlockVector3 pos, NukkitRandom random, Map<Integer,Integer> blocks)
    • fill

      public void fill(BlockVector3 min, BlockVector3 max, int id)
      Fills a box with the given block.
      Parameters:
      min - the minimum coordinates, relative to this structure's root point
      max - the maximum coordinates, relative to this structure's root point
      id - the block id
    • fill

      public void fill(BlockVector3 min, BlockVector3 max, int id, int meta)
      Fills a box with the given block.
      Parameters:
      min - the minimum coordinates, relative to this structure's root point
      max - the maximum coordinates, relative to this structure's root point
      id - the block id
      meta - 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 point
      max - the maximum coordinates, relative to this structure's root point
      outerId - the block id for the faces
      outerMeta - the block meta for the faces
      innerId - the block id for the interior
      innerMeta - 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 point
      max - the maximum coordinates, relative to this structure's root point
      random - the PRNG to use
      blocks - a map of possible blocks to integer weights