Class GPClaim

java.lang.Object
me.EtienneDx.RealEstate.ClaimAPI.GriefPrevention.GPClaim
All Implemented Interfaces:
IClaim

public class GPClaim extends Object implements IClaim
GPClaim is an implementation of the IClaim interface for GriefPrevention claims. It wraps a GriefPrevention Claim object and provides methods to access claim properties, as well as to manage permissions and claim relationships.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GPClaim(me.ryanhamshire.GriefPrevention.Claim claim)
    Constructs a new GPClaim that wraps the given GriefPrevention claim.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addManager(UUID player)
    Adds the specified player as a manager for this claim.
    void
    Adds player permissions to this claim based on the specified ClaimPermission.
    void
    Clears all managers from this claim.
    void
    Clears all player permissions for this claim.
    void
    Removes all player permissions for the specified player from this claim.
    int
    Returns the area of this claim.
    Returns an Iterable over the child claims of this claim.
    me.ryanhamshire.GriefPrevention.Claim
    Returns the underlying GriefPrevention claim.
    Returns the unique identifier of this claim.
    Returns the UUID of the owner of this claim.
    Returns the name of the owner of this claim.
    Returns the parent claim of this claim.
    org.bukkit.World
    Returns the world in which this claim is located.
    int
    Returns the X-coordinate of the claim's lesser boundary corner.
    int
    Returns the Y-coordinate of the claim's lesser boundary corner.
    int
    Returns the Z-coordinate of the claim's lesser boundary corner.
    boolean
    Determines if this claim is an admin claim.
    boolean
    Determines if this claim is a parent claim.
    boolean
    Determines if this claim is a subclaim.
    boolean
    Indicates whether this claim represents wilderness.
    void
    Removes the specified player from the list of managers for this claim.
    void
    setInheritPermissions(boolean inherit)
    Sets whether this claim should inherit permissions from its parent.

    Methods inherited from class java.lang.Object

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

    • GPClaim

      public GPClaim(me.ryanhamshire.GriefPrevention.Claim claim)
      Constructs a new GPClaim that wraps the given GriefPrevention claim.
      Parameters:
      claim - the GriefPrevention claim to wrap
  • Method Details

    • getClaim

      public me.ryanhamshire.GriefPrevention.Claim getClaim()
      Returns the underlying GriefPrevention claim.
      Returns:
      the GriefPrevention Claim object
    • getId

      public String getId()
      Returns the unique identifier of this claim.
      Specified by:
      getId in interface IClaim
      Returns:
      a string representing the claim's unique ID
    • getArea

      public int getArea()
      Returns the area of this claim.
      Specified by:
      getArea in interface IClaim
      Returns:
      the area (in blocks) of the claim
    • getWorld

      public org.bukkit.World getWorld()
      Returns the world in which this claim is located.
      Specified by:
      getWorld in interface IClaim
      Returns:
      the World object for the claim's world
    • getX

      public int getX()
      Returns the X-coordinate of the claim's lesser boundary corner.
      Specified by:
      getX in interface IClaim
      Returns:
      the X-coordinate
    • getY

      public int getY()
      Returns the Y-coordinate of the claim's lesser boundary corner.
      Specified by:
      getY in interface IClaim
      Returns:
      the Y-coordinate
    • getZ

      public int getZ()
      Returns the Z-coordinate of the claim's lesser boundary corner.
      Specified by:
      getZ in interface IClaim
      Returns:
      the Z-coordinate
    • isAdminClaim

      public boolean isAdminClaim()
      Determines if this claim is an admin claim.
      Specified by:
      isAdminClaim in interface IClaim
      Returns:
      true if the claim is an admin claim, false otherwise
    • getChildren

      public Iterable<IClaim> getChildren()
      Returns an Iterable over the child claims of this claim.
      Specified by:
      getChildren in interface IClaim
      Returns:
      an Iterable of IClaim objects representing child claims
    • isWilderness

      public boolean isWilderness()
      Indicates whether this claim represents wilderness. For GriefPrevention claims, this always returns false.
      Specified by:
      isWilderness in interface IClaim
      Returns:
      false
    • isSubClaim

      public boolean isSubClaim()
      Determines if this claim is a subclaim.
      Specified by:
      isSubClaim in interface IClaim
      Returns:
      true if the claim has a parent claim, false otherwise
    • isParentClaim

      public boolean isParentClaim()
      Determines if this claim is a parent claim.
      Specified by:
      isParentClaim in interface IClaim
      Returns:
      true if the claim does not have a parent, false otherwise
    • getParent

      public IClaim getParent()
      Returns the parent claim of this claim.
      Specified by:
      getParent in interface IClaim
      Returns:
      a new GPClaim representing the parent, or null if this is a parent claim
    • dropPlayerPermissions

      public void dropPlayerPermissions(UUID player)
      Removes all player permissions for the specified player from this claim.
      Specified by:
      dropPlayerPermissions in interface IClaim
      Parameters:
      player - the UUID of the player whose permissions will be removed
    • addPlayerPermissions

      public void addPlayerPermissions(UUID player, ClaimPermission permission)
      Adds player permissions to this claim based on the specified ClaimPermission.
      Specified by:
      addPlayerPermissions in interface IClaim
      Parameters:
      player - the UUID of the player to add permissions for
      permission - the ClaimPermission to add
    • removeManager

      public void removeManager(UUID player)
      Removes the specified player from the list of managers for this claim.
      Specified by:
      removeManager in interface IClaim
      Parameters:
      player - the UUID of the player to remove as a manager
    • getOwner

      public UUID getOwner()
      Returns the UUID of the owner of this claim.
      Specified by:
      getOwner in interface IClaim
      Returns:
      the owner's UUID
    • getOwnerName

      public String getOwnerName()
      Returns the name of the owner of this claim. If the owner is not available, a default server keyword is returned.
      Specified by:
      getOwnerName in interface IClaim
      Returns:
      the owner's name, or a default value if not available
    • setInheritPermissions

      public void setInheritPermissions(boolean inherit)
      Sets whether this claim should inherit permissions from its parent.
      Specified by:
      setInheritPermissions in interface IClaim
      Parameters:
      inherit - true if the claim should inherit permissions, false otherwise
    • clearPlayerPermissions

      public void clearPlayerPermissions()
      Clears all player permissions for this claim.
      Specified by:
      clearPlayerPermissions in interface IClaim
    • addManager

      public void addManager(UUID player)
      Adds the specified player as a manager for this claim.
      Specified by:
      addManager in interface IClaim
      Parameters:
      player - the UUID of the player to add as a manager
    • clearManagers

      public void clearManagers()
      Clears all managers from this claim.
      Specified by:
      clearManagers in interface IClaim