mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Disable left-click air task creation (in Sponge)
Following the lead of the Bukkit implementation in commit a5f5dc099b
, disable left-click air task creation
This commit is contained in:
parent
a5f5dc099b
commit
edb4c0b61a
@ -136,8 +136,6 @@ public class SpongeWorldEdit {
|
||||
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 class SpongeWorldEdit {
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user