Class Cuboid

java.lang.Object
com.stardevllc.starmclib.Cuboid

public class Cuboid extends Object
  • Field Details

    • worldName

      protected String worldName
    • world

      protected transient org.bukkit.World world
    • xMin

      protected int xMin
    • yMin

      protected int yMin
    • zMin

      protected int zMin
    • xMax

      protected int xMax
    • yMax

      protected int yMax
    • zMax

      protected int zMax
  • Constructor Details

    • Cuboid

      public Cuboid(org.bukkit.Location pos1, org.bukkit.Location pos2)
    • Cuboid

      public Cuboid(String worldName, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax)
  • Method Details

    • setBounds

      protected void setBounds(org.bukkit.Location pos1, org.bukkit.Location pos2)
    • setBounds

      protected void setBounds(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax)
    • createOutline

      public void createOutline(org.bukkit.Material material)
    • setWorldName

      protected void setWorldName(String worldName)
    • setXMin

      protected void setXMin(int xMin)
    • setYMin

      protected void setYMin(int yMin)
    • setZMin

      protected void setZMin(int zMin)
    • setXMax

      protected void setXMax(int xMax)
    • setYMax

      protected void setYMax(int yMax)
    • setZMax

      protected void setZMax(int zMax)
    • getWorldName

      public String getWorldName()
    • getXMin

      public int getXMin()
    • getYMin

      public int getYMin()
    • getZMin

      public int getZMin()
    • getXMax

      public int getXMax()
    • getYMax

      public int getYMax()
    • getZMax

      public int getZMax()
    • getXMinCentered

      public double getXMinCentered()
    • getYMinCentered

      public double getYMinCentered()
    • getZMinCentered

      public double getZMinCentered()
    • getXMaxCentered

      public double getXMaxCentered()
    • getYMaxCentered

      public double getYMaxCentered()
    • getZMaxCentered

      public double getZMaxCentered()
    • getBlockList

      public Collection<org.bukkit.block.Block> getBlockList()
      Gets all blocks within this cuboid
      Returns:
      The blocks
    • getBlockList

      public Collection<org.bukkit.block.Block> getBlockList(boolean removeAir)
      Gets all blocks within this cuboid with a flag to remove air
      Parameters:
      removeAir - If air should be counted in the block list
      Returns:
      The list of blocks
    • getTotalBlockSize

      public int getTotalBlockSize()
      Gets the total area size represented by this cuboid
      Returns:
      The total size
    • getWorld

      public org.bukkit.World getWorld()
      Gets the world that this cuboid exists in
      Returns:
      The world
    • getHeight

      public int getHeight()
      Gets the height of this cuboid
      Returns:
      The height
    • getXWidth

      public int getXWidth()
      Gets the x width of this cuboid
      Returns:
      The x width
    • getZWidth

      public int getZWidth()
      Gets the z width of this cuboid
      Returns:
      The z width
    • contains

      public boolean contains(org.bukkit.entity.Entity entity)
      Returns if this cuboid contains an entity
      Parameters:
      entity - The entity
      Returns:
      If the entity exists within this cuboid
    • contains

      public boolean contains(org.bukkit.Location loc)
      Checks to see if this cuboid contains a location
      Parameters:
      loc - The location
      Returns:
      If this cuboid contains the location
    • getCenter

      public org.bukkit.Location getCenter()
      Gets the center of this cuboid as a Bukkit Location
      Returns:
      The center
    • getDistance

      public double getDistance()
      Gets the distance of this cuboid
      Returns:
      The distance
    • getMinimum

      public org.bukkit.Location getMinimum()
      Gets the minimum corner as a Location
      Returns:
      The Minimum corner
    • getMaximum

      public org.bukkit.Location getMaximum()
      Gets the maximum corner as a Location
      Returns:
      The Maximum corner
    • getDistanceSquared

      public double getDistanceSquared()
    • getRandomLocation

      public org.bukkit.Location getRandomLocation()
      Gets a random location within this cuboid
      Returns:
      The random location
    • contains

      public boolean contains(org.bukkit.World world, int x, int y, int z)
      Checks to see if this cuboid contains the coordinates
      Parameters:
      world - The world
      x - The x
      y - The y
      z - The z
      Returns:
      If it contains this
    • contains

      public boolean contains(org.bukkit.Location loc, double marge)
      Checks to see if this cuboid contains a location, with a margine
      Parameters:
      loc - The location
      marge - The margine
      Returns:
      If it does contain the location
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object