Class QuitPlayerMemory
- All Implemented Interfaces:
- Metadatable
Used to keep track of all prior players who already have left. Also used to store data for a player's rejoin capability.
- 
Constructor SummaryConstructorsConstructorDescriptionQuitPlayerMemory(UUID uniqueId, String username, Team team, boolean rejoinPermitted, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) QuitPlayerMemory(OfflinePlayer player, Team team, boolean rejoinPermitted, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns a map containing all the corresponding buy-group levels of the player.booleanSet 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.intReturns the amount of resources the player has spent in the shop.@Nullable BukkitTaskReturns 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.booleanhasMetadata(String key) booleanReturns if the player is able to rejoin the match.voidremoveMetadata(String key, Plugin plugin) voidsetBypassTraps(boolean bypassTraps) Set if the player is able to bypass traps.voidsetLastJoinTime(Instant time) Set the time when the player has the last time (re)joined the matchvoidsetMetadata(String key, MetadataValue value) voidsetPlayTime(Duration playTime) Set the total play time the player has been within the match.voidsetQuitTime(Instant time) Set the time when the player has the last time quit the arena.voidsetRejoinPermitted(boolean rejoinPermitted) Set if the player is able to rejoin the match.voidsetShopResourcesSpentAmount(int amount) Set the amount of resources the player has spent in the shop.voidsetSoloRejoinTask(@Nullable BukkitTask task) Set the task used to eliminate a team if no players rejoin in the configured time.voidSet the team to which the player belongs to.
- 
Constructor Details- 
QuitPlayerMemorypublic QuitPlayerMemory(OfflinePlayer player, Team team, boolean rejoinPermitted, Instant lastJoinTime, Instant quitTime, Duration playTime, boolean bypassTraps, Inventory playerPrivateInventory, @Nullable @Nullable BukkitTask soloRejoinTask, int shopResourcesSpentAmount) 
- 
QuitPlayerMemory
 
- 
- 
Method Details- 
getUniqueIdReturns the uuid (OfflinePlayer.getUniqueId()) of the player.- Returns:
- The uniqueId of the player
 
- 
getUsernameReturns the name (OfflinePlayer.getName()) of the player.- Returns:
- The username of the player
 
- 
getTeamReturns the team to which he belongs to.- Returns:
- The team of the player
 
- 
setTeamSet the team to which the player belongs to.- Parameters:
- team- The new team of the player
 
- 
isRejoinPermittedpublic boolean isRejoinPermitted()Returns if the player is able to rejoin the match.A player may not be permitted if e.g. his team's elimination was the cause for him to quit. - Returns:
- if the player can rejoin
 
- 
setRejoinPermittedpublic void setRejoinPermitted(boolean rejoinPermitted) Set if the player is able to rejoin the match.A player may not be permitted if e.g. his team's elimination was the cause for him to quit. - Parameters:
- rejoinPermitted- if the player can rejoin
 
- 
getBypassTrapspublic boolean getBypassTraps()Set if the player is able to bypass traps.- Returns:
- if the player can bypass traps
 
- 
setBypassTrapspublic void setBypassTraps(boolean bypassTraps) Set if the player is able to bypass traps.- Parameters:
- bypassTraps- if the player can bypass traps
 
- 
getLastJoinTimeReturns the time when the player has the last (re)joined the match.- Returns:
- The previous time the player joined the arena
 
- 
setLastJoinTimeSet the time when the player has the last time (re)joined the match- Parameters:
- time- The new previous time the player joined the arena
 
- 
getQuitTimeReturns the time when the player has quit the arena.- Returns:
- The time the player decided to leave the match
 
- 
setQuitTimeSet the time when the player has the last time quit the arena.- Parameters:
- time- The new time the player decided to leave the match
 
- 
getPlayTimeReturns 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
 
- 
setPlayTimeSet the total play time the player has been within the match.- Parameters:
- playTime- The new play time
 
- 
getBuyGroupLevelsReturns 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
 
- 
getPlayerPrivateInventoryReturns 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
 
- 
getOneTimePurchaseBoughtItemsReturns 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
 
- 
getSoloRejoinTaskReturns 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. nullif there were other players on the team still
 
- 
setSoloRejoinTaskSet 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.- nullif there were other players on the team still
 
- 
getGameStatsReturns 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:
 
- 
getShopResourcesSpentAmountpublic int getShopResourcesSpentAmount()Returns the amount of resources the player has spent in the shop.This number is used for the DefaultPlayerAchievement.SPEND_200_RESOURCESachievement.- Returns:
- The amount of resources the player has spent
 
- 
setShopResourcesSpentAmountpublic 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_RESOURCESachievement.- Parameters:
- amount- The new amount of resources the player has spent
 
- 
getMetadata- Specified by:
- getMetadatain interface- Metadatable
 
- 
hasMetadata- Specified by:
- hasMetadatain interface- Metadatable
 
- 
removeMetadata- Specified by:
- removeMetadatain interface- Metadatable
 
- 
setMetadata- Specified by:
- setMetadatain interface- Metadatable
 
 
-