Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-08 04:20:06 +01: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
Dieser Commit ist enthalten in:
Ursprung
a5f5dc099b
Commit
edb4c0b61a
@ -136,8 +136,6 @@ public class SpongeWorldEdit {
|
|||||||
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
|
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean ignoreLeftClickAir = false;
|
|
||||||
|
|
||||||
@Listener
|
@Listener
|
||||||
public void onPlayerInteract(InteractBlockEvent event, @Root Player spongePlayer) {
|
public void onPlayerInteract(InteractBlockEvent event, @Root Player spongePlayer) {
|
||||||
if (platform == null) {
|
if (platform == null) {
|
||||||
@ -171,20 +169,7 @@ public class SpongeWorldEdit {
|
|||||||
if (we.handleArmSwing(player)) {
|
if (we.handleArmSwing(player)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreLeftClickAir) {
|
|
||||||
Task.builder().delayTicks(2).execute(() -> {
|
|
||||||
ignoreLeftClickAir = false;
|
|
||||||
|
|
||||||
}).submit(this);
|
|
||||||
|
|
||||||
ignoreLeftClickAir = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (ignoreLeftClickAir) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (we.handleArmSwing(player)) {
|
if (we.handleArmSwing(player)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren