From 4ad452877d9d88a54669c5e6f04f6ab933a01a02 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 12 Aug 2022 21:27:32 -0400 Subject: Add amount of Magmafish if filleted display Shows amount of Magmafish you would get if you filleted all the trophy fish in your inventory --- src/main/java/me/Danker/utils/Utils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/me/Danker/utils') 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, -- cgit