Manually merge Pull Request #63

Needs to be tested, hopefully it does work and does improve performance
This commit is contained in:
graywolf336 2015-05-26 11:59:16 -05:00
parent 9255141631
commit fd52be6972

View File

@ -24,6 +24,13 @@ public class MoveProtectionListener implements Listener {
@EventHandler(ignoreCancelled=true) @EventHandler(ignoreCancelled=true)
public void moveProtection(PlayerMoveEvent event) { 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. //If we have the move protection enabled, then let's do it.
//Other wise we don't need to deal with it. //Other wise we don't need to deal with it.
if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) { if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {