mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-26 20:45:43 +01:00
Check flag change handlers when world changes.
Global regions aren't actually part of the ApplicableRegionSet, so the set difference will be empty even if the global region has changed.
This commit is contained in:
parent
6144ca82ac
commit
c53ed56b3a
@ -47,7 +47,8 @@ public final void initialize(LocalPlayer player, Location current, ApplicableReg
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCrossBoundary(LocalPlayer player, Location from, Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType) {
|
public boolean onCrossBoundary(LocalPlayer player, Location from, Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType) {
|
||||||
if (entered.isEmpty() && exited.isEmpty()) {
|
if (entered.isEmpty() && exited.isEmpty()
|
||||||
|
&& from.getExtent().equals(to.getExtent())) { // sets don't include global regions - check if those changed
|
||||||
return true; // no changes to flags if regions didn't change
|
return true; // no changes to flags if regions didn't change
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
import com.sk89q.minecraft.util.commands.CommandException;
|
import com.sk89q.minecraft.util.commands.CommandException;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
import com.sk89q.worldedit.util.auth.AuthorizationException;
|
||||||
import com.sk89q.worldedit.util.command.parametric.ExceptionConverterHelper;
|
import com.sk89q.worldedit.util.command.parametric.ExceptionConverterHelper;
|
||||||
import com.sk89q.worldedit.util.command.parametric.ExceptionMatch;
|
import com.sk89q.worldedit.util.command.parametric.ExceptionMatch;
|
||||||
import com.sk89q.worldguard.WorldGuard;
|
import com.sk89q.worldguard.WorldGuard;
|
||||||
@ -88,4 +89,8 @@ public void convert(UnresolvedNamesException e) throws CommandException {
|
|||||||
throw new CommandException(e.getMessage(), e);
|
throw new CommandException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExceptionMatch
|
||||||
|
public void convert(AuthorizationException e) throws CommandException {
|
||||||
|
throw new CommandException("You don't have permission to do that.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user