aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 13:23:26 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 13:23:26 +0200
commite04efa84f7d42ddcbe11eb65f25adc0e524a3aaa (patch)
tree4ee90ed22d4b23f08324013be74bce2e05b3c09b /src/main/java/at/hannibal2/skyhanni/data
parent7c8a513ac98071ce34ed9e35660956d7e5b7fac5 (diff)
downloadskyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.gz
skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.bz2
skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.zip
Using NEUInternalName in CollectionAPI
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
index f366f0aed..5bae57ac5 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
@@ -5,9 +5,10 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.OwnInventorItemUpdateEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
-import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
+import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull_new
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
@@ -74,21 +75,21 @@ class OwnInventoryData {
val diffWorld = System.currentTimeMillis() - LorenzUtils.lastWorldSwitch
if (diffWorld < 3_000) return
- val internalName = item.getInternalName()
- if (internalName.startsWith("MAP-")) return
+ val internalName = item.getInternalNameOrNull_new()
- val (_, amount) = NEUItems.getMultiplier(internalName)
- if (amount > 1) return
-
- if (internalName == "") {
+ if (internalName == null) {
LorenzUtils.debug("OwnInventoryData add is empty for: '$internalName'")
return
}
+ if (internalName.asString().startsWith("MAP-")) return
+
+ val (_, amount) = NEUItems.getMultiplier(internalName)
+ if (amount > 1) return
addMultiplier(internalName, add)
}
- private fun addMultiplier(internalName: String, amount: Int) {
+ private fun addMultiplier(internalName: NEUInternalName, amount: Int) {
CollectionAPI.addFromInventory(internalName, amount)
}
} \ No newline at end of file