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
ConstructorDescriptionPlayerDataPurgeEvent
(@Nullable CommandSender executingSender, @Nullable UUID affectedPlayerUUID, boolean purgeStats, boolean purgeAchievements, boolean purgeProperties, boolean isCacheOnly, @Nullable Set<String> statSetIds) -
Method Summary
Modifier and TypeMethodDescription@Nullable UUID
The UUID of the player that is affected with this event.@Nullable CommandSender
TheCommandSender
who sent the command to reset all player stats.static HandlerList
Get the stat sets that shall be purged.boolean
Whether achievements shall be purged.boolean
Whether all players are affected from this purge, and not just a single one.boolean
Whether properties shall be purged.boolean
Whether stats shall be purged.boolean
Whether only the local cache is affected.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
TheCommandSender
who sent the command to reset all player stats.Maybe be
null
if it e.g. has been executed via the API.- Returns:
- The (optional)
CommandSender
trying to clear all player stats
-
getAffectedPlayerUUID
The UUID of the player that is affected with this event.null
means 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:
true
in case this purge will affect all players
-
isAffectingStats
public boolean isAffectingStats()Whether stats shall be purged.- Returns:
true
if the stats are being affected
-
isAffectingProperties
public boolean isAffectingProperties()Whether properties shall be purged.- Returns:
true
if the properties are being affected
-
isAffectingAchievements
public boolean isAffectingAchievements()Whether achievements shall be purged.- Returns:
true
if the achievements are being affected
-
isCacheOnly
public boolean isCacheOnly()Whether only the local cache is affected.true
would mean that the applied properties affect ALL servers and the WHOLE permanent database.false
would 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
null
if there's no restriction
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-