Add null check when updating set item descriptions.
This commit is contained in:
parent
91a7aadcd0
commit
f45ff6bf0e
Binary file not shown.
@ -3219,9 +3219,12 @@ public class GenericFunctions {
|
||||
public static void updateSetItemsInInventory(Inventory inv) {
|
||||
TwosideKeeper.log("Inventory is size "+inv.getSize(),5);
|
||||
for (int i=0;i<inv.getSize();i++) {
|
||||
if (inv.getItem(i)!=null) {
|
||||
TwosideKeeper.log("Checking "+inv.getItem(i).toString(), 4);
|
||||
UpdateItemLore(inv.getItem(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack UpdateItemLore(ItemStack item) {
|
||||
if (ItemSet.isSetItem(item)) {
|
||||
|
@ -3154,7 +3154,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public void onInventoryOpen(InventoryOpenEvent ev) {
|
||||
PlayerStructure pd = (PlayerStructure)playerdata.get(ev.getPlayer().getUniqueId());
|
||||
pd.isViewingInventory=true;
|
||||
GenericFunctions.updateSetItemsInInventory(ev.getInventory());
|
||||
//GenericFunctions.updateSetItemsInInventory(ev.getInventory());
|
||||
log("Fired Event.",5);
|
||||
GenericFunctions.updateSetItemsInInventory(ev.getView().getBottomInventory());
|
||||
GenericFunctions.updateSetItemsInInventory(ev.getView().getTopInventory());
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user