diff --git a/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java b/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java index eafafaa..d5935f9 100644 --- a/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java +++ b/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java @@ -23,14 +23,14 @@ public class ClickItemListen implements Listener { final Player p = (Player) e.getWhoClicked(); final Inventory inv = e.getInventory(); final int solt = e.getSlot(); - final ItemStack i = inv.getItem(solt); - if (i != null && i.getType() != Material.AIR) { - if (plugin.isCantAction(p, i, ActionType.Click)) { - try { + try { + final ItemStack i = inv.getItem(solt); + if (i != null && i.getType() != Material.AIR) { + if (plugin.isCantAction(p, i, ActionType.Click)) { inv.setItem(solt, new ItemStack(Material.AIR)); - } catch (final Exception e2) { } } + } catch (final Exception e2) { } } }