Package com.griefdefender.api.data
Interface PlayerData
public interface PlayerData
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this player can break a block at specified location.booleancanHurtEntity(Object itemStack, Object entity) Checks if this player can attack entity.booleancanIgnoreClaim(Claim claim) Checks if this player can ignore a claim.booleancanInteractWithEntity(Object itemStack, Object entity, TrustType trustType) Checks if this player can interact with entity.booleanChecks if this player can manage admin claims.booleanChecks if this player can manage wilderness claims.booleanChecks if this player can place a block at specified location.booleanChecks if this player can pvp inClaim.booleancanUseBlock(Object location, TrustType trustType, boolean leftClick, boolean shift) Checks if this player can use a block at specified location.booleancanUseItem(Object itemStack, Object location, TrustType trustType, boolean leftClick, boolean shift) Checks if this player can use item at a specified location.deleteClaimGroup(String name) Deletes aClaimGroupfrom player.booleandeleteSnapshot(String name) Deletes the specifiedClaimSnapshotif it exists.booleandeleteSnapshot(String group, String name) Deletes the specifiedClaimSnapshotif it exists in group.doubleGets the abandon return ratio used when abandoning a claim.intGets the total accrued claim blocks.intGets the blocks accrued per hour.intGets the total bonus claim blocks.intGets the amount of days for this player's auto-created chest claim's to expire.Gets the claimCreateModeTypefor player on login.Gets the current map view of playerClaimGroup's this player is using.Gets the current map view of playerClaimGroup's this player is using.Gets an unmodifiable set view of claims owned by this player.Gets the current map view of playerClaimSnapshot's.intgetCreateClaimLimit(ClaimType type) Gets the max amount of claims this player can create for a specificClaimType.@Nullable ClaimGets the currentClaimplayer is in.doubleGets the economy claim block cost.doubleGets the economy claim block return on selling a claim block.intGets the initial claim blocks.intGets the max amount of accrued claim blocks a player can hold.intGets the max amount of bonus claim blocks a player can hold.intGets the max amount of blocks this player can claim.intGets the max level for claim creation.intgetMaxClaimX(ClaimType type) Gets the max size limit of x, in blocks, for claim creation.intgetMaxClaimY(ClaimType type) Gets the max size limit of y, in blocks, for claim creation.intgetMaxClaimZ(ClaimType type) Gets the max size limit of z, in blocks, for claim creation.intGets the minimum level for claim creation.intgetMinClaimX(ClaimType type) Gets the minimum size limit of x, in blocks, for claim creation.intgetMinClaimY(ClaimType type) Gets the minimum size limit of y, in blocks, for claim creation.intgetMinClaimZ(ClaimType type) Gets the minimum size limit of z, in blocks, for claim creation.getName()Gets the player name.intGets the remaining claim blocks.intgetRemainingPvpCombatTime(Claim claim) Gets the remaining pvp combat time in seconds.intGets the rental limit of this player.doublegetTaxRate(ClaimType type) Gets the current tax rate forClaimType.Gets theUUIDof player.getUser()Gets theUser.booleanChecks if this player is in pvp combat.voidReverts all current visuals.voidrevertVisual(Claim claim) Reverts the visual of aClaim.voidrevertVisual(UUID uuid) Reverts visual withUUID.setAccruedClaimBlocks(int blocks) Sets the total amount of accrued claim blocks.setBonusClaimBlocks(int blocks) Sets the total amount of bonus claim blocks.setRentalLimit(int limit) Sets the rental limit of this player.
-
Method Details
-
getUser
User getUser()Gets theUser.- Returns:
- The user associated with player data
-
getUniqueId
UUID getUniqueId()Gets theUUIDof player.- Returns:
- The unique identifier
-
getName
String getName()Gets the player name.- Returns:
- The player name
-
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 currentClaimplayer is in. Note: This will return no claim if player is offline.- Returns:
- The current claim
-
getAbandonedReturnRatio
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
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
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
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
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
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
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
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 claimCreateModeTypefor player on login.- Returns:
- The claim creation mode
-
getCreateClaimLimit
Gets the max amount of claims this player can create for a specificClaimType.- 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
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 ifis false.invalid reference
GriefDefenderApi#isEconomyModeEnabled()- Returns:
- The economy claim block return
-
canBreak
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
Checks if this player can place a block at specified location.- Parameters:
placedItem- The item being placedlocation- The target block location- Returns:
- true if player can place, false if not
-
canHurtEntity
Checks if this player can attack entity.- Parameters:
itemStack- The item being used to attack entityentity- The target entity- Returns:
- true if entity can be attacked, false if not
-
canInteractWithEntity
Checks if this player can interact with entity.- Parameters:
itemStack- The item being used to interact with entityentity- The target entitytrustType- The minimumTrustTyperequired- Returns:
- true if entity can be interacted with, false if not
-
canUseBlock
Checks if this player can use a block at specified location.- Parameters:
location- The target block locationtrustType- The minimumTrustTyperequiredleftClick- If block will be activated on left-clickshift- 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 itemStacklocation- The location where item will be usedtrustType- The minimumTrustTyperequiredleftClick- If item will be activated on left-clickshift- If item activation requires shift.- Returns:
- true if player can use item, false if not
-
canIgnoreClaim
Checks if this player can ignore a claim.- Parameters:
claim- The claim to check- Returns:
- Whether this player can ignore the claim
-
canPvp
Checks if this player can pvp inClaim.- 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
Sets the total amount of accrued claim blocks.- Parameters:
blocks- The new total of accrued claim blocks- Returns:
- The permission result
-
setBonusClaimBlocks
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, getClaimSnapshots()ClaimSnapshot>> Gets the current map view of playerClaimSnapshot's.- Returns:
- An unmodifiable map of player claim snapshots
-
getClaimGroupsByName
Map<String,ClaimGroup> getClaimGroupsByName()Gets the current map view of playerClaimGroup'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 playerClaimGroup's this player is using.- Returns:
- An unmodifiable map view of claim groups used by player
-
deleteClaimGroup
Deletes aClaimGroupfrom player.
Note: Deleting aClaimGroupwill 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
Deletes the specifiedClaimSnapshotif it exists in group.- Parameters:
group- The snapshot groupname- The snapshot name to delete- Returns:
- true if the snapshot was deleted
-
deleteSnapshot
Deletes the specifiedClaimSnapshotif 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
Gets the current tax rate forClaimType.- Parameters:
type- The claim type- Returns:
- The current tax rate
-
revertAllVisuals
void revertAllVisuals()Reverts all current visuals. -
revertVisual
Reverts the visual of aClaim.- Parameters:
claim- The claim to revert
-
revertVisual
Reverts visual withUUID.- Parameters:
uuid- The visual uuid
-