feat: Add block breaking indicators to jade

This commit is contained in:
Linnea Gräf
2025-03-07 00:21:38 +01:00
parent 6ad259ca40
commit b4a93bd751
10 changed files with 101 additions and 39 deletions

View File

@@ -81,6 +81,7 @@ data class SBItemStack constructor(
}
val EMPTY = SBItemStack(SkyblockId.NULL, 0)
private val BREAKING_POWER_REGEX = "Breaking Power (?<power>[0-9]+)".toPattern()
operator fun invoke(itemStack: ItemStack): SBItemStack {
val skyblockId = itemStack.skyBlockId ?: SkyblockId.NULL
return SBItemStack(
@@ -349,6 +350,12 @@ data class SBItemStack constructor(
private var itemStack_: ItemStack? = null
val breakingPower: Int
get() =
BREAKING_POWER_REGEX.useMatch(asImmutableItemStack().loreAccordingToNbt.firstOrNull()?.string) {
group("power").toInt()
} ?: 0
private val itemStack: ItemStack
get() {
val itemStack = itemStack_ ?: run {