diff options
author | appable <enzospiacitelli@gmail.com> | 2023-04-10 17:44:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 02:44:46 +0200 |
commit | 04cfe48dbbc58da81c8390dfb20216a7258cba3e (patch) | |
tree | 09b517607af1cb71b2207981fc13115eb6696d91 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 65d8a310f7880d1acfe799dbc0c90cc9cef08610 (diff) | |
download | skyhanni-04cfe48dbbc58da81c8390dfb20216a7258cba3e.tar.gz skyhanni-04cfe48dbbc58da81c8390dfb20216a7258cba3e.tar.bz2 skyhanni-04cfe48dbbc58da81c8390dfb20216a7258cba3e.zip |
Farming fortune display (#34)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 15bd4ff0b..a7e97bb0e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -31,6 +31,30 @@ object SkyBlockItemModifierUtils { return 0 } + fun ItemStack.getCultivatingCount(): Int? { + for (tags in tagCompound.keySet) { + if (tags != "ExtraAttributes") continue + val extraAttributes = tagCompound.getCompoundTag(tags) + for (attributes in extraAttributes.keySet) { + if (attributes != "farmed_cultivating") continue + return extraAttributes.getInteger(attributes) + } + } + return null + } + + fun ItemStack.getCounter(): Int? { + for (tags in tagCompound.keySet) { + if (tags != "ExtraAttributes") continue + val extraAttributes = tagCompound.getCompoundTag(tags) + for (attributes in extraAttributes.keySet) { + if (attributes != "mined_crops") continue + return extraAttributes.getInteger(attributes) + } + } + return null + } + fun ItemStack.getSilexCount(): Int { var silexTier = 0 for ((name, amount) in getEnchantments()) { |