diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
commit | f1fd06d889162ac72395ef66043970cfe42cde5e (patch) | |
tree | 1e306d5817eac77ac44ef59085120882f8824d7a /src/main/java/com/thatgravyboat/skyblockhud/utils | |
parent | 7809a1362c9644c9bfb69d8563a13e3f1ed3354a (diff) | |
download | SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.gz SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.bz2 SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.zip |
I dont even know when I coded this.
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/utils')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java | 8 |
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"); + } } |