Class GriefDefenderAPI
java.lang.Object
me.EtienneDx.RealEstate.ClaimAPI.GriefDefender.GriefDefenderAPI
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeClaimOwner
(IClaim claim, UUID newOwner) Changes the owner of the specified claim to a new owner.getClaimAt
(org.bukkit.Location location) Retrieves the claim at the specified Bukkit location.getPlayerData
(UUID player) Retrieves the player data for the specified player UUID.void
Registers event listeners for GriefDefender integration.void
Saves the specified claim.
-
Constructor Details
-
GriefDefenderAPI
public GriefDefenderAPI()Default constructor for GriefDefenderAPI.
-
-
Method Details
-
getClaimAt
Retrieves the claim at the specified Bukkit location.- Specified by:
getClaimAt
in interfaceIClaimAPI
- Parameters:
location
- the Bukkit location where the claim is being checked- Returns:
- an IClaim instance representing the claim at the given location
-
saveClaim
-
getPlayerData
Retrieves the player data for the specified player UUID.- Specified by:
getPlayerData
in interfaceIClaimAPI
- 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
Changes the owner of the specified claim to a new owner.- Specified by:
changeClaimOwner
in interfaceIClaimAPI
- Parameters:
claim
- the claim whose ownership is to be changednewOwner
- 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 interfaceIClaimAPI
-