From fd52be69721a5de110f2d47a78b324abdbdc4068 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Tue, 26 May 2015 11:59:16 -0500 Subject: [PATCH] Manually merge Pull Request #63 Needs to be tested, hopefully it does work and does improve performance --- .../graywolf336/jail/listeners/MoveProtectionListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/graywolf336/jail/listeners/MoveProtectionListener.java b/src/main/java/com/graywolf336/jail/listeners/MoveProtectionListener.java index 102f359..557fe5c 100644 --- a/src/main/java/com/graywolf336/jail/listeners/MoveProtectionListener.java +++ b/src/main/java/com/graywolf336/jail/listeners/MoveProtectionListener.java @@ -24,6 +24,13 @@ public class MoveProtectionListener implements Listener { @EventHandler(ignoreCancelled=true) public void moveProtection(PlayerMoveEvent event) { + //If they haven't moved on the X or Z axis, then we shouldn't try to handle their moving + //this was suggested as Pull Request 63. Going to test it some, but the hope is that + //we don't handle move events so much and thus improve performance. + if(event.getFrom().getBlockX() == event.getTo().getBlockX() && event.getFrom().getBlockZ() == event.getTo().getBlockZ()) { + return; + } + //If we have the move protection enabled, then let's do it. //Other wise we don't need to deal with it. if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {