Slight performance optimization to the movement checks to improve performance with slow permissions plugins

This commit is contained in:
Wyatt Childers 2014-07-23 22:15:39 -04:00
parent 1581390092
commit 1a1acae588

View File

@ -138,7 +138,12 @@ public static boolean checkMove(WorldGuardPlugin plugin, Player player, Location
LocalPlayer localPlayer = plugin.wrapPlayer(player);
boolean hasBypass = plugin.getGlobalRegionManager().hasBypass(player, world);
boolean hasRemoteBypass = plugin.getGlobalRegionManager().hasBypass(player, toWorld);
boolean hasRemoteBypass;
if (world.equals(toWorld)) {
hasRemoteBypass = hasBypass;
} else {
hasRemoteBypass = plugin.getGlobalRegionManager().hasBypass(player, toWorld);
}
RegionManager mgr = plugin.getGlobalRegionManager().get(toWorld);
Vector pt = new Vector(to.getBlockX(), to.getBlockY(), to.getBlockZ());