mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2025-02-05 11:52:42 +00:00
Performance tweaks
This commit is contained in:
parent
d02d9d49e1
commit
02b47224da
1 changed files with 8 additions and 0 deletions
|
@ -56,6 +56,14 @@ public abstract class HandlerWrapper extends Handler
|
|||
@Override
|
||||
public boolean onCrossBoundary(LocalPlayer localPlayer, com.sk89q.worldedit.util.Location from, com.sk89q.worldedit.util.Location to, ApplicableRegionSet toSet, Set<ProtectedRegion> entered, Set<ProtectedRegion> exited, MoveType moveType)
|
||||
{
|
||||
//It turns out that this is fired every time player moves
|
||||
//The plugin flags assume already that nothing changes unless region is crossed, so ignore when there isn't a region change
|
||||
//This optimization is already in place in the FVCH
|
||||
if (entered.isEmpty() && exited.isEmpty() && from.getExtent().equals(to.getExtent()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.onCrossBoundary(((BukkitPlayer)localPlayer).getPlayer(), BukkitAdapter.adapt(from), BukkitAdapter.adapt(to), toSet, entered, exited, moveType);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue