From d3834c57098dffdc094bfba1266a3a5d1d75287f Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Tue, 11 Sep 2012 21:49:50 -0700 Subject: [PATCH] [Version 0.7.7.5] - Resolve issue of right clicking introduced in 1.3.1/2 --- README | 2 ++ src/net/TheDgtl/Stargate/Stargate.java | 12 +++++++++--- src/plugin.yml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README b/README index c0437e0..66a7b0b 100644 --- a/README +++ b/README @@ -212,6 +212,8 @@ Client randomly crashes on teleport. ============= Changes ============= +[Version 0.7.7.5] + - Resolve issue of right clicking introduced in 1.3.1/2 [Version 0.7.7.4] - Removed try/catch, it was still segfaulting. - Built against 1.3.1 diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 934e230..fdc7fc5 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -789,12 +789,18 @@ public class Stargate extends JavaPlugin { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { - if (event.isCancelled()) return; Player player = event.getPlayer(); - Block block = event.getClickedBlock(); + Block block = null; + if (event.isCancelled() && event.getAction() == Action.RIGHT_CLICK_AIR) { + block = player.getTargetBlock(null, 5); + } else { + block = event.getClickedBlock(); + } + + if (block == null) return; // Right click - if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { + if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) { if (block.getType() == Material.WALL_SIGN) { Portal portal = Portal.getByBlock(block); if (portal == null) return; diff --git a/src/plugin.yml b/src/plugin.yml index 9b665ce..8f9678c 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.7.7.4 +version: 0.7.7.5 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net