aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
index 2244c5fc..bc620437 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
@@ -9,12 +9,17 @@ import java.util.List;
public class ItemUtils {
public static void appendLore(ItemStack is, List<String> moreLore) {
- NBTTagCompound display = is.getTagCompound().getCompoundTag("display");
+ NBTTagCompound tagCompound = is.getTagCompound();
+ if(tagCompound == null){
+ tagCompound = new NBTTagCompound();
+ }
+ NBTTagCompound display = tagCompound.getCompoundTag("display");
NBTTagList lore = display.getTagList("Lore", 8);
for (String s : moreLore) {
lore.appendTag(new NBTTagString(s));
}
display.setTag("Lore", lore);
- is.getTagCompound().setTag("display", display);
+ tagCompound.setTag("display", display);
+ is.setTagCompound(tagCompound);
}
}