Class PlayerDataPurgeEvent

java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.player.PlayerDataPurgeEvent
All Implemented Interfaces:
Cancellable

public class PlayerDataPurgeEvent extends Event implements Cancellable
Gets called right before some (or all) parts of player's data gets cleared.
  • Constructor Details

    • PlayerDataPurgeEvent

      public PlayerDataPurgeEvent(@Nullable @Nullable CommandSender executingSender, @Nullable @Nullable UUID affectedPlayerUUID, boolean purgeStats, boolean purgeAchievements, boolean purgeProperties, boolean isCacheOnly)
  • Method Details

    • getExecutingSender

      @Nullable public @Nullable CommandSender getExecutingSender()
      The CommandSender 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

      @Nullable public @Nullable UUID 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() returns true.

      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
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()