public abstract class FlagValueChangeHandler<T> extends Handler
Handler.Factory<T extends Handler>| Modifier | Constructor and Description |
|---|---|
protected |
FlagValueChangeHandler(Session session,
Flag<T> flag) |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(LocalPlayer player,
com.sk89q.worldedit.util.Location current,
ApplicableRegionSet set)
Called when the session is first being created or
/wg flushstates is used. |
protected abstract boolean |
onAbsentValue(LocalPlayer player,
com.sk89q.worldedit.util.Location from,
com.sk89q.worldedit.util.Location to,
ApplicableRegionSet toSet,
T lastValue,
MoveType moveType) |
boolean |
onCrossBoundary(LocalPlayer player,
com.sk89q.worldedit.util.Location from,
com.sk89q.worldedit.util.Location to,
ApplicableRegionSet toSet,
java.util.Set<ProtectedRegion> entered,
java.util.Set<ProtectedRegion> exited,
MoveType moveType)
Called when a player has moved into a new location where either
there are fewer regions or more regions.
|
protected abstract void |
onInitialValue(LocalPlayer player,
ApplicableRegionSet set,
T value) |
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) |
getInvincibility, getSession, testMoveTo, tickpublic final void initialize(LocalPlayer player, com.sk89q.worldedit.util.Location current, ApplicableRegionSet set)
Handler/wg flushstates is used.initialize in class Handlerplayer - The playercurrent - The player's current locationset - The regions for the current locationpublic boolean onCrossBoundary(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, java.util.Set<ProtectedRegion> entered, java.util.Set<ProtectedRegion> exited, MoveType moveType)
HandlerThis 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).
onCrossBoundary in class Handlerplayer - 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 moveprotected abstract void onInitialValue(LocalPlayer player, ApplicableRegionSet set, T value)
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)
protected abstract boolean onAbsentValue(LocalPlayer player, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, T lastValue, MoveType moveType)