Class GDClaim

java.lang.Object
me.EtienneDx.RealEstate.ClaimAPI.GriefDefender.GDClaim
All Implemented Interfaces:
IClaim

public class GDClaim extends Object implements IClaim
Implementation of the IClaim interface using the GriefDefender API.

This class wraps a GriefDefender Claim and provides access to claim properties such as area, coordinates, owner, and permissions management.

  • Constructor Summary

    Constructors
    Constructor
    Description
    GDClaim(com.griefdefender.api.claim.Claim claim)
    Constructs a new GDClaim that wraps the given GriefDefender claim.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addManager(UUID player)
    Adds a manager to this claim.
    void
    Adds a specific permission for a player to this claim.
    void
    Clears all managers from this claim.
    void
    Clears all player permissions from this claim.
    void
    Drops all player permissions for the specified player in this claim.
    int
    Calculates the area of the claim.
    Returns an iterable over the child claims.
    com.griefdefender.api.claim.Claim
    Returns the underlying GriefDefender claim.
    Gets the unique identifier for this claim.
    Retrieves the owner of the claim.
    Retrieves the name of the claim's owner.
    Retrieves the parent claim of this claim, if any.
    org.bukkit.World
    Retrieves the Bukkit World where the claim is located.
    int
    Gets the X coordinate of the claim's lesser boundary corner.
    int
    Gets the Y coordinate of the claim's lesser boundary corner.
    int
    Gets 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
    Checks if this claim represents wilderness.
    void
    Removes a manager from this claim.
    void
    setInheritPermissions(boolean inherit)
    Sets whether the claim should inherit permissions from its parent claim.

    Methods inherited from class java.lang.Object

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

    • GDClaim

      public GDClaim(com.griefdefender.api.claim.Claim claim)
      Constructs a new GDClaim that wraps the given GriefDefender claim.
      Parameters:
      claim - the GriefDefender claim to wrap
  • Method Details

    • getClaim

      public com.griefdefender.api.claim.Claim getClaim()
      Returns the underlying GriefDefender claim.
      Returns:
      the wrapped GriefDefender Claim
    • getId

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

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

      public org.bukkit.World getWorld()
      Retrieves the Bukkit World where the claim is located.
      Specified by:
      getWorld in interface IClaim
      Returns:
      the Bukkit World corresponding to the claim's world
    • getX

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

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

      public int getZ()
      Gets 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 this claim is an admin claim, false otherwise
    • getChildren

      public Iterable<IClaim> getChildren()
      Returns an iterable over the child claims.

      In GriefDefender, child claims are obtained via the getChildren(true) method.

      Specified by:
      getChildren in interface IClaim
      Returns:
      an Iterable of IClaim representing child claims
    • isWilderness

      public boolean isWilderness()
      Checks if this claim represents wilderness.
      Specified by:
      isWilderness in interface IClaim
      Returns:
      true if this claim is wilderness, false otherwise
    • isSubClaim

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

      public boolean isParentClaim()
      Determines if this claim is a parent claim.
      Specified by:
      isParentClaim in interface IClaim
      Returns:
      true if this claim has no parent or its parent is wilderness
    • getParent

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

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

      public void addPlayerPermissions(UUID player, ClaimPermission permission)
      Adds a specific permission for a player to this claim.
      Specified by:
      addPlayerPermissions in interface IClaim
      Parameters:
      player - the UUID of the player to grant permission to
      permission - the ClaimPermission to grant
    • clearPlayerPermissions

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

      public void removeManager(UUID player)
      Removes a manager from this claim.

      Not supported in GriefDefender.

      Specified by:
      removeManager in interface IClaim
      Parameters:
      player - the UUID of the manager to remove
    • addManager

      public void addManager(UUID player)
      Adds a manager to this claim.

      Not supported in GriefDefender.

      Specified by:
      addManager in interface IClaim
      Parameters:
      player - the UUID of the manager to add
    • clearManagers

      public void clearManagers()
      Clears all managers from this claim.

      Not supported in GriefDefender.

      Specified by:
      clearManagers in interface IClaim
    • getOwner

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

      public String getOwnerName()
      Retrieves the name of the claim's owner.
      Specified by:
      getOwnerName in interface IClaim
      Returns:
      the owner's name as provided by GriefDefender
    • setInheritPermissions

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