diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 13:23:26 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 13:23:26 +0200 |
| commit | e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa (patch) | |
| tree | 4ee90ed22d4b23f08324013be74bce2e05b3c09b /src/main/java/at/hannibal2/skyhanni/features | |
| parent | 7c8a513ac98071ce34ed9e35660956d7e5b7fac5 (diff) | |
| download | skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.gz skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.bz2 skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.zip | |
Using NEUInternalName in CollectionAPI
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
3 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index e740d0af2..b71b4f4a4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -177,7 +177,7 @@ class BingoNextStepHelper { } } if (step is CollectionStep) { - val counter = CollectionAPI.getCollectionCounter(step.collectionName) ?: 0 + val counter = CollectionAPI.getCollectionCounter(step.internalName) ?: 0 if (step.amountHaving != counter) { step.amountHaving = counter if (counter >= step.amountNeeded) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt index 065f92f9b..892bedcd1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt @@ -1,6 +1,9 @@ package at.hannibal2.skyhanni.features.bingo.nextstep +import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil -class CollectionStep(val collectionName: String, amountNeeded: Int) : - ProgressionStep(NumberUtil.format(amountNeeded) + " $collectionName Collection", amountNeeded.toLong())
\ No newline at end of file +class CollectionStep(collectionName: String, amountNeeded: Int) : + ProgressionStep(NumberUtil.format(amountNeeded) + " $collectionName Collection", amountNeeded.toLong()) { + val internalName = NEUItems.getInternalName_new(collectionName) +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt index 9be2186ad..05aefc1f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt @@ -4,12 +4,13 @@ import at.hannibal2.skyhanni.api.CollectionAPI import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.MinionOpenEvent import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class MinionCollectLogic { - private var oldMap = mapOf<String, Int>() + private var oldMap = mapOf<NEUInternalName, Int>() @SubscribeEvent fun onMinionOpen(event: MinionOpenEvent) { @@ -17,10 +18,10 @@ class MinionCollectLogic { oldMap = count() } - private fun count(): MutableMap<String, Int> { - val map = mutableMapOf<String, Int>() + private fun count(): MutableMap<NEUInternalName, Int> { + val map = mutableMapOf<NEUInternalName, Int>() for (stack in InventoryUtils.getItemsInOwnInventory()) { - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_new() val (newId, amount) = NEUItems.getMultiplier(internalName) val old = map[newId] ?: 0 map[newId] = old + amount * stack.stackSize |
