From 89d2f07c03f55826e1ef9407c5c83991aea8ed6d Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 25 Apr 2013 19:36:34 -0400 Subject: [PATCH] Because the block is null if they click air. --- .../java/com/gmail/nossr50/listeners/PlayerListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index c9bfc4300..337b76f79 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -309,7 +309,6 @@ public class PlayerListener implements Listener { public void onPlayerInteractLowest(PlayerInteractEvent event) { Player player = event.getPlayer(); Block block = event.getClickedBlock(); - int blockID = block.getTypeId(); ItemStack heldItem = player.getItemInHand(); if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) { @@ -320,6 +319,8 @@ public class PlayerListener implements Listener { switch (event.getAction()) { case RIGHT_CLICK_BLOCK: + int blockID = block.getTypeId(); + /* REPAIR CHECKS */ if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) { RepairManager repairManager = UserManager.getPlayer(player).getRepairManager(); @@ -355,6 +356,8 @@ public class PlayerListener implements Listener { break; case LEFT_CLICK_BLOCK: + blockID = block.getTypeId(); + /* REPAIR CHECKS */ if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) { RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();