Class CoreRegion

java.lang.Object
br.net.fabiozumbi12.RedProtect.Core.region.CoreRegion
All Implemented Interfaces:
Serializable

public class CoreRegion extends Object implements Serializable
See Also:
  • Field Details

    • serialVersionUID

      public static final long serialVersionUID
      See Also:
    • minMbrX

      protected int minMbrX
    • maxMbrX

      protected int maxMbrX
    • minMbrZ

      protected int minMbrZ
    • maxMbrZ

      protected int maxMbrZ
    • minY

      protected int minY
    • maxY

      protected int maxY
    • prior

      protected int prior
    • name

      protected final String name
    • leaders

      protected Set<PlayerRegion> leaders
    • admins

      protected Set<PlayerRegion> admins
    • members

      protected Set<PlayerRegion> members
    • wMessage

      protected String wMessage
    • world

      protected String world
    • date

      protected String date
    • flags

      protected Map<String,Object> flags
    • value

      protected double value
    • tppoint

      protected int[] tppoint
    • tppointYaw

      protected float[] tppointYaw
    • canDelete

      protected final boolean canDelete
    • canPurge

      protected boolean canPurge
  • Constructor Details

    • CoreRegion

      public CoreRegion(String name, Set<PlayerRegion> admins, Set<PlayerRegion> members, Set<PlayerRegion> leaders, int[] minLoc, int[] maxLoc, Map<String,Object> flags, String wMessage, int prior, String worldName, String date, double value, int[] tppoint, float[] tppointYaw, boolean candel, boolean canPurge)
      Represents the region created by player.
      Parameters:
      name - Name of region.
      admins - List of admins.
      members - List of members.
      leaders - List of leaders.
      minLoc - Min coord.
      maxLoc - Max coord.
      flags - Flag names and values.
      wMessage - Welcome message.
      prior - Priority of region.
      worldName - Name of world for this region.
      date - Date of latest visit of an admin or leader.
      value - Last value of this region.
      tppoint - Teleport Point
      tppointYaw - Teleport Pitch and Yam
    • CoreRegion

      public CoreRegion(String name, Set<PlayerRegion> admins, Set<PlayerRegion> members, Set<PlayerRegion> leaders, int maxMbrX, int minMbrX, int maxMbrZ, int minMbrZ, int minY, int maxY, Map<String,Object> flags, String wMessage, int prior, String worldName, String date, double value, int[] tppoint, float[] tppointYaw, boolean candel, boolean canPurge)
      Represents the region created by player.
      Parameters:
      name - Name of region.
      admins - List of admins.
      members - List of members.
      leaders - List of leaders.
      maxMbrX - Max coord X
      minMbrX - Min coord X
      maxMbrZ - Max coord Z
      minMbrZ - Min coord Z
      flags - Flag names and values.
      wMessage - Welcome message.
      prior - Priority of region.
      worldName - Name of world for this region.
      date - Date of latest visit of an admin or leader.
      value - Last value of this region.
      tppoint - Teleport Point
      tppointYaw - Teleport Pitch and Yam
    • CoreRegion

      public CoreRegion(String name, Set<PlayerRegion> admins, Set<PlayerRegion> members, Set<PlayerRegion> leaders, int[] x, int[] z, int miny, int maxy, int prior, String worldName, String date, Map<String,Object> flags, String welcome, double value, int[] tppoint, float[] tppointYaw, boolean candel, boolean canPurge)
      Represents the region created by player.
      Parameters:
      name - Region name.
      admins - Admins names/uuids.
      members - Members names/uuids.
      leaders - Leaders name/uuid.
      x - Locations of x coords.
      z - Locations of z coords.
      miny - Min coord y of this region.
      maxy - Max coord y of this region.
      prior - Location of x coords.
      worldName - Name of world region.
      date - Date of latest visit of an admins or leader.
      welcome - Set a welcome message.
      value - A value in server economy.
      tppoint - Teleport Point
      tppointYaw - Teleport Pitch and Yam
    • CoreRegion

      public CoreRegion(String name, int[] min, int[] max, String world, String defLeader, Map<String,Object> defFlags)
      Represents the region created by player.
      Parameters:
      name - Region name.
      min - Min Location.
      max - Max Location.
      world - World name.
  • Method Details

    • getFlags

      public Map<String,Object> getFlags()
    • setFlags

      public void setFlags(Map<String,Object> flags)
    • canPurge

      public boolean canPurge()
    • canDelete

      public boolean canDelete()
    • toString

      public String toString()
      Get unique ID of region based on name of "region + @ + world".
      Overrides:
      toString in class Object
      Returns:
      id string
    • getID

      public String getID()
      Get unique ID of region based on name of "region + @ + world".
      Returns:
      id string
    • toSave

      public boolean toSave()
    • setToSave

      public void setToSave(boolean save)
    • getFlagStrings

      public String getFlagStrings()
    • getTPPointString

      public String getTPPointString()
    • getDate

      public String getDate()
    • getMaxY

      public int getMaxY()
    • getMinY

      public int getMinY()
    • getWorld

      public String getWorld()
    • getPrior

      public int getPrior()
    • getWelcome

      public String getWelcome()
    • getName

      public String getName()
    • getAdmins

      public Set<PlayerRegion> getAdmins()
      Use this method to get raw admins. This will return UUID if server running in Online mode. Will return player name in lowercase if Offline mode.

      To check if a player can build on this region use canBuild(p) instead this method.

      Returns:
      Set<PlayerRegion<String, String>>
    • getMembers

      public Set<PlayerRegion> getMembers()
      Use this method to get raw members. This will return UUID if server running in Online mode. Will return player name in lowercase if Offline mode.

      To check if a player can build on this region use canBuild(Player p) instead this method.

      Returns:
      Set<PlayerRegion<String, String>>
    • getLeaders

      public Set<PlayerRegion> getLeaders()
      Use this method to get raw leaders. This will return UUID if server running in Online mode. Will return player name in lowercase if Offline mode.

      To check if a player can build on this region use canBuild(Player p) instead this method.

      Returns:
      Set<PlayerRegion<String, String>>
    • getCenterX

      public int getCenterX()
    • getCenterZ

      public int getCenterZ()
    • getCenterY

      public int getCenterY()
    • getMaxMbrX

      public int getMaxMbrX()
    • getMinMbrX

      public int getMinMbrX()
    • getMaxMbrZ

      public int getMaxMbrZ()
    • getMinMbrZ

      public int getMinMbrZ()
    • getArea

      public int getArea()
    • isLeaderByUUID

      public boolean isLeaderByUUID(String player)
    • isAdminByUUID

      public boolean isAdminByUUID(String player)
    • isMemberByUUID

      public boolean isMemberByUUID(String player)
    • isLeaderByName

      public boolean isLeaderByName(String player)
    • isAdminByName

      public boolean isAdminByName(String player)
    • isMemberByName

      public boolean isMemberByName(String player)
    • isLeader

      public boolean isLeader(String player)
    • isAdmin

      public boolean isAdmin(String player)
    • isMember

      public boolean isMember(String player)
    • adminSize

      public int adminSize()
    • leaderSize

      public int leaderSize()
    • flagExists

      public boolean flagExists(String key)
    • getValue

      public double getValue()
    • serializeMembers

      protected String serializeMembers(Set<PlayerRegion> pairs)
    • sameLeaders

      public boolean sameLeaders(CoreRegion r)
    • getLeadersString

      public String getLeadersString()
    • getAdminString

      public String getAdminString()
    • getMembersString

      public String getMembersString()