Class Region

java.lang.Object
me.fami6xx.rpuniverse.core.regions.Region

public class Region extends Object
Represents a region (cuboid) with two corners.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Region​(String name, org.bukkit.Location corner1, org.bukkit.Location corner2)
    Create a new Region.
    Region​(UUID regionId, String name, org.bukkit.Location corner1, org.bukkit.Location corner2)
    Used by Gson or internal re-creation when loading from disk.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Location
    Gets the first corner of the region.
    org.bukkit.Location
    Gets the second corner of the region.
    org.bukkit.Location
    Helper to get the maximum corner for x, y, z.
    org.bukkit.Location
    Helper to get the minimum corner for x, y, z.
    Gets the name of the region.
    Gets the unique ID of the region.
    void
    setCorner1​(org.bukkit.Location corner1)
    Sets the first corner of the region.
    void
    setCorner2​(org.bukkit.Location corner2)
    Sets the second corner of the region.
    void
    setName​(String name)
    Sets the name of the region.

    Methods inherited from class java.lang.Object

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

    • Region

      public Region(String name, org.bukkit.Location corner1, org.bukkit.Location corner2)
      Create a new Region.
      Parameters:
      name - Region's name
      corner1 - First corner (Location)
      corner2 - Second corner (Location)
    • Region

      public Region(UUID regionId, String name, org.bukkit.Location corner1, org.bukkit.Location corner2)
      Used by Gson or internal re-creation when loading from disk.
      Parameters:
      regionId - Unique ID for the region
      name - Region's name
      corner1 - First corner (Location)
      corner2 - Second corner (Location)
  • Method Details

    • getRegionId

      public UUID getRegionId()
      Gets the unique ID of the region.
      Returns:
      the unique ID of the region
    • getName

      public String getName()
      Gets the name of the region.
      Returns:
      the name of the region
    • setName

      public void setName(String name)
      Sets the name of the region.
      Parameters:
      name - the new name of the region
    • getCorner1

      public org.bukkit.Location getCorner1()
      Gets the first corner of the region.
      Returns:
      the first corner of the region
    • setCorner1

      public void setCorner1(org.bukkit.Location corner1)
      Sets the first corner of the region.
      Parameters:
      corner1 - the new first corner of the region
    • getCorner2

      public org.bukkit.Location getCorner2()
      Gets the second corner of the region.
      Returns:
      the second corner of the region
    • setCorner2

      public void setCorner2(org.bukkit.Location corner2)
      Sets the second corner of the region.
      Parameters:
      corner2 - the new second corner of the region
    • getMinCorner

      public org.bukkit.Location getMinCorner()
      Helper to get the minimum corner for x, y, z.
      Returns:
      the minimum corner for x, y, z
    • getMaxCorner

      public org.bukkit.Location getMaxCorner()
      Helper to get the maximum corner for x, y, z.
      Returns:
      the maximum corner for x, y, z