Class StructureBuilder

java.lang.Object
net.glowstone.generator.structures.util.StructureBuilder

public class StructureBuilder extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StructureBuilder(org.bukkit.World world, GlowStructurePiece structure, StructureBoundingBox boundingBox, BlockStateDelegate delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRandomMaterial(Map<StructureBuilder.StructureMaterial,Integer> materials, int weight, org.bukkit.Material type, int data)
     
    void
    createMobSpawner(org.bukkit.util.Vector pos, org.bukkit.entity.EntityType entityType)
    Sets the given block to a spawner for the given entity type.
    boolean
    createRandomItemsContainer(org.bukkit.util.Vector pos, Random random, RandomItemsContent content, org.bukkit.block.data.Directional container, int maxStacks)
    Sets the given block to a container and fills it with random items.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type)
    Fills a box with the given block.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type, int data)
    Fills a box with the given block.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType, int innerData)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type, org.bukkit.material.MaterialData data)
    Fills a box with the given block.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType, int innerData)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType, int innerData)
    Builds a box from one block, and fills it with another.
    void
    fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
    Builds a box from one block, and fills it with another.
    void
    fillWithRandomMaterial(org.bukkit.util.Vector min, org.bukkit.util.Vector max, Random random, Map<StructureBuilder.StructureMaterial,Integer> materials)
    Sets a box of blocks to have random types, chosen independently.
    org.bukkit.block.BlockState
    getBlockState(org.bukkit.util.Vector pos)
     
    Chooses a random StructureBuilder.StructureMaterial from a weighted list.
    void
    setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type)
    Sets the block at a given point, if it is inside this structure's bounding box.
    void
    setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type, int data)
    Sets the block at a given point, if it is inside this builder's bounding box.
    void
    setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type, org.bukkit.material.MaterialData data)
    Sets the block at a given point, if it is inside this structure's bounding box.
    void
    setBlockDownward(org.bukkit.util.Vector pos, org.bukkit.Material type)
    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(org.bukkit.util.Vector pos, org.bukkit.Material type, int data)
    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(org.bukkit.util.Vector pos, org.bukkit.Material type, org.bukkit.material.MaterialData data)
    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
    setBlockWithRandomMaterial(org.bukkit.util.Vector pos, Random random, Map<StructureBuilder.StructureMaterial,Integer> materials)
     
    boolean
    spawnMob(org.bukkit.util.Vector pos, org.bukkit.entity.EntityType entityType)
    Spawns an entity if the given position is within this structure's bounding box.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addRandomMaterial

      public void addRandomMaterial(Map<StructureBuilder.StructureMaterial,Integer> materials, int weight, org.bukkit.Material type, int data)
    • getRandomMaterial

      Chooses a random StructureBuilder.StructureMaterial from a weighted list.
      Parameters:
      random - the PRNG to use
      materials - a map of materials to integer weights
      Returns:
      a random material
    • getBlockState

      public org.bukkit.block.BlockState getBlockState(org.bukkit.util.Vector pos)
    • setBlock

      public void setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type)
      Sets the block at a given point, if it is inside this structure's bounding box.
      Parameters:
      pos - a point relative to this structure's root point
      type - the new block type
    • setBlock

      public void setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type, int data)
      Sets the block at a given point, if it is inside this builder's bounding box.
      Parameters:
      pos - a point relative to this structure's root point
      type - the new block type
      data - the new block data
    • setBlock

      public void setBlock(org.bukkit.util.Vector pos, org.bukkit.Material type, org.bukkit.material.MaterialData data)
      Sets the block at a given point, if it is inside this structure's bounding box.
      Parameters:
      pos - a point relative to this structure's root point
      type - the new block type
      data - the new block data
    • setBlockDownward

      public void setBlockDownward(org.bukkit.util.Vector pos, org.bukkit.Material type)
      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
      type - the block type to fill
    • setBlockDownward

      public void setBlockDownward(org.bukkit.util.Vector pos, org.bukkit.Material type, int data)
      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
      type - the block type to fill
      data - the block data
    • setBlockDownward

      public void setBlockDownward(org.bukkit.util.Vector pos, org.bukkit.Material type, org.bukkit.material.MaterialData data)
      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
      type - the block type to fill
      data - the block data
    • setBlockWithRandomMaterial

      public void setBlockWithRandomMaterial(org.bukkit.util.Vector pos, Random random, Map<StructureBuilder.StructureMaterial,Integer> materials)
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type)
      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
      type - the block type
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type, int data)
      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
      type - the block type
      data - the block data
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material type, org.bukkit.material.MaterialData data)
      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
      type - the block type
      data - the block data
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType)
      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
      outerType - the block type for the faces
      innerType - the block type for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType, int innerData)
      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
      outerType - the block type for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
      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
      outerType - the block type for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType, int innerData)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, int outerData, org.bukkit.Material innerType, int innerData)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fill

      public void fill(org.bukkit.util.Vector min, org.bukkit.util.Vector max, org.bukkit.Material outerType, org.bukkit.material.MaterialData outerData, org.bukkit.Material innerType, org.bukkit.material.MaterialData innerData)
      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
      outerType - the block type for the faces
      outerData - the block data for the faces
      innerType - the block type for the interior
      innerData - the block data for the interior
    • fillWithRandomMaterial

      public void fillWithRandomMaterial(org.bukkit.util.Vector min, org.bukkit.util.Vector max, Random random, Map<StructureBuilder.StructureMaterial,Integer> materials)
      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
      materials - a map of possible blocks to integer weights
    • createRandomItemsContainer

      public boolean createRandomItemsContainer(org.bukkit.util.Vector pos, Random random, RandomItemsContent content, org.bukkit.block.data.Directional container, int maxStacks)
      Sets the given block to a container and fills it with random items.
      Parameters:
      pos - a point relative to this structure's root point
      random - the PRNG to use
      content - the distribution to draw items from
      container - the container to place
      maxStacks - the maximum number of slots to fill
      Returns:
      true if the container was placed and filled; false if pos is outside the builder's bounding box or RandomItemsContent.fillContainer(Random, BlockState, int) fails
    • createMobSpawner

      public void createMobSpawner(org.bukkit.util.Vector pos, org.bukkit.entity.EntityType entityType)
      Sets the given block to a spawner for the given entity type.
      Parameters:
      pos - a point relative to this structure's root point
      entityType - the type of entity the spawner will spawn
    • spawnMob

      public boolean spawnMob(org.bukkit.util.Vector pos, org.bukkit.entity.EntityType entityType)
      Spawns an entity if the given position is within this structure's bounding box.
      Parameters:
      pos - a point relative to this structure's root point
      entityType - the type of entity to spawn
      Returns:
      true if the entity was spawned; false if pos is outside the builder's bounding box or World.spawnEntity(Location, EntityType) fails