summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2012-08-08 14:11:40 +0200
committersnowleo <schneeleo@gmail.com>2012-08-08 14:11:40 +0200
commit739a93f9eacefe2a12e88018534d83245ab6f54e (patch)
treeb9c9d3dedfd835ac60d798c55d06e2bb63df9b2f
parentdce47bcec767412dc315099cbd80ca49b4f708cc (diff)
downloadEssentials-739a93f9eacefe2a12e88018534d83245ab6f54e.tar
Essentials-739a93f9eacefe2a12e88018534d83245ab6f54e.tar.gz
Essentials-739a93f9eacefe2a12e88018534d83245ab6f54e.tar.lz
Essentials-739a93f9eacefe2a12e88018534d83245ab6f54e.tar.xz
Essentials-739a93f9eacefe2a12e88018534d83245ab6f54e.zip
Fix right click on signs
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
index d415ef6a8..7fd563c17 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
@@ -20,14 +20,19 @@ public class SignPlayerListener implements Listener
this.ess = ess;
}
- @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
+ @EventHandler(priority = EventPriority.LOW)
public void onPlayerInteract(final PlayerInteractEvent event)
{
- if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
+ if (ess.getSettings().areSignsDisabled() || (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_AIR))
{
return;
}
- final Block block = event.getClickedBlock();
+ final Block block;
+ if (event.isCancelled() && event.getAction() == Action.RIGHT_CLICK_AIR) {
+ block = event.getPlayer().getTargetBlock(null, 5);
+ } else {
+ block = event.getClickedBlock();
+ }
if (block == null)
{
return;