This commit is contained in:
rockyhawk64 2021-07-13 23:39:16 +10:00
parent e7b7872294
commit 5dc197696f
3 changed files with 11 additions and 9 deletions

View File

@ -1,4 +1,4 @@
version: 3.16.1.0 version: 3.16.1.1
main: me.rockyhawk.commandpanels.CommandPanels main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels name: CommandPanels
author: RockyHawk author: RockyHawk

View File

@ -94,11 +94,11 @@ public class OpenGUI {
try{ try{
if(!pconfig.contains("item." + n)){ if(!pconfig.contains("item." + n)){
setItem(s,n,i,p,position); setItem(s,n,i,p,position);
takenSlots.add(Integer.parseInt(item)); takenSlots.add(n);
} }
}catch(NullPointerException ignore){ }catch(NullPointerException ignore){
setItem(s,n,i,p,position); setItem(s,n,i,p,position);
takenSlots.add(Integer.parseInt(item)); takenSlots.add(n);
} }
} }
} else { } else {
@ -106,11 +106,11 @@ public class OpenGUI {
try{ try{
if(!pconfig.contains("item." + Integer.parseInt(tempDupe))){ if(!pconfig.contains("item." + Integer.parseInt(tempDupe))){
setItem(s,Integer.parseInt(tempDupe),i,p,position); setItem(s,Integer.parseInt(tempDupe),i,p,position);
takenSlots.add(Integer.parseInt(item)); takenSlots.add(Integer.parseInt(tempDupe));
} }
}catch(NullPointerException ignore){ }catch(NullPointerException ignore){
setItem(s,Integer.parseInt(tempDupe),i,p,position); setItem(s,Integer.parseInt(tempDupe),i,p,position);
takenSlots.add(Integer.parseInt(item)); takenSlots.add(Integer.parseInt(tempDupe));
} }
} }
} }

View File

@ -18,9 +18,11 @@ public class SwapItemEvent implements Listener {
return; return;
} }
Player p = e.getPlayer(); Player p = e.getPlayer();
try {
if (plugin.hotbar.itemCheckExecute(e.getOffHandItem(), p, false, true)) { if (plugin.hotbar.itemCheckExecute(e.getOffHandItem(), p, false, true)) {
e.setCancelled(true); e.setCancelled(true);
p.updateInventory(); p.updateInventory();
} }
}catch(Exception ignore){}
} }
} }