aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/repo/MiningRepoData.kt9
-rw-r--r--src/main/kotlin/repo/RepoManager.kt2
-rw-r--r--src/main/kotlin/repo/SBItemStack.kt3
3 files changed, 8 insertions, 6 deletions
diff --git a/src/main/kotlin/repo/MiningRepoData.kt b/src/main/kotlin/repo/MiningRepoData.kt
index 548c3e5..e40292d 100644
--- a/src/main/kotlin/repo/MiningRepoData.kt
+++ b/src/main/kotlin/repo/MiningRepoData.kt
@@ -30,7 +30,7 @@ class MiningRepoData : IReloadable {
private set
var customMiningBlocks: List<CustomMiningBlock> = listOf()
private set
- var toolsByBreakingPower: NavigableMap<BreakingPowerKey, NEUItem> = Collections.emptyNavigableMap()
+ var toolsByBreakingPower: NavigableMap<BreakingPowerKey, SBItemStack> = Collections.emptyNavigableMap()
private set
@@ -44,7 +44,7 @@ class MiningRepoData : IReloadable {
.comparingInt<BreakingPowerKey> { it.breakingPower }
.thenComparing(Comparator.comparing(
{ it.itemId },
- nullsFirst(Comparator.naturalOrder<SkyblockId>())))
+ nullsFirst(Comparator.comparing<SkyblockId, Boolean> { "PICK" in it.neuItem || "BING" in it.neuItem }.thenComparing(Comparator.naturalOrder<SkyblockId>()))))
}
}
@@ -60,13 +60,14 @@ class MiningRepoData : IReloadable {
repo.items.items
.values
.asSequence()
+ .map { SBItemStack(it.skyblockId) }
.filter { it.breakingPower > 0 }
- .associateTo(TreeMap<BreakingPowerKey, NEUItem>(BreakingPowerKey.COMPARATOR)) {
+ .associateTo(TreeMap<BreakingPowerKey, SBItemStack>(BreakingPowerKey.COMPARATOR)) {
BreakingPowerKey(it.breakingPower, it.skyblockId) to it
})
}
- fun getToolsThatCanBreak(breakingPower: Int): Collection<NEUItem> {
+ fun getToolsThatCanBreak(breakingPower: Int): Collection<SBItemStack> {
return toolsByBreakingPower.tailMap(BreakingPowerKey(breakingPower, null), true).values
}
diff --git a/src/main/kotlin/repo/RepoManager.kt b/src/main/kotlin/repo/RepoManager.kt
index 5bcf163..e50a131 100644
--- a/src/main/kotlin/repo/RepoManager.kt
+++ b/src/main/kotlin/repo/RepoManager.kt
@@ -64,6 +64,7 @@ object RepoManager {
registerReloadListener(ItemNameLookup)
registerReloadListener(ReforgeStore)
registerReloadListener(essenceRecipeProvider)
+ registerReloadListener(recipeCache)
registerReloadListener(miningData)
ReloadRegistrationEvent.publish(ReloadRegistrationEvent(this))
registerReloadListener {
@@ -75,7 +76,6 @@ object RepoManager {
}
}
}
- registerReloadListener(recipeCache)
}
}
diff --git a/src/main/kotlin/repo/SBItemStack.kt b/src/main/kotlin/repo/SBItemStack.kt
index e04eec3..3690866 100644
--- a/src/main/kotlin/repo/SBItemStack.kt
+++ b/src/main/kotlin/repo/SBItemStack.kt
@@ -34,6 +34,7 @@ import moe.nea.firmament.util.modifyExtraAttributes
import moe.nea.firmament.util.petData
import moe.nea.firmament.util.prepend
import moe.nea.firmament.util.reconstitute
+import moe.nea.firmament.util.removeColorCodes
import moe.nea.firmament.util.skyBlockId
import moe.nea.firmament.util.skyblock.ItemType
import moe.nea.firmament.util.skyblock.Rarity
@@ -352,7 +353,7 @@ data class SBItemStack constructor(
val breakingPower: Int
get() =
- BREAKING_POWER_REGEX.useMatch(asImmutableItemStack().loreAccordingToNbt.firstOrNull()?.string) {
+ BREAKING_POWER_REGEX.useMatch(neuItem?.lore?.firstOrNull()?.removeColorCodes()) {
group("power").toInt()
} ?: 0