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
name: CommandPanels
author: RockyHawk

View File

@ -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));
}
}
}

View File

@ -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){}
}
}