Class FlagValueChangeHandler<T>

java.lang.Object
com.sk89q.worldguard.session.handler.Handler
com.sk89q.worldguard.session.handler.FlagValueChangeHandler<T>
Direct Known Subclasses:
ExitFlag, GameModeFlag, InvincibilityFlag, NotifyEntryFlag, NotifyExitFlag, TimeLockFlag, WeatherLockFlag

public abstract class FlagValueChangeHandler<T> extends Handler
  • Constructor Details

    • FlagValueChangeHandler

      protected FlagValueChangeHandler(Session session, Flag<T> flag)
  • Method Details

    • initialize

      public final void initialize(LocalPlayer player, com.sk89q.worldedit.util.Location current, ApplicableRegionSet set)
      Description copied from class: Handler
      Called when the session is first being created or /wg flushstates is used.
      Overrides:
      initialize in class Handler
      Parameters:
      player - The player
      current - The player's current location
      set - The regions for the current location
    • uninitialize

      public final void uninitialize(LocalPlayer player, com.sk89q.worldedit.util.Location current, ApplicableRegionSet set)
      Description copied from class: Handler
      Called when the session should clear its caches.
      Overrides:
      uninitialize in class Handler
      Parameters:
      player - The player
      current - The player's current location
      set - The regions for the current location
    • onCrossBoundary

      public boolean onCrossBoundary(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType)
      Description copied from class: Handler
      Called when a player has moved into a new location.

      This is called only if the move test (Session.testMoveTo(LocalPlayer, Location, MoveType)) was successful.

      If this method returns false, then no other handlers will be run (for this move attempt).

      Overrides:
      onCrossBoundary in class Handler
      Parameters:
      player - The player
      from - The previous, valid, location
      to - The new location to test
      toSet - The regions for the new location
      entered - The list of regions that have been entered
      exited - The list of regions that have been left
      moveType - The type of move
      Returns:
      Whether the movement should be allowed
    • onInitialValue

      protected abstract void onInitialValue(LocalPlayer player, ApplicableRegionSet set, T value)
    • onSetValue

      protected abstract boolean onSetValue(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, T currentValue, T lastValue, MoveType moveType)
    • onAbsentValue

      protected abstract boolean onAbsentValue(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, T lastValue, MoveType moveType)
    • onClearValue

      protected void onClearValue(LocalPlayer player, ApplicableRegionSet set)