diff options
author | snowleo <schneeleo@gmail.com> | 2012-08-08 14:11:40 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-08-08 14:11:40 +0200 |
commit | ee072e844b066da7a06498b9d9ea9c8cc4977333 (patch) | |
tree | aae26eb4c728da8cb3c4e49afebb9de9d5fe4e31 | |
parent | 0319415f1bb3f7d96b5129f00746e54cf5897fba (diff) | |
download | Essentials-ee072e844b066da7a06498b9d9ea9c8cc4977333.tar Essentials-ee072e844b066da7a06498b9d9ea9c8cc4977333.tar.gz Essentials-ee072e844b066da7a06498b9d9ea9c8cc4977333.tar.lz Essentials-ee072e844b066da7a06498b9d9ea9c8cc4977333.tar.xz Essentials-ee072e844b066da7a06498b9d9ea9c8cc4977333.zip |
Fix right click on signs
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java | 11 |
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; |