diff --git a/resource/plugin.yml b/resource/plugin.yml index f26359d..f917cef 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,4 +1,4 @@ -version: 3.16.1.0 +version: 3.16.1.1 main: me.rockyhawk.commandpanels.CommandPanels name: CommandPanels author: RockyHawk diff --git a/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java b/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java index a7064e9..fc9dd63 100644 --- a/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java +++ b/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java @@ -94,11 +94,11 @@ public class OpenGUI { try{ if(!pconfig.contains("item." + n)){ setItem(s,n,i,p,position); - takenSlots.add(Integer.parseInt(item)); + takenSlots.add(n); } }catch(NullPointerException ignore){ setItem(s,n,i,p,position); - takenSlots.add(Integer.parseInt(item)); + takenSlots.add(n); } } } else { @@ -106,11 +106,11 @@ public class OpenGUI { try{ if(!pconfig.contains("item." + Integer.parseInt(tempDupe))){ setItem(s,Integer.parseInt(tempDupe),i,p,position); - takenSlots.add(Integer.parseInt(item)); + takenSlots.add(Integer.parseInt(tempDupe)); } }catch(NullPointerException ignore){ setItem(s,Integer.parseInt(tempDupe),i,p,position); - takenSlots.add(Integer.parseInt(item)); + takenSlots.add(Integer.parseInt(tempDupe)); } } } diff --git a/src/me/rockyhawk/commandpanels/openwithitem/SwapItemEvent.java b/src/me/rockyhawk/commandpanels/openwithitem/SwapItemEvent.java index 05dcfce..40644df 100644 --- a/src/me/rockyhawk/commandpanels/openwithitem/SwapItemEvent.java +++ b/src/me/rockyhawk/commandpanels/openwithitem/SwapItemEvent.java @@ -18,9 +18,11 @@ public class SwapItemEvent implements Listener { return; } Player p = e.getPlayer(); - if(plugin.hotbar.itemCheckExecute(e.getOffHandItem(),p,false,true)){ - e.setCancelled(true); - p.updateInventory(); - } + try { + if (plugin.hotbar.itemCheckExecute(e.getOffHandItem(), p, false, true)) { + e.setCancelled(true); + p.updateInventory(); + } + }catch(Exception ignore){} } }