Class Cuboid

java.lang.Object
ml.karmaconfigs.api.bukkit.region.Cuboid
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Region

public abstract class Cuboid extends Object implements Serializable
Karma cuboid region Code from: https://www.spigotmc.org/threads/region-cuboid.329859/
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cuboid​(KarmaPlugin plugin)
    Initialize the cuboid region
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    exists​(KarmaPlugin plugin)
    Get if the region already exists
    abstract Iterator<org.bukkit.block.Block>
    Get the region blocks
    abstract int
    Get the amount of blocks inside the region
    abstract org.bukkit.Location
    Get the bottom location
    abstract Corner
    Get the bottom corners of the region
    abstract org.bukkit.Location
    Get the region center location
    abstract int
    Get the region height
    abstract String
    Get the region internal name
    abstract int
    Get the region length
    abstract String
    Get the region name
    static Set<Cuboid>
    Get all the regions
    abstract double
    Get the region size
    abstract double
    Get the region size
    abstract String
    Get the region token, this is another unique identifier for the region ( UUID is also used as identifier ).
    abstract org.bukkit.Location
    Get the top location
    abstract Corner
    Get the top corners of the region
    abstract UUID
    Get the region unique id
    abstract Wall
    getWalls​(WallType type)
    Get the region walls
    abstract int
    Get the region width
    abstract org.bukkit.World
    Get the region world
    abstract boolean
    isInside​(org.bukkit.block.Block block)
    Get if the block is inside the region
    abstract boolean
    isInside​(org.bukkit.entity.Entity entity)
    Get if the entity is inside the region
    abstract boolean
    isInside​(org.bukkit.entity.Entity entity, double marge)
    Get if the entity is inside the region
    abstract void
    Save the region to memory WARNING: THIS METHOD SHOULD CONTAIN A exists(KarmaPlugin) CHECK BEFORE BEING PROCESSED, OTHERWISE EXISTING REGION WILL BE OVERWRITTEN

    Methods inherited from class java.lang.Object

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

    • Cuboid

      public Cuboid(KarmaPlugin plugin)
      Initialize the cuboid region
      Parameters:
      plugin - the cuboid owner
  • Method Details

    • getUniqueId

      public abstract UUID getUniqueId()
      Get the region unique id
      Returns:
      the region unique id
    • getName

      public abstract String getName()
      Get the region name
      Returns:
      the region name
    • getInternalName

      public abstract String getInternalName()
      Get the region internal name
      Returns:
      the region internal name
    • exists

      public abstract boolean exists(KarmaPlugin plugin)
      Get if the region already exists
      Parameters:
      plugin - the region owner
      Returns:
      if the region already exists
    • getBlocks

      public abstract Iterator<org.bukkit.block.Block> getBlocks()
      Get the region blocks
      Returns:
      the region blocks
    • getCenter

      public abstract org.bukkit.Location getCenter()
      Get the region center location
      Returns:
      the region center location
    • getSize

      public abstract double getSize()
      Get the region size
      Returns:
      the region size
    • getSizeSquared

      public abstract double getSizeSquared()
      Get the region size
      Returns:
      the region size
    • getTop

      public abstract org.bukkit.Location getTop()
      Get the top location
      Returns:
      the top location
    • getBottom

      public abstract org.bukkit.Location getBottom()
      Get the bottom location
      Returns:
      the bottom location
    • getWorld

      public abstract org.bukkit.World getWorld()
      Get the region world
      Returns:
      the region world
    • getBlocksAmount

      public abstract int getBlocksAmount()
      Get the amount of blocks inside the region
      Returns:
      the region blocks
    • getHeight

      public abstract int getHeight()
      Get the region height
      Returns:
      the region height
    • getWidth

      public abstract int getWidth()
      Get the region width
      Returns:
      the region width
    • getLength

      public abstract int getLength()
      Get the region length
      Returns:
      the region length
    • isInside

      public abstract boolean isInside(org.bukkit.entity.Entity entity)
      Get if the entity is inside the region
      Parameters:
      entity - the entity
      Returns:
      if the entity is inside the region
    • isInside

      public abstract boolean isInside(org.bukkit.block.Block block)
      Get if the block is inside the region
      Parameters:
      block - the block
      Returns:
      if the block is inside the region
    • isInside

      public abstract boolean isInside(org.bukkit.entity.Entity entity, double marge)
      Get if the entity is inside the region
      Parameters:
      entity - the entity
      marge - the marge out of region frontier
      Returns:
      if the entity is inside the region
    • getToken

      public abstract String getToken()
      Get the region token, this is another unique identifier for the region ( UUID is also used as identifier ). The difference between this one and UUID one is that this token is randomly generated, and UUID name-base generated
      Returns:
      the region token
    • getTopCorners

      public abstract Corner getTopCorners()
      Get the top corners of the region
      Returns:
      the top region corners
    • getBottomCorners

      public abstract Corner getBottomCorners()
      Get the bottom corners of the region
      Returns:
      the bottom region corners
    • getWalls

      public abstract Wall getWalls(WallType type)
      Get the region walls
      Parameters:
      type - the wall type
      Returns:
      the region walls
    • saveToMemory

      public abstract void saveToMemory(KarmaPlugin owner)
      Save the region to memory WARNING: THIS METHOD SHOULD CONTAIN A exists(KarmaPlugin) CHECK BEFORE BEING PROCESSED, OTHERWISE EXISTING REGION WILL BE OVERWRITTEN
      Parameters:
      owner - the region owner
    • getRegions

      public static Set<Cuboid> getRegions()
      Get all the regions
      Returns:
      the regions