aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java7
1 files changed, 7 insertions, 0 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 cffdd164..ad8a6c98 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java
@@ -57,6 +57,13 @@ public class ItemUtils {
return skull;
}
+ public static NBTTagCompound getOrCreateTag(ItemStack is) {
+ if (is.hasTagCompound()) return is.getTagCompound();
+ NBTTagCompound nbtTagCompound = new NBTTagCompound();
+ is.setTagCompound(nbtTagCompound);
+ return nbtTagCompound;
+ }
+
public static void appendLore(ItemStack is, List<String> moreLore) {
NBTTagCompound tagCompound = is.getTagCompound();
if (tagCompound == null) {