Skip to content

Commit

Permalink
inventorytag: don't forget script when changing title, do forget uniq…
Browse files Browse the repository at this point in the history
…uifier
  • Loading branch information
mcmonkey4eva committed Aug 23, 2020
1 parent bf7b1f8 commit 27dea07
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -488,9 +488,12 @@ public void setTitle(String title) {
if (inventory != null && NMSHandler.getInstance().getTitle(inventory).equals(title)) {
return;
}
uniquifier = null;
if (inventory == null) {
inventory = Bukkit.getServer().createInventory(null, maxSlots, title);
loadIdentifiers();
if (!getIdType().equals("script")) {
loadIdentifiers();
}
return;
}
else if (notableColors != null) {
Expand All @@ -506,7 +509,10 @@ else if (notableColors != null) {
inventory = Bukkit.getServer().createInventory(null, inventory.getType(), title);
}
inventory.setContents(contents);
loadIdentifiers();
if (!getIdType().equals("script")) {
loadIdentifiers();
}
trackTemporaryInventory(this);
}

public boolean containsItem(ItemTag item, int amount) {
Expand Down Expand Up @@ -614,7 +620,6 @@ private void loadIdentifiers(final InventoryHolder holder) {
return;
}
trackTemporaryInventory(this);

if (holder != null) {
if (holder instanceof NPCTag) {
idType = "npc";
Expand Down

0 comments on commit 27dea07

Please sign in to comment.