mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fixed compass teleporting twice on cliff edges
This commit is contained in:
parent
927cab001e
commit
13f36757c2
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
@ -86,6 +87,8 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ignoreLeftClickAir = false;
|
||||
|
||||
/**
|
||||
* Called when a player interacts
|
||||
*
|
||||
@ -110,13 +113,29 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
if (we.handleArmSwing(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (!ignoreLeftClickAir) {
|
||||
final int taskId = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() {
|
||||
ignoreLeftClickAir = false;
|
||||
}}, 2);
|
||||
|
||||
if (taskId != -1) {
|
||||
ignoreLeftClickAir = true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case LEFT_CLICK_AIR:
|
||||
if (ignoreLeftClickAir) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (we.handleArmSwing(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIGHT_CLICK_BLOCK: {
|
||||
|
Loading…
Reference in New Issue
Block a user