Class GriefDefenderAPI

java.lang.Object
me.EtienneDx.RealEstate.ClaimAPI.GriefDefender.GriefDefenderAPI
All Implemented Interfaces:
IClaimAPI

public class GriefDefenderAPI extends Object implements IClaimAPI
GriefDefenderAPI is an implementation of the IClaimAPI interface that integrates with the GriefDefender plugin.

It provides methods to retrieve claims, save claims, access player data, change claim ownership, and register event listeners for claim-related events.

  • Constructor Details

    • GriefDefenderAPI

      public GriefDefenderAPI()
      Default constructor for GriefDefenderAPI.
  • Method Details

    • getClaimAt

      public IClaim getClaimAt(org.bukkit.Location location)
      Retrieves the claim at the specified Bukkit location.
      Specified by:
      getClaimAt in interface IClaimAPI
      Parameters:
      location - the Bukkit location where the claim is being checked
      Returns:
      an IClaim instance representing the claim at the given location
    • saveClaim

      public void saveClaim(IClaim claim)
      Saves the specified claim.

      Note: GriefDefender automatically saves claims, so no additional action is required.

      Specified by:
      saveClaim in interface IClaimAPI
      Parameters:
      claim - the claim to save
    • getPlayerData

      public IPlayerData getPlayerData(UUID player)
      Retrieves the player data for the specified player UUID.
      Specified by:
      getPlayerData in interface IClaimAPI
      Parameters:
      player - the UUID of the player whose claim data is to be retrieved
      Returns:
      an IPlayerData instance representing the player's claim data
    • changeClaimOwner

      public void changeClaimOwner(IClaim claim, UUID newOwner)
      Changes the owner of the specified claim to a new owner.
      Specified by:
      changeClaimOwner in interface IClaimAPI
      Parameters:
      claim - the claim whose ownership is to be changed
      newOwner - the UUID of the new owner
      Throws:
      RuntimeException - if the transfer of ownership is unsuccessful
    • registerEvents

      public void registerEvents()
      Registers event listeners for GriefDefender integration.

      This method initializes the GriefDefender permission listener.

      Specified by:
      registerEvents in interface IClaimAPI