public abstract class FlagValueChangeHandler<T> extends Handler
| Modifier | Constructor and Description |
|---|---|
protected |
FlagValueChangeHandler(Session session,
Flag<T> flag) |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(org.bukkit.entity.Player player,
org.bukkit.Location current,
ApplicableRegionSet set)
Called when the session is first being created or
/wg flushstates is used. |
protected abstract boolean |
onAbsentValue(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
T lastValue,
MoveType moveType) |
boolean |
onCrossBoundary(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
Set<ProtectedRegion> entered,
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(org.bukkit.entity.Player player,
ApplicableRegionSet set,
T value) |
protected abstract boolean |
onSetValue(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
T currentValue,
T lastValue,
MoveType moveType) |
getInvincibility, getPlugin, getSession, testMoveTo, tickpublic final void initialize(org.bukkit.entity.Player player,
org.bukkit.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(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
Set<ProtectedRegion> entered,
Set<ProtectedRegion> exited,
MoveType moveType)
HandlerThis is called only if the move test
(Session.testMoveTo(Player, 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(org.bukkit.entity.Player player,
ApplicableRegionSet set,
T value)
protected abstract boolean onSetValue(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
T currentValue,
T lastValue,
MoveType moveType)
protected abstract boolean onAbsentValue(org.bukkit.entity.Player player,
org.bukkit.Location from,
org.bukkit.Location to,
ApplicableRegionSet toSet,
T lastValue,
MoveType moveType)
Copyright © 2015. All Rights Reserved.