diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-08-12 21:27:32 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2022-08-12 21:27:32 -0400 |
commit | 4ad452877d9d88a54669c5e6f04f6ab933a01a02 (patch) | |
tree | dba0a24e1a9c836f04fa360e70e359367036468f /src/main/java/me/Danker/utils | |
parent | 189526f2d6d96cce6086af6947b4e752c13944e2 (diff) | |
download | SkyblockMod-4ad452877d9d88a54669c5e6f04f6ab933a01a02.tar.gz SkyblockMod-4ad452877d9d88a54669c5e6f04f6ab933a01a02.tar.bz2 SkyblockMod-4ad452877d9d88a54669c5e6f04f6ab933a01a02.zip |
Add amount of Magmafish if filleted display
Shows amount of Magmafish you would get if you filleted all the trophy fish in your inventory
Diffstat (limited to 'src/main/java/me/Danker/utils')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 8791a43..7c92620 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -531,6 +531,22 @@ public class Utils { return newObj; } + // https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/java/codes/biscuit/skyblockaddons/utils/ItemUtils.java#L139-L148 + public static NBTTagCompound getExtraAttributes(ItemStack item) { + if (item == null || !item.hasTagCompound()) return null; + return item.getSubCompound("ExtraAttributes", false); + } + + // https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/java/codes/biscuit/skyblockaddons/utils/ItemUtils.java#L116-L131 + public static String getSkyblockItemID(ItemStack item) { + if (item == null) return null; + + NBTTagCompound extraAttributes = getExtraAttributes(item); + if (extraAttributes == null || !extraAttributes.hasKey("id", 8)) return null; + + return extraAttributes.getString("id"); + } + public enum DungeonFloor { NONE, E0, |