diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-25 16:30:22 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-25 16:30:22 +0100 |
commit | 4ec70650fe7596977c5972cfef49834e58e0d626 (patch) | |
tree | 63b5c88bc492a7b26c22d1bf95c18f4f0b28522f | |
parent | 53a8cdd6a1028ba5910e8bd950f0635d78eeb6d4 (diff) | |
download | Essentials-4ec70650fe7596977c5972cfef49834e58e0d626.tar Essentials-4ec70650fe7596977c5972cfef49834e58e0d626.tar.gz Essentials-4ec70650fe7596977c5972cfef49834e58e0d626.tar.lz Essentials-4ec70650fe7596977c5972cfef49834e58e0d626.tar.xz Essentials-4ec70650fe7596977c5972cfef49834e58e0d626.zip |
Reduce amount of move event calls being processed.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index d6757f025..cbd4cebce 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -75,6 +75,13 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { + if (event.getFrom().getBlockX() == event.getTo().getBlockX() + && event.getFrom().getBlockZ() == event.getTo().getBlockZ() + && event.getFrom().getBlockY() == event.getTo().getBlockY()) + { + return; + } + final User user = ess.getUser(event.getPlayer()); if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) @@ -399,13 +406,14 @@ public class EssentialsPlayerListener implements Listener } } } + @EventHandler(priority = EventPriority.MONITOR) public void onInventoryCloseEvent(final InventoryCloseEvent event) { if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) { final User user = ess.getUser(event.getPlayer()); - user.setInvSee(false); + user.setInvSee(false); } } } |