Permalink
Browse files

Disable left-click air task creation (in Sponge)

Following the lead of the Bukkit implementation in commit a5f5dc0, disable left-click air task creation
  • Loading branch information...
DarkArc committed May 30, 2016
1 parent b8e34cb commit b8f35643d341735f467b39bb5234ba4cd613312b
Showing with 0 additions and 15 deletions.
  1. +0 −15 worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java
@@ -136,8 +136,6 @@ public void serverStarted(GameStartedServerEvent event) {
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
}
private boolean ignoreLeftClickAir = false;
@Listener
public void onPlayerInteract(InteractBlockEvent event, @Root Player spongePlayer) {
if (platform == null) {
@@ -171,20 +169,7 @@ public void onPlayerInteract(InteractBlockEvent event, @Root Player spongePlayer
if (we.handleArmSwing(player)) {
event.setCancelled(true);
}
if (!ignoreLeftClickAir) {
Task.builder().delayTicks(2).execute(() -> {
ignoreLeftClickAir = false;
}).submit(this);
ignoreLeftClickAir = true;
}
} else {
if (ignoreLeftClickAir) {
return;
}
if (we.handleArmSwing(player)) {
event.setCancelled(true);
}

0 comments on commit b8f3564

Please sign in to comment.