mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-28 02:01:36 +01:00
Handle entry flag only on boundary crossing.
This commit is contained in:
parent
e90a7ed075
commit
7ecf73165b
@ -22,11 +22,14 @@
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.flags.DefaultFlag;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import com.sk89q.worldguard.session.MoveType;
|
||||
import com.sk89q.worldguard.session.Session;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class EntryFlag extends Handler {
|
||||
|
||||
private static final long MESSAGE_THRESHOLD = 1000 * 2;
|
||||
@ -37,7 +40,7 @@ public EntryFlag(Session session) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean testMoveTo(Player player, Location from, Location to, ApplicableRegionSet toSet, MoveType moveType) {
|
||||
public boolean onCrossBoundary(Player player, Location from, Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType) {
|
||||
LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
|
||||
boolean allowed = toSet.testState(localPlayer, DefaultFlag.ENTRY);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user