diff --git a/plugin.yml b/plugin.yml index 9e6f135e..cc24cbf1 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: Factions -version: 1.1.4 +version: 1.1.5 main: com.bukkit.mcteam.factions.Factions commands: f: diff --git a/releases/factions 1.1.5.zip b/releases/factions 1.1.5.zip new file mode 100644 index 00000000..82e10ba9 Binary files /dev/null and b/releases/factions 1.1.5.zip differ diff --git a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java index 76706fd5..bba6c352 100644 --- a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java @@ -138,17 +138,23 @@ public class FactionsPlayerListener extends PlayerListener{ if (event.isCancelled()) { return; } - if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { - return; // only interested on right-clicks on blocks, whether player is using an item or interacting with a block - } Block block = event.getClickedBlock(); Player player = event.getPlayer(); - if ( ! canPlayerUseRightclickBlock(player, block)) { + if (block == null) { + return; // clicked in air, apparently + } + + if ( ! canPlayerUseBlock(player, block)) { event.setCancelled(true); return; } + + if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { + return; // only interested on right-clicks for below + } + // this check below might no longer be needed... bucket detection is now necessarily handled separately in onPlayerBucketXXX() events, and // Flint&Steel is somehow detected before this in onBlockPlace(), and that's currently it for the default territoryDenyUseageMaterials if ( ! this.playerCanUseItemHere(player, block, event.getMaterial())) { @@ -194,7 +200,7 @@ public class FactionsPlayerListener extends PlayerListener{ return true; } - public boolean canPlayerUseRightclickBlock(Player player, Block block) { + public boolean canPlayerUseBlock(Player player, Block block) { if (Factions.hasPermAdminBypass(player)) { return true;