Package com.yottabyte.crates.api.data
Interface PlayerData
-
public interface PlayerData
Represents the data for a player.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addKeys(String crateId, long amount)
Gives an amount of crate keys to a player by the crate's identifier.long
getKeys(String crateId)
Gets the total amount of keys the player has by the crate's identifier.BigInteger
getTotalUsedKeys()
Gets the total amount of crate keys used by the player.long
getUsedKeys(String crateId)
Gets the total amount of crate keys used by the player by the crate's identifier.UUID
getUuid()
Gets theUUID
of thePlayer
boolean
hasKeys()
Checks whether the player has any crate keys.boolean
hasUsedKeys()
Checks whether the player has used any crate keys.boolean
incrementUsedKeys(String crateId, long amount)
Increments the total amount of crate keys used by the player by the crate's identifier.boolean
removeKeys(String crateId, long amount)
Removes an amount of crate keys from a player by the crate's identifier.boolean
setKeys(String crateId, long amount)
Sets the amount of crate keys of a player by the crate's identifier.
-
-
-
Method Detail
-
hasKeys
boolean hasKeys()
Checks whether the player has any crate keys.- Returns:
- true if the player has any crate keys and false otherwise.
-
getKeys
long getKeys(String crateId)
Gets the total amount of keys the player has by the crate's identifier.- Parameters:
crateId
- the identifier of the crate- Returns:
- the total amount of keys the player has for the given crate.
-
addKeys
boolean addKeys(String crateId, long amount)
Gives an amount of crate keys to a player by the crate's identifier.- Parameters:
crateId
- the identifier of the crateamount
- the amount of keys to add- Returns:
- true if the keys were added successfully and false otherwise.
-
setKeys
boolean setKeys(String crateId, long amount)
Sets the amount of crate keys of a player by the crate's identifier.- Parameters:
crateId
- the identifier of the crateamount
- the amount of keys to set- Returns:
- true if the keys were set successfully and false otherwise.
-
removeKeys
boolean removeKeys(String crateId, long amount)
Removes an amount of crate keys from a player by the crate's identifier.- Parameters:
crateId
- the identifier of the crateamount
- the amount of keys to remove- Returns:
- true if the keys were removed successfully and false otherwise.
-
hasUsedKeys
boolean hasUsedKeys()
Checks whether the player has used any crate keys.- Returns:
- true if the player has used any keys and false otherwise.
-
getTotalUsedKeys
BigInteger getTotalUsedKeys()
Gets the total amount of crate keys used by the player.- Returns:
- the total amount of crate keys used by the player.
-
getUsedKeys
long getUsedKeys(String crateId)
Gets the total amount of crate keys used by the player by the crate's identifier.- Parameters:
crateId
- the identifier of the crate- Returns:
- the total amount of crate keys used by the player for the given crate.
-
incrementUsedKeys
boolean incrementUsedKeys(String crateId, long amount)
Increments the total amount of crate keys used by the player by the crate's identifier.- Parameters:
crateId
- the identifier of the crateamount
- the amount of keys to increment- Returns:
- true if the keys were incremented successfully and false otherwise.
-
-