Interface PlayerAchievements
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanearn(PlayerAchievement achievement) Will give the achievement to the player.booleanearn(PlayerAchievement achievement, boolean silent) Will give the achievement to the player.@Nullable OffsetDateTimegetEarnDate(PlayerAchievement achievement) Returns the date when he earned the achievement.Returns the ids of all achievements that he earned.Returns the UUID of the player.booleanhas(PlayerAchievement achievement) Returns if the player has a specific achievement.booleanAny changes made to this instance will not be saved, even if tried.booleanremove(PlayerAchievement achievement) Removes the achievement from the earned list.default voidsave()Asynchronously saves these achievements.voidAsynchronously saves these achievements.booleansetEarnDate(PlayerAchievement achievement, OffsetDateTime date) Sets the earn date of the achievement.voidsetReadOnly(boolean readOnly) Sets whether this instance is read-only.
- 
Method Details- 
getPlayerUUIDUUID getPlayerUUID()Returns the UUID of the player.- Returns:
- The UUID of the player who earned these achievements
 
- 
hasReturns if the player has a specific achievement.- Parameters:
- achievement- The achievement that we want to check
- Returns:
- trueif he has earned the achievement
 
- 
earnWill give the achievement to the player. Also displays a chat message that he earned if he's online.The operation might fail when the player already has the achievement or a plugin cancelled it via the PlayerEarnAchievementEvent. Additionally, prizers may be disabled within an arena (Arena.isPrizeForMatchEnabled()).- Parameters:
- achievement- The achievmeent that he shall earn
- Returns:
- truewhen the operation was successful
- Throws:
- IllegalArgumentException- When the id of the achievement doesn't fit the format
 
- 
earnWill give the achievement to the player. Also displays a chat message that he earned if he's online and whensilentis true.The operation might fail when the player already has the achievement or a plugin cancelled it via the PlayerEarnAchievementEvent. Additionally, prizers may be disabled within an arena (Arena.isPrizeForMatchEnabled()).- Parameters:
- achievement- The achievmeent that he shall earn
- silent- If it should notify the player or not
- Returns:
- truewhen the operation was successful
- Throws:
- IllegalArgumentException- When the id of the achievement doesn't fit the format
 
- 
removeRemoves the achievement from the earned list.- Parameters:
- achievement- The achievement that he once earned
- Returns:
- falseif he hasn't earned it. Otherwise- true
 
- 
getEarnDateReturns the date when he earned the achievement.- Parameters:
- achievement- The achievement
- Returns:
- The date when he earned it. Null if he never earned it before
 
- 
setEarnDateSets the earn date of the achievement.- Parameters:
- achievement- The achievement
- date- The new date
- Returns:
- falseif he never earned the achievement before
 
- 
getEarnedIdsReturns the ids of all achievements that he earned.- Returns:
- The id of all earned achievements
 
- 
isReadOnlyboolean isReadOnly()Any changes made to this instance will not be saved, even if tried.While it is possible to change the values, MBedwars' auto-saving and save()will not actually do anything and any changes will be lost with the next loading.Reasons for read-only are: - We failed to load it fully (due to an error). Reasons for that may include e.g. a disconnection to the storage server.
- The player might be online on another server and we don't want to intercept with whatever the other server is doing. Although cross-server support can be obtained using the ProxySync addon and making sure that player-data-syncing is enabled within it, in which case this instance won't be set as read-only.
 - Returns:
- Whether this instance is read-only and changes won't be saved
 
- 
setReadOnlyvoid setReadOnly(boolean readOnly) Sets whether this instance is read-only.This mechanism exists to prevent desyncs between multiple servers. Use it with caution! Read isReadOnly()for more info.- Parameters:
- readOnly- Whether this instance should be read-only
 
- 
savedefault void save()Asynchronously saves these achievements.It's usually not needed to call this method when the player is currently on the server as the plugin will already handle it. 
- 
saveAsynchronously saves these achievements.It's usually not needed to call this method when the player is currently on the server as the plugin will already handle it. Important: The callback doesn't get synced to the main thread. - Parameters:
- callback- Gets called when the operation was finished
 
 
-