Interface Core


public interface Core
  • Method Details

    • isEnabled

      boolean isEnabled(UUID worldUniqueId)
      Checks if GriefDefender is enabled in world.
      Parameters:
      worldProperties - The world properties to check.
      Returns:
      true if enabled, false if not
    • getClaimBlockSystem

      ClaimBlockSystem getClaimBlockSystem()
      Gets the claim block system used.
      Returns:
      The claim block system
    • isEconomyModeEnabled

      boolean isEconomyModeEnabled()
      Checks if economy mode is enabled on server.
    • isProtectionModuleEnabled

      boolean isProtectionModuleEnabled(Flag flag)
      Checks if the protection module is enabled for flag.
      Parameters:
      flag - The claim flag to check
      Returns:
      true if enabled, false if not
    • getPlayerData

      @Nullable PlayerData getPlayerData(UUID worldUniqueId, UUID playerUniqueId)
      Gets the world PlayerData for specified UUID.
      Parameters:
      playerUniqueId - The player UUID
      worldProperties - The world properties
      Returns:
      The player data associated with uuid, if available
    • getClaim

      @Nullable Claim getClaim(UUID uuid)
      Gets the claim with uuid.
      Returns:
      The claim with uuid, if available
    • getClaim

      @Nullable Claim getClaim(UUID ownerUniqueId, String friendlyIdentifier)
      Gets the claim with friendly identifier.

      Note: Use AdminUser UUID for admin claims.
      Note: Use WildernessUser UUID for wilderness claims.
      Note: Use player UUID for player owned claims.
      Parameters:
      ownerUniqueId - The owner UUID of claim
      friendlyIdentifier - The friendly name of claim
      Returns:
      The claim with friendly identifier, if available
    • getClaimAt

      @Nullable Claim getClaimAt(Object location)
      Gets the claim at location.
      Parameters:
      location - The location
      Returns:
      The claim, if available
    • getClaimAt

      @Nullable Claim getClaimAt(UUID worldUniqueId, int x, int y, int z)
      Gets the claim at location.
      Parameters:
      worldUniqueId - The world uuid
      x - The location block X coord
      y - The location block Y coord
      z - The location block Z coord
      Returns:
      The claim, if available
    • getWorldUniqueId

      @Nullable UUID getWorldUniqueId(Object world)
      Gets the UUID of world.
      Parameters:
      world - The world object or identifier
      Returns:
      The world UUID, if available
    • getFriendlyIdentifierMapView

      Map<UUID,Map<String,UUID>> getFriendlyIdentifierMapView()
      Gets an unmodifiable map view of friendly claim identifiers.
      Returns:
      The unmodifiable map view, empty map if none exist
    • getAllClaims

      List<Claim> getAllClaims()
      Gets an immutable list of all Claim's.
      Returns:
      An immutable list of all claims, empty list if none were found
    • getAllPlayerClaims

      List<Claim> getAllPlayerClaims(UUID playerUniqueId)
      Gets an immutable list of all player Claim's.

      Note: This will return an empty list if player has no claims.
      Parameters:
      playerUniqueId - The player UUID
      Returns:
      An immutable list of all claims, empty list if none were found
    • getClaimManager

      @Nullable ClaimManager getClaimManager(UUID worldUniqueId)
      Gets the claim manager of world.
      Parameters:
      worldUniqueId - The world uuid
      Returns:
      The claim manager of world
    • getDefaultSubject

      Subject getDefaultSubject()
      Gets the default Subject.

      Note: This subject is used to apply permissions to all users.
      Returns:
      The default subject
    • getSubject

      Subject getSubject(String identifier)
      Gets the Subject with identifier.
      Parameters:
      identifier -
      Returns:
      The subject
    • getAdminUser

      User getAdminUser()
      Gets the admin User.

      Note: This user represents the owner of admin claims.
      Returns:
      The admin user
    • getWildernessUser

      User getWildernessUser()
      Gets the wilderness User.

      Note: This user represents the owner of all wilderness claims.
      Returns:
      The wilderness user
    • getUser

      @Nullable User getUser(UUID uuid)
      Gets the User with UUID.
      Parameters:
      uuid - The uuid
      Returns:
      The user, if available
    • getDefaultFlagDefinitionGroup

      Group getDefaultFlagDefinitionGroup()
      Gets the default
      invalid reference
      FlagDefinition
      Group.

      Note: This group is used to apply default flag definition permissions to all users.
      Returns:
      The default flag definition group
    • getDefaultOptionDefinitionGroup

      Group getDefaultOptionDefinitionGroup()
      Gets the default
      invalid reference
      OptionDefinition
      Group.

      Note: This group is used to apply default option definition permissions to all users.
      Returns:
      The default option definition group
    • getGroup

      Group getGroup(String name)
      Gets the Group with identifier.
      Parameters:
      identifier -
      Returns:
      The subject
    • getClanProvider

      @Nullable ClanProvider getClanProvider()
      Gets the ClanProvider.

      Note: This will return null if a Clan plugin is not installed.
      Returns:
      The clan provider, if available
    • getWorldEditProvider

      @Nullable WorldEditProvider getWorldEditProvider()
      Gets the WorldEditProvider.

      Note: This will return null if WorldEdit is not installed.
      Returns:
      The worldedit provider, if available
    • deleteAdminClaimSnapshot

      boolean deleteAdminClaimSnapshot(String name)
      Deletes an admin ClaimSnapshot.
      Parameters:
      name - The name of snapshot to delete
      type - The type of snapshot to delete
      Returns:
      true if snapshot was deleted, false otherwise
    • deleteAdminClaimSnapshot

      boolean deleteAdminClaimSnapshot(String group, String name)
      Deletes an admin ClaimSnapshot in specified snapshot group.
      Parameters:
      group - The name of snapshot group to search in
      name - The name of snapshot to delete
      type - The type of snapshot to delete
      Returns:
      true if snapshot was deleted, false otherwise
    • deletePublicClaimSnapshot

      boolean deletePublicClaimSnapshot(String name)
      Deletes a public ClaimSnapshot.
      Parameters:
      name - The name of snapshot to delete
      type - The type of snapshot to delete
      Returns:
      true if snapshot was deleted, false otherwise
    • deletePublicClaimSnapshot

      boolean deletePublicClaimSnapshot(String group, String name)
      Deletes a public ClaimSnapshot in specified snapshot group.
      Parameters:
      group - The name of snapshot group to search in
      name - The name of snapshot to delete
      type - The type of snapshot to delete
      Returns:
      true if snapshot was deleted, false otherwise
    • getAdminClaimSnapshots

      Map<String,Map<String,ClaimSnapshot>> getAdminClaimSnapshots()
      Gets the current map view of admin ClaimSnapshot's.
      Returns:
      An unmodifiable map view of admin claim snapshots
    • getPublicClaimSnapshots

      Map<String,Map<String,ClaimSnapshot>> getPublicClaimSnapshots()
      Gets the current map view of public ClaimSnapshot's.
      Returns:
      An unmodifiable map view of public claim snapshots
    • getAdminClaimGroupsByName

      Map<String,ClaimGroup> getAdminClaimGroupsByName()
      Gets the current map view of admin ClaimGroup's by name.
      Returns:
      An unmodifiable map view of admin claim groups
    • getAdminClaimGroupsByUUID

      Map<UUID,ClaimGroup> getAdminClaimGroupsByUUID()
      Gets the current map view of admin ClaimGroup's by UUID.
      Returns:
      An unmodifiable map view of admin claim groups
    • getPlayerClaimGroupsByName

      Map<String,ClaimGroup> getPlayerClaimGroupsByName(UUID playerUniqueId)
      Gets the current map view of player ClaimGroup's by name.
      Parameters:
      playerUniqueId - The player uuid
      Returns:
      An unmodifiable map view of player claim groups
    • getPlayerClaimGroupsByUUID

      Map<UUID,ClaimGroup> getPlayerClaimGroupsByUUID(UUID playerUniqueId)
      Gets the current map view of player ClaimGroup's by UUID.
      Parameters:
      playerUniqueId - The player uuid
      Returns:
      An unmodifiable map view of player claim groups
    • getClaimGroupByUUID

      @Nullable ClaimGroup getClaimGroupByUUID(UUID uuid)
      Gets a ClaimGroup associated with uuid.
      Parameters:
      uuid - The claim group uuid to search for.
      Returns:
      The claim group, if available
    • deleteAdminClaimGroup

      CompletableFuture<PermissionResult> deleteAdminClaimGroup(String group)
      Deletes an admin ClaimGroup.

      Note: This will automatically unjoin any Claim currently joined to claim group. Use with caution.
      Parameters:
      group - The name of the claim group to delete
      Returns:
      The permission result future
    • deletePlayerClaimGroup

      CompletableFuture<PermissionResult> deletePlayerClaimGroup(UUID uuid, String group)
      Deletes a player ClaimGroup.

      Note: This will automatically unjoin any Claim currently joined to claim group. Use with caution.
      Parameters:
      uuid - The uuid of player
      group - The name of the claim group to delete
      Returns:
      The permission result future
    • canUseCommand

      CommandResult canUseCommand(Object sender, TrustType trustType, @Nullable String claimIdentifier)
      Checks if the command sender can use the command at its location.
      Parameters:
      sender - The command sender
      trustType - The trust type
      claimIdentifier - The claim identifier if check is for another claim
      Returns:
      The command result