Interface PlayerData


public interface PlayerData
  • Method Details

    • getUser

      User getUser()
      Gets the User.
      Returns:
      The user associated with player data
    • getUniqueId

      UUID getUniqueId()
      Gets the UUID of player.
      Returns:
      The unique identifier
    • getName

      String getName()
      Gets the player name.
      Returns:
      The player name
    • getClaims

      Set<Claim> getClaims()
      Gets an unmodifiable set view of claims owned by this player.
      Returns:
      The unmodifiable set view of owned claims, empty if none
    • getCurrentClaim

      @Nullable Claim getCurrentClaim()
      Gets the current Claim player is in. Note: This will return no claim if player is offline.
      Returns:
      The current claim
    • getAbandonedReturnRatio

      double getAbandonedReturnRatio(ClaimType type)
      Gets the abandon return ratio used when abandoning a claim.
      Parameters:
      type - The claim type to check
      Returns:
      The abandon return ratio
    • getAccruedClaimBlocks

      int getAccruedClaimBlocks()
      Gets the total accrued claim blocks. Note: This does not include initial claim blocks.
      Returns:
      The total accrued claim blocks
    • getBlocksAccruedPerHour

      int getBlocksAccruedPerHour()
      Gets the blocks accrued per hour.
      Returns:
      The blocks accrued per hour
    • getMaxAccruedClaimBlocks

      int getMaxAccruedClaimBlocks()
      Gets the max amount of accrued claim blocks a player can hold.
      Returns:
      The max amount of accrued claim blocks
    • getMaxBonusClaimBlocks

      int getMaxBonusClaimBlocks()
      Gets the max amount of bonus claim blocks a player can hold.
      Returns:
      The max amount of bonus claim blocks
    • getMaxClaimLevel

      int getMaxClaimLevel()
      Gets the max level for claim creation.
      Returns:
      The max level
    • getMaxClaimX

      int getMaxClaimX(ClaimType type)
      Gets the max size limit of x, in blocks, for claim creation.
      Parameters:
      type - The claim type to check
      Returns:
      The max size of x
    • getMaxClaimY

      int getMaxClaimY(ClaimType type)
      Gets the max size limit of y, in blocks, for claim creation. Note: This option is ignored for 2D claims.
      Parameters:
      type - The claim type to check
      Returns:
      The max size of y
    • getMaxClaimZ

      int getMaxClaimZ(ClaimType type)
      Gets the max size limit of z, in blocks, for claim creation.
      Parameters:
      type - The claim type to check
      Returns:
      The max size of z
    • getMinClaimLevel

      int getMinClaimLevel()
      Gets the minimum level for claim creation.
      Returns:
      The minimum level
    • getMinClaimX

      int getMinClaimX(ClaimType type)
      Gets the minimum size limit of x, in blocks, for claim creation.
      Parameters:
      type - The claim type to check
      Returns:
      The minimum size of x
    • getMinClaimY

      int getMinClaimY(ClaimType type)
      Gets the minimum size limit of y, in blocks, for claim creation. Note: This option is ignored for 2D claims.
      Parameters:
      type - The claim type to check
      Returns:
      The minimum size of y
    • getMinClaimZ

      int getMinClaimZ(ClaimType type)
      Gets the minimum size limit of z, in blocks, for claim creation.
      Parameters:
      type - The claim type to check
      Returns:
      The minimum size of z
    • getBonusClaimBlocks

      int getBonusClaimBlocks()
      Gets the total bonus claim blocks.
      Returns:
      The total bonus claim blocks
    • getInitialClaimBlocks

      int getInitialClaimBlocks()
      Gets the initial claim blocks.
      Returns:
      The initial claim blocks
    • getRemainingClaimBlocks

      int getRemainingClaimBlocks()
      Gets the remaining claim blocks.
      Returns:
      The remaining claim blocks
    • getRemainingPvpCombatTime

      int getRemainingPvpCombatTime(Claim claim)
      Gets the remaining pvp combat time in seconds.
      Parameters:
      claim - The claim to check in
      Returns:
      The remaining pvp combat time
    • getChestClaimExpiration

      int getChestClaimExpiration()
      Gets the amount of days for this player's auto-created chest claim's to expire.
      Returns:
      The amount of days for chest claims to expire
    • getClaimCreateMode

      CreateModeType getClaimCreateMode()
      Gets the claim CreateModeType for player on login.
      Returns:
      The claim creation mode
    • getCreateClaimLimit

      int getCreateClaimLimit(ClaimType type)
      Gets the max amount of claims this player can create for a specific ClaimType.
      Parameters:
      type - The claim type
      Returns:
      The max create claim limit
    • getMaxClaimableBlocks

      int getMaxClaimableBlocks()
      Gets the max amount of blocks this player can claim.
      Returns:
      The max amount of claimable blocks
    • getRentalLimit

      int getRentalLimit()
      Gets the rental limit of this player.
      Returns:
      The rental limit
    • setRentalLimit

      CompletableFuture<PermissionResult> setRentalLimit(int limit)
      Sets the rental limit of this player.
      Parameters:
      limit - The rental limit
      Returns:
      The permission result
    • getEconomyClaimBlockCost

      double getEconomyClaimBlockCost()
      Gets the economy claim block cost.
      Returns:
      The economy claim block cost
    • getEconomyClaimBlockReturn

      double getEconomyClaimBlockReturn()
      Gets the economy claim block return on selling a claim block.
      Note: This is only used if
      invalid reference
      GriefDefenderApi#isEconomyModeEnabled()
      is false.
      Returns:
      The economy claim block return
    • canBreak

      boolean canBreak(Object location)
      Checks if this player can break a block at specified location.
      Parameters:
      location - The target block location
      Returns:
      true if player can break, false if not
    • canPlace

      boolean canPlace(Object placedItem, Object location)
      Checks if this player can place a block at specified location.
      Parameters:
      placedItem - The item being placed
      location - The target block location
      Returns:
      true if player can place, false if not
    • canHurtEntity

      boolean canHurtEntity(Object itemStack, Object entity)
      Checks if this player can attack entity.
      Parameters:
      itemStack - The item being used to attack entity
      entity - The target entity
      Returns:
      true if entity can be attacked, false if not
    • canInteractWithEntity

      boolean canInteractWithEntity(Object itemStack, Object entity, TrustType trustType)
      Checks if this player can interact with entity.
      Parameters:
      itemStack - The item being used to interact with entity
      entity - The target entity
      trustType - The minimum TrustType required
      Returns:
      true if entity can be interacted with, false if not
    • canUseBlock

      boolean canUseBlock(Object location, TrustType trustType, boolean leftClick, boolean shift)
      Checks if this player can use a block at specified location.
      Parameters:
      location - The target block location
      trustType - The minimum TrustType required
      leftClick - If block will be activated on left-click
      shift - If block activation requires shift
      Returns:
      true if player can use block, false if not
    • canUseItem

      boolean canUseItem(Object itemStack, Object location, TrustType trustType, boolean leftClick, boolean shift)
      Checks if this player can use item at a specified location.
      Note: If item is custom, pass a string identifier in format 'modid:name'
      Note: If item is activated on right-click then 'leftClick' should be false.
      Parameters:
      itemStack - The target itemStack
      location - The location where item will be used
      trustType - The minimum TrustType required
      leftClick - If item will be activated on left-click
      shift - If item activation requires shift.
      Returns:
      true if player can use item, false if not
    • canIgnoreClaim

      boolean canIgnoreClaim(Claim claim)
      Checks if this player can ignore a claim.
      Parameters:
      claim - The claim to check
      Returns:
      Whether this player can ignore the claim
    • canPvp

      boolean canPvp(Claim claim)
      Checks if this player can pvp in Claim.
      Parameters:
      claim - The claim to check
      Returns:
      Whether player has ability to pvp inside claim
    • canManageAdminClaims

      boolean canManageAdminClaims()
      Checks if this player can manage admin claims.
      Returns:
      true if can manage, false if not
    • canManageWildernessClaims

      boolean canManageWildernessClaims()
      Checks if this player can manage wilderness claims.
      Returns:
      true if can manage, false if not
    • inPvpCombat

      boolean inPvpCombat()
      Checks if this player is in pvp combat.
      Returns:
      true if in pvp combat, false if not
    • setAccruedClaimBlocks

      CompletableFuture<PermissionResult> setAccruedClaimBlocks(int blocks)
      Sets the total amount of accrued claim blocks.
      Parameters:
      blocks - The new total of accrued claim blocks
      Returns:
      The permission result
    • setBonusClaimBlocks

      CompletableFuture<PermissionResult> setBonusClaimBlocks(int blocks)
      Sets the total amount of bonus claim blocks.
      Parameters:
      blocks - The new total of bonus claim blocks
      Returns:
      The permission result
    • getClaimSnapshots

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

      Map<String,ClaimGroup> getClaimGroupsByName()
      Gets the current map view of player ClaimGroup's this player is using.
      Returns:
      An unmodifiable map view of claim groups used by player
    • getClaimGroupsByUUID

      Map<UUID,ClaimGroup> getClaimGroupsByUUID()
      Gets the current map view of player ClaimGroup's this player is using.
      Returns:
      An unmodifiable map view of claim groups used by player
    • deleteClaimGroup

      CompletableFuture<PermissionResult> deleteClaimGroup(String name)
      Deletes a ClaimGroup from player.

      Note: Deleting a ClaimGroup will remove all claims associated with it causing the claim to use its own permissions.
      Parameters:
      group - The claim group to delete
      Returns:
      The permission result
    • deleteSnapshot

      boolean deleteSnapshot(String group, String name)
      Deletes the specified ClaimSnapshot if it exists in group.
      Parameters:
      group - The snapshot group
      name - The snapshot name to delete
      Returns:
      true if the snapshot was deleted
    • deleteSnapshot

      boolean deleteSnapshot(String name)
      Deletes the specified ClaimSnapshot if it exists. Note: This will only delete snapshots not associated with a group.
      Parameters:
      name - The snapshot name to delete
      Returns:
      true if the snapshot was deleted
    • getTaxRate

      double getTaxRate(ClaimType type)
      Gets the current tax rate for ClaimType.
      Parameters:
      type - The claim type
      Returns:
      The current tax rate
    • revertAllVisuals

      void revertAllVisuals()
      Reverts all current visuals.
    • revertVisual

      void revertVisual(Claim claim)
      Reverts the visual of a Claim.
      Parameters:
      claim - The claim to revert
    • revertVisual

      void revertVisual(UUID uuid)
      Reverts visual with UUID.
      Parameters:
      uuid - The visual uuid