Class QuitPlayerMemory
- All Implemented Interfaces:
Metadatable
-
Constructor Summary
ConstructorDescriptionQuitPlayerMemory
(UUID uniqueId, String username, Team team, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) QuitPlayerMemory
(OfflinePlayer player, Team team, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) -
Method Summary
Modifier and TypeMethodDescriptionReturns a map containing all the corresponding buy-group levels of the player.boolean
Set if the player is able to bypass traps.Returns the internal map that represents the game stats of the player.Returns the time when the player has the last (re)joined the match.getMetadata
(String key) Returns all ShopItems the player has bought which haveShopItem.isOneTimePurchase()
set to true.Returns the players private inventory, used for ender chests in some configurations.Returns the duration that the player has been within the match.Returns the time when the player has quit the arena.int
Returns the amount of resources the player has spent in the shop.@Nullable BukkitTask
Returns the task used to eliminate a team if no players rejoin in the configured time.getTeam()
Returns the team to which he belongs to.Returns the uuid (OfflinePlayer.getUniqueId()
) of the player.Returns the name (OfflinePlayer.getName()
) of the player.boolean
hasMetadata
(String key) void
removeMetadata
(String key, Plugin plugin) void
setBypassTraps
(boolean bypassTraps) Set if the player is able to bypass traps.void
setLastJoinTime
(Instant time) Set the time when the player has the last time (re)joined the matchvoid
setMetadata
(String key, MetadataValue value) void
setPlayTime
(Duration playTime) Set the total play time the player has been within the match.void
setQuitTime
(Instant time) Set the time when the player has the last time quit the arena.void
setShopResourcesSpentAmount
(int amount) Set the amount of resources the player has spent in the shop.void
setSoloRejoinTask
(@Nullable BukkitTask task) Set the task used to eliminate a team if no players rejoin in the configured time.void
Set the team to which the player belongs to.
-
Constructor Details
-
QuitPlayerMemory
public QuitPlayerMemory(OfflinePlayer player, Team team, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) -
QuitPlayerMemory
-
-
Method Details
-
getUniqueId
Returns the uuid (OfflinePlayer.getUniqueId()
) of the player.- Returns:
- The uniqueId of the player
-
getUsername
Returns the name (OfflinePlayer.getName()
) of the player.- Returns:
- The username of the player
-
getTeam
Returns the team to which he belongs to.- Returns:
- The team of the player
-
setTeam
Set the team to which the player belongs to.- Parameters:
team
- The new team of the player
-
getBypassTraps
public boolean getBypassTraps()Set if the player is able to bypass traps.- Returns:
- if the player can bypass traps
-
setBypassTraps
public void setBypassTraps(boolean bypassTraps) Set if the player is able to bypass traps.- Parameters:
bypassTraps
- if the player can bypass traps
-
getLastJoinTime
Returns the time when the player has the last (re)joined the match.- Returns:
- The previous time the player joined the arena
-
setLastJoinTime
Set the time when the player has the last time (re)joined the match- Parameters:
time
- The new previous time the player joined the arena
-
getQuitTime
Returns the time when the player has quit the arena.- Returns:
- The time the player decided to leave the match
-
setQuitTime
Set the time when the player has the last time quit the arena.- Parameters:
time
- The new time the player decided to leave the match
-
getPlayTime
Returns the duration that the player has been within the match.The returned value may not match
getQuitTime()
minusgetLastJoinTime()
as the player may rejoined multiple times.- Returns:
- The play time of the player
-
setPlayTime
Set the total play time the player has been within the match.- Parameters:
playTime
- The new play time
-
getBuyGroupLevels
Returns a map containing all the corresponding buy-group levels of the player. Not all existing buy-groups may be present.It is safe to modify the entries of the Map.
- Returns:
- A map storing the buy-groups of the player
-
getPlayerPrivateInventory
Returns the players private inventory, used for ender chests in some configurations.It is safe to modify the contents of the Inventory.
- Returns:
- The private inventory belong to the player
-
getOneTimePurchaseBoughtItems
Returns all ShopItems the player has bought which haveShopItem.isOneTimePurchase()
set to true.It is safe to modify the entries of the Set.
- Returns:
- All one-time-purchase items that have been bought
-
getSoloRejoinTask
Returns the task used to eliminate a team if no players rejoin in the configured time.If you dont want this team to be eliminated if the player does not rejoin, simply cancel this task.
- Returns:
- The task that will eliminate the players team if he leaves the team empty.
null
if there were other players on the team still
-
setSoloRejoinTask
Set the task used to eliminate a team if no players rejoin in the configured time.Note: This doesn't cancel the current task if it exists. Make sure to cancel it before setting a new one.
- Parameters:
task
- The task that will eliminate the players team if he leaves the team empty.null
if there were other players on the team still
-
getGameStats
Returns the internal map that represents the game stats of the player.Note that they won't be added to the actual stats thereafter. They only exist for representiation purposes.
- Returns:
- The game stats of the player
- See Also:
-
getShopResourcesSpentAmount
public int getShopResourcesSpentAmount()Returns the amount of resources the player has spent in the shop.This number is used for the
DefaultPlayerAchievement.SPEND_200_RESOURCES
achievement.- Returns:
- The amount of resources the player has spent
-
setShopResourcesSpentAmount
public void setShopResourcesSpentAmount(int amount) Set the amount of resources the player has spent in the shop.This number is used for the
DefaultPlayerAchievement.SPEND_200_RESOURCES
achievement.- Parameters:
amount
- The new amount of resources the player has spent
-
getMetadata
- Specified by:
getMetadata
in interfaceMetadatable
-
hasMetadata
- Specified by:
hasMetadata
in interfaceMetadatable
-
removeMetadata
- Specified by:
removeMetadata
in interfaceMetadatable
-
setMetadata
- Specified by:
setMetadata
in interfaceMetadatable
-