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 | b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c (patch) | |
tree | cf563ab220158d2862b3dba60607dbd9523ef3ed | |
parent | 00033c11bce3c1a960bf0d14c81b90ab8462f64a (diff) | |
download | Essentials-b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c.tar Essentials-b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c.tar.gz Essentials-b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c.tar.lz Essentials-b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c.tar.xz Essentials-b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c.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); } } } |