aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/utils')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java
index 71c6266..10f4599 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java
@@ -369,4 +369,12 @@ public class Utils {
for (String o : strings) if (string.equalsIgnoreCase(o)) return true;
return false;
}
+
+ public static String getItemCustomId(ItemStack stack){
+ if (stack == null) return null;
+ if (!stack.hasTagCompound()) return null;
+ if (!stack.getTagCompound().hasKey("ExtraAttributes")) return null;
+ if (!stack.getTagCompound().getCompoundTag("ExtraAttributes").hasKey("id")) return null;
+ return stack.getTagCompound().getCompoundTag("ExtraAttributes").getString("id");
+ }
}