From 317fcbd610df900401b534db06b899d837413725 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 20 Apr 2023 01:20:24 +0200 Subject: Added support for hoe counter and cultivating ove 1b --- .../java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 25cae741c..60d2d9860 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -11,9 +11,9 @@ object SkyBlockItemModifierUtils { fun ItemStack.getFarmingForDummiesCount() = getAttributeInt("farming_for_dummies_count") - fun ItemStack.getCultivatingCounter() = getAttributeInt("farmed_cultivating") + fun ItemStack.getCultivatingCounter() = getAttributeLong("farmed_cultivating") - fun ItemStack.getHoeCounter() = getAttributeInt("mined_crops") + fun ItemStack.getHoeCounter() = getAttributeLong("mined_crops") fun ItemStack.getSilexCount() = getEnchantments()?.get("efficiency")?.let { it - 5 - if (getInternalName() == "STONK_PICKAXE") 1 else 0 @@ -141,6 +141,9 @@ object SkyBlockItemModifierUtils { private fun ItemStack.getAttributeInt(label: String) = getExtraAttributes()?.getInteger(label)?.takeUnless { it == 0 } + private fun ItemStack.getAttributeLong(label: String) = + getExtraAttributes()?.getLong(label)?.takeUnless { it == 0L } + private fun ItemStack.getAttributeBoolean(label: String): Boolean { return getExtraAttributes()?.hasKey(label) ?: false } -- cgit