Class RegionManager

java.lang.Object
br.net.fabiozumbi12.RedProtect.Bukkit.region.RegionManager

public class RegionManager extends Object
Get the region database from here. All functions for manage regions can be found in this class.
  • Constructor Details

    • RegionManager

      public RegionManager()
  • Method Details

    • loadAll

      public void loadAll() throws Exception
      Throws:
      Exception
    • load

      public void load(String w) throws Exception
      Throws:
      Exception
    • unloadAll

      public void unloadAll()
    • unload

      public void unload(String w)
    • saveAll

      public int saveAll(boolean force)
    • getRegionById

      public Region getRegionById(String rid)
    • getRegion

      public Region getRegion(String rname, String w)
    • getTotalRegionSize

      public int getTotalRegionSize(String uuid, String world)
    • getLeaderRegions

      public Set<Region> getLeaderRegions(String uuid)
      Return a set of regions by player UUID or Name if this player is Leader;

      This will return player regions based on raw UUID or Player name, depending if server is running in Online or Offline mode;

      Parameters:
      uuid - the UUID of the player.
      Returns:
      Set<Region> with regions
    • getAdminRegions

      public Set<Region> getAdminRegions(String uuid)
      Return a set of regions by player UUID or Name if this player is Admin or Leader;

      This will return player regions based on raw UUID or Player name, depending if server is running in Online;

      Parameters:
      uuid - the UUID of the player.
      Returns:
      Set<Region> with regions
    • getMemberRegions

      public Set<Region> getMemberRegions(String uuid)
      Return a set of regions by player UUID or Name if this player is Member, Admin or Leader;

      This will return player regions based on raw UUID or Player name, depending if server is running in Online;

      Parameters:
      uuid - the UUID of the player.
      Returns:
      Set<Region> with regions
    • getRegionsForChunk

      public Set<Region> getRegionsForChunk(org.bukkit.Chunk chunk)
    • getRegionsNear

      public Set<Region> getRegionsNear(org.bukkit.entity.Player player, int i)
    • getRegions

      public Set<Region> getRegions(String player, String w)
    • getPlayerRegions

      public int getPlayerRegions(String player, String w)
    • add

      public void add(Region r, String w)
    • getCanPurgePlayer

      public long getCanPurgePlayer(String player, String world)
    • save

      public void save(String w)
    • remove

      public void remove(Region r, String w)
    • getRegions

      public Set<Region> getRegions(org.bukkit.entity.Player p, int x, int y, int z)
    • getInnerRegions

      public Set<Region> getInnerRegions(Region region, String w)
    • removeAll

      public int removeAll(String player)
    • regenAll

      public int regenAll(String player)
    • getTopRegion

      public Region getTopRegion(org.bukkit.Location loc)
      Get the high priority region in a group region. If no other regions, return the unique region on location.
      Parameters:
      loc - Location
      Returns:
      Region - Or null if no regions on this location.
    • getTopRegion

      public Region getTopRegion(String w, int x, int y, int z)
      Get the high priority region in a group region. If no other regions, return the unique region on location.
      Parameters:
      w - World
      x - Location x
      y - Location y
      z - Location z
      Returns:
      Region - Or null if no regions on this location.
    • getLowRegion

      public Region getLowRegion(String w, int x, int y, int z)
      Get the low priority region in a group region. If no other regions, return the unique region on location.
      Parameters:
      w - World
      x - Location x
      y - Location y
      z - Location z
      Returns:
      Region - Or null if no regions on this location.
    • getLowRegion

      public Region getLowRegion(org.bukkit.Location loc)
      Get the low priority region in a group region. If no other regions, return the unique region on location.
      Parameters:
      loc - location to get region.
      Returns:
      Region - Or null if no regions on this location.
    • getGroupRegion

      public Map<Integer,Region> getGroupRegion(String w, int x, int y, int z)
      Get regions in a group region. If no other regions, return the unique region on location.
      Parameters:
      w - World
      x - Location x
      y - Location y
      z - Location z
      Returns:
      Map<Integer,Region> - Indexed by priority
    • getGroupRegion

      public Map<Integer,Region> getGroupRegion(org.bukkit.Location loc)
      Get regions in a group region. If no other regions, return the unique region on location.
      Returns:
      Map<Integer,Region> - Indexed by priority
    • getAllRegions

      public Set<Region> getAllRegions()
    • getRegionsByWorld

      public Set<Region> getRegionsByWorld(String w)
    • clearDB

      public void clearDB()
    • updateLiveRegion

      public void updateLiveRegion(Region r, String columm, Object value)
    • updateLiveFlags

      public void updateLiveFlags(Region r, String flag, String value)
    • removeLiveFlags

      public void removeLiveFlags(Region r, String flag)
    • getTotalRegionsNum

      public int getTotalRegionsNum()
    • renameRegion

      public Region renameRegion(String newName, Region old)