aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-15 15:21:16 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-15 15:21:16 +0200
commitb925f560510ef424346b60adcece7efbe5e95754 (patch)
tree340a29c5dccb4108a2250a67730275e2e38663b4 /src/main
parent59ce5ab7534e79fbb36418dec1d779030a4775dd (diff)
downloadskyhanni-b925f560510ef424346b60adcece7efbe5e95754.tar.gz
skyhanni-b925f560510ef424346b60adcece7efbe5e95754.tar.bz2
skyhanni-b925f560510ef424346b60adcece7efbe5e95754.zip
/shtrackcollection Cactus now detects cactus green
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
index 786c2bc1d..3f1f48de6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
@@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull
@@ -99,7 +100,7 @@ class CollectionTracker {
private fun setNewCollection(internalName: NEUInternalName, name: String) {
val foundAmount = CollectionAPI.getCollectionCounter(internalName)
if (foundAmount == null) {
- LorenzUtils.chat("§c[SkyHanni] Item $name is not in the collection data! (Maybe the API is disabled or try to open the collection inventory)")
+ LorenzUtils.chat("§c[SkyHanni] $name collection not found. Try to open the collection inventory!")
return
}
this.internalName = internalName
@@ -137,8 +138,16 @@ class CollectionTracker {
})
}
- private fun countCurrentlyInInventory() =
- InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName }
+ private fun countCurrentlyInInventory(): Int {
+ val cactus = "CACTUS".asInternalName()
+ val cactusGreen = "INK_SACK-2".asInternalName()
+ return InventoryUtils.countItemsInLowerInventory {
+ if (internalName == cactus && it.getInternalName() == cactusGreen) {
+ return@countItemsInLowerInventory true
+ }
+ it.getInternalName() == internalName
+ }
+ }
fun handleTabComplete(command: String): List<String>? {
if (command != "shtrackcollection") return null