Skip to content

Commit

Permalink
improve dInventory.setTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 28, 2018
1 parent 5c6ace5 commit 74d0813
Showing 1 changed file with 7 additions and 7 deletions.
Expand Up @@ -420,19 +420,19 @@ public void setTitle(String title) {
if (!(getIdType().equals("generic") || getIdType().equals("script")) || title == null) {
return;
}
if (inventory.getTitle().equals(title)) {
if (inventory != null && inventory.getTitle().equals(title)) {
return;
}
if (notableColors != null) {
title += notableColors;
InventoryScriptHelper.notableInventories.remove(inventory.getTitle());
InventoryScriptHelper.notableInventories.put(title, this);
}
else if (inventory == null) {
if (inventory == null) {
inventory = Bukkit.getServer().createInventory(null, maxSlots, title);
loadIdentifiers();
return;
}
else if (notableColors != null) {
title += notableColors;
InventoryScriptHelper.notableInventories.remove(inventory.getTitle());
InventoryScriptHelper.notableInventories.put(title, this);
}
ItemStack[] contents = inventory.getContents();
if (inventory.getType() == InventoryType.CHEST) {
inventory = Bukkit.getServer().createInventory(null, inventory.getSize(), title);
Expand Down

0 comments on commit 74d0813

Please sign in to comment.