summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-09 21:47:06 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-09 21:47:06 +0100
commitc98bbe34efab04cf46dde6a573b57275a69c5722 (patch)
tree998cb4d4a8c04b82b06d00edae197ea4fcc9ad35 /src/main/java/at/hannibal2/skyhanni/data
parent6157bc46e3355cf353767572c46bba3fb6f8d02f (diff)
downloadskyhanni-c98bbe34efab04cf46dde6a573b57275a69c5722.tar.gz
skyhanni-c98bbe34efab04cf46dde6a573b57275a69c5722.tar.bz2
skyhanni-c98bbe34efab04cf46dde6a573b57275a69c5722.zip
Added support for slayer tracker items for loot from area mini-bosses. Fixed a bug where some items were counted twice.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt19
2 files changed, 4 insertions, 25 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
index 7e2032077..da505f409 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
@@ -1,14 +1,13 @@
package at.hannibal2.skyhanni.data
-import at.hannibal2.skyhanni.api.CollectionAPI
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent
import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import net.minecraft.item.ItemStack
import net.minecraft.network.play.server.S2FPacketSetSlot
@@ -92,10 +91,7 @@ class OwnInventoryData {
val (_, amount) = NEUItems.getMultiplier(internalName)
if (amount > 1) return
- addMultiplier(internalName, add)
+ ItemAddInInventoryEvent(internalName, add).postAndCatch()
}
- private fun addMultiplier(internalName: NEUInternalName, amount: Int) {
- CollectionAPI.addFromInventory(internalName, amount)
- }
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
index f3c23700d..c827a9f53 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
@@ -15,7 +15,6 @@ import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull
import at.hannibal2.skyhanni.utils.NEUItems.getPrice
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.RecalculatingValue
-import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import com.google.common.cache.CacheBuilder
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.concurrent.TimeUnit
@@ -40,22 +39,6 @@ object SlayerAPI {
System.currentTimeMillis()
} else latestProgressChangeTime
-
- // TODO use repo
- fun ignoreSlayerDrop(name: String) = when (name.removeColor()) {
- // maybe everywhere?
- "Stone" -> true
- "Head" -> true
-
- // Spider
- "Cobweb" -> true
-
- // Blaze
- "Water Bottle" -> true
-
- else -> false
- }
-
fun getItemNameAndPrice(internalName: NEUInternalName, amount: Int): Pair<String, Double> {
val key = internalName to amount
nameCache.getIfPresent(key)?.let {
@@ -178,4 +161,4 @@ object SlayerAPI {
else -> null
}
-} \ No newline at end of file
+}