Skip to content

Commit a46fc56

Browse files
committed
fix: improve guessing of superpair ids
1 parent de10389 commit a46fc56

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/kotlin/util/SkyblockId.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,24 @@ fun ItemStack.guessContextualSkyBlockId(): SkyblockId? {
244244
}
245245
return ItemNameLookup.guessItemByName(name, false)
246246
}
247-
if (screen != null && (screenType == ScreenType.EXPERIMENTATION_RNG_METER || screenType == ScreenType.SUPER_PAIRS || screenType == ScreenType.ENCHANTMENT_GUIDE)) {
247+
if (screenType == ScreenType.EXPERIMENTATION_RNG_METER
248+
|| screenType == ScreenType.ENCHANTMENT_GUIDE
249+
) {
248250
val name = displayNameAccordingToNbt.unformattedString
249251
return RepoManager.enchantedBookCache.byName[name]
250252
?: ItemNameLookup.guessItemByName(name, false)
251253
}
254+
if (screenType == ScreenType.SUPER_PAIRS) {
255+
val name = loreAccordingToNbt.iterator()
256+
.asSequence()
257+
.dropWhile { !it.unformattedString.isBlank() }
258+
.drop(1)
259+
.firstOrNull()
260+
?.unformattedString ?: displayName.unformattedString
261+
return RepoManager.enchantedBookCache.byName[name]
262+
?: ItemNameLookup.guessItemByName(name, false)
263+
264+
}
252265
return null
253266
}
254267

0 commit comments

Comments
 (0)