Fixed 2 NPE errors.
This commit is contained in:
parent
56eec348de
commit
0a9e4d48b5
@ -183,8 +183,10 @@ public class InventoryHandler {
|
||||
arenaNameNote_IM.setLore(lores);
|
||||
arenaNameNote.setItemMeta(arenaNameNote_IM);
|
||||
panel.setItem(0, arenaNameNote);
|
||||
for (int i = arena.disguiseBlocks.size(); i > 0; i = i - 1) {
|
||||
panel.setItem(i, arena.disguiseBlocks.get(i - 1));
|
||||
if (arena.disguiseBlocks != null) {
|
||||
for (int i = arena.disguiseBlocks.size(); i > 0; i = i - 1) {
|
||||
panel.setItem(i, arena.disguiseBlocks.get(i - 1));
|
||||
}
|
||||
}
|
||||
player.openInventory(panel);
|
||||
}
|
||||
|
@ -28,10 +28,12 @@ public class OnInventoryClickEvent implements Listener {
|
||||
if (inv.getType().equals(InventoryType.CHEST)) {
|
||||
if (inv.getName().startsWith("\u00A7r")) {
|
||||
if (inv.getName().contains("DisguiseBlocks")) {
|
||||
if (!event.getCurrentItem().getType().isBlock()) {
|
||||
event.setCancelled(true);
|
||||
MessageM.sendFMessage(player,
|
||||
ConfigC.error_setNotABlock, true);
|
||||
if (event.getCurrentItem() != null) {
|
||||
if (!event.getCurrentItem().getType().isBlock()) {
|
||||
event.setCancelled(true);
|
||||
MessageM.sendFMessage(player,
|
||||
ConfigC.error_setNotABlock, true);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user