From cbee91bbf3590b7d76b052154c6249cf26118d4d Mon Sep 17 00:00:00 2001 From: PseudoKnight Date: Sun, 2 Oct 2016 15:18:33 -0700 Subject: [PATCH] Remove right-click workaround --- src/net/TheDgtl/Stargate/Stargate.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index f2023c3..20446ed 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -893,22 +893,10 @@ public class Stargate extends JavaPlugin { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); - Block block = null; - if (event.isCancelled() && event.getAction() == Action.RIGHT_CLICK_AIR) { - try { - block = player.getTargetBlock(null, 5); - } catch (IllegalStateException ex) { - // We can safely ignore this exception, it only happens in void or max height - return; - } - } else { - block = event.getClickedBlock(); - } - - if (block == null) return; - + Block block = event.getClickedBlock(); + // Right click - if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) { + if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (block.getType() == Material.WALL_SIGN) { Portal portal = Portal.getByBlock(block); if (portal == null) return;