Add null check when updating set item descriptions.

dev
sigonasr2 9 years ago
parent 91a7aadcd0
commit f45ff6bf0e
  1. BIN
      TwosideKeeper.jar
  2. 5
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  3. 5
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -3219,7 +3219,10 @@ 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++) {
UpdateItemLore(inv.getItem(i));
if (inv.getItem(i)!=null) {
TwosideKeeper.log("Checking "+inv.getItem(i).toString(), 4);
UpdateItemLore(inv.getItem(i));
}
}
}

@ -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…
Cancel
Save