Class PlayerDataPurgeEvent
java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.player.PlayerDataPurgeEvent
- All Implemented Interfaces:
Cancellable
Gets called right before some (or all) parts of player's data gets cleared.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPlayerDataPurgeEvent(@Nullable CommandSender executingSender, @Nullable UUID affectedPlayerUUID, boolean purgeStats, boolean purgeAchievements, boolean purgeProperties, boolean isCacheOnly, @Nullable Set<String> statSetIds) -
Method Summary
Modifier and TypeMethodDescription@Nullable UUIDThe UUID of the player that is affected with this event.@Nullable CommandSenderTheCommandSenderwho sent the command to reset all player stats.static HandlerListGet the stat sets that shall be purged.booleanWhether achievements shall be purged.booleanWhether all players are affected from this purge, and not just a single one.booleanWhether properties shall be purged.booleanWhether stats shall be purged.booleanWhether only the local cache is affected.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerDataPurgeEvent
public PlayerDataPurgeEvent(@Nullable @Nullable CommandSender executingSender, @Nullable @Nullable UUID affectedPlayerUUID, boolean purgeStats, boolean purgeAchievements, boolean purgeProperties, boolean isCacheOnly, @Nullable @Nullable Set<String> statSetIds)
-
-
Method Details
-
getExecutingSender
TheCommandSenderwho sent the command to reset all player stats.Maybe be
nullif it e.g. has been executed via the API.- Returns:
- The (optional)
CommandSendertrying to clear all player stats
-
getAffectedPlayerUUID
The UUID of the player that is affected with this event.nullmeans that ALL players are affected by this purge. If all players are affected,isAffectingAllPlayers()returnstrue.- Returns:
- The (optional) uuid of the player from whom the data shall be purged
-
isAffectingAllPlayers
public boolean isAffectingAllPlayers()Whether all players are affected from this purge, and not just a single one.In case
isCacheOnly()returns true, this method only refers to players that are on this single server.- Returns:
truein case this purge will affect all players
-
isAffectingStats
public boolean isAffectingStats()Whether stats shall be purged.- Returns:
trueif the stats are being affected
-
isAffectingProperties
public boolean isAffectingProperties()Whether properties shall be purged.- Returns:
trueif the properties are being affected
-
isAffectingAchievements
public boolean isAffectingAchievements()Whether achievements shall be purged.- Returns:
trueif the achievements are being affected
-
isCacheOnly
public boolean isCacheOnly()Whether only the local cache is affected.truewould mean that the applied properties affect ALL servers and the WHOLE permanent database.falsewould mean that it'd only apply it for all locally (on this server) cached players.- Returns:
- Whether only the local cache shall be purged
-
getRestrictedStatSetIds
Get the stat sets that shall be purged.It may occur that only certain stat sets shall be purged. In this case,
isAffectingStats()returns true and this method returns a non-null set of the affected stat set ids.The returned set is not modifiable.
- Returns:
- The set of stat set ids that shall be purged. May be
nullif there's no restriction
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-