diff options
| -rw-r--r-- | src/main/kotlin/util/SkyblockId.kt | 10 | ||||
| -rw-r--r-- | src/main/kotlin/util/skyblock/ScreenIdentification.kt | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/kotlin/util/SkyblockId.kt b/src/main/kotlin/util/SkyblockId.kt index 43a9084..84c6564 100644 --- a/src/main/kotlin/util/SkyblockId.kt +++ b/src/main/kotlin/util/SkyblockId.kt @@ -37,6 +37,8 @@ import moe.nea.firmament.util.json.DashlessUUIDSerializer import moe.nea.firmament.util.mc.displayNameAccordingToNbt import moe.nea.firmament.util.mc.loreAccordingToNbt import moe.nea.firmament.util.skyblock.isBazaarUi +import moe.nea.firmament.util.skyblock.isExperimentationRngMeter +import moe.nea.firmament.util.skyblock.isSuperPairs /** * A SkyBlock item id, as used by the NEU repo. @@ -230,7 +232,8 @@ fun ItemStack.getLogicalStackSize(): Long { val ItemStack.rawSkyBlockId: String? get() = extraAttributes.getString("id").getOrNull() fun ItemStack.guessContextualSkyBlockId(): SkyblockId? { - if (MC.screen?.isBazaarUi() == true) { + val screen = MC.screen + if (screen?.isBazaarUi() == true) { val name = displayNameAccordingToNbt.unformattedString .replaceFirst("SELL ", "") .replaceFirst("BUY ", "") @@ -239,6 +242,11 @@ fun ItemStack.guessContextualSkyBlockId(): SkyblockId? { } return ItemNameLookup.guessItemByName(name, false) } + if (screen?.isExperimentationRngMeter() == true || screen?.isSuperPairs() == true) { + val name = displayNameAccordingToNbt.unformattedString + return RepoManager.enchantedBookCache.byName[name] + ?: ItemNameLookup.guessItemByName(name, false) + } return null } diff --git a/src/main/kotlin/util/skyblock/ScreenIdentification.kt b/src/main/kotlin/util/skyblock/ScreenIdentification.kt index 7370a6f..ef64a30 100644 --- a/src/main/kotlin/util/skyblock/ScreenIdentification.kt +++ b/src/main/kotlin/util/skyblock/ScreenIdentification.kt @@ -19,3 +19,11 @@ fun Screen.isBazaarUi(): Boolean { it.unformattedString == "To Bazaar" }) } + +fun Screen.isSuperPairs(): Boolean { + return title.unformattedString.startsWith("Superpairs") +} + +fun Screen.isExperimentationRngMeter(): Boolean { + return this.title.unformattedString.contains("Experimentation Table RNG") +} |
