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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sk89q.worldguard.session.handler.Handler
Handler.Factory<T extends Handler> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(LocalPlayer player, com.sk89q.worldedit.util.Location current, ApplicableRegionSet set)Called when the session is first being created or/wg flushstatesis used.protected abstract booleanonAbsentValue(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, T lastValue, MoveType moveType)booleanonCrossBoundary(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType)Called when a player has moved into a new location.protected abstract voidonInitialValue(LocalPlayer player, ApplicableRegionSet set, T value)protected abstract booleanonSetValue(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, T currentValue, T lastValue, MoveType moveType)Methods inherited from class com.sk89q.worldguard.session.handler.Handler
getInvincibility, getSession, getWrappedHandler, testMoveTo, tick
-
Constructor Details
-
FlagValueChangeHandler
-
-
Method Details
-
initialize
public final void initialize(LocalPlayer player, com.sk89q.worldedit.util.Location current, ApplicableRegionSet set)Description copied from class:HandlerCalled when the session is first being created or/wg flushstatesis used.- Overrides:
initializein classHandler- Parameters:
player- The playercurrent- The player's current locationset- 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:HandlerCalled 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:
onCrossBoundaryin classHandler- Parameters:
player- The playerfrom- The previous, valid, locationto- The new location to testtoSet- The regions for the new locationentered- The list of regions that have been enteredexited- The list of regions that have been leftmoveType- The type of move- Returns:
- Whether the movement should be allowed
-
onInitialValue
-
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)
-