diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2025-09-05 23:15:58 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-09-05 23:58:33 +0200 |
| commit | 722d78914b75901ae6c2729784330d45bc37625c (patch) | |
| tree | 05756be056b41a04d5b0c23b420c71f7a6f9e1b0 /src/main/kotlin/util | |
| parent | d2141aeda6fc5f29faa98fe91405a8f46a2d9894 (diff) | |
| download | Firmament-722d78914b75901ae6c2729784330d45bc37625c.tar.gz Firmament-722d78914b75901ae6c2729784330d45bc37625c.tar.bz2 Firmament-722d78914b75901ae6c2729784330d45bc37625c.zip | |
feat: Logical Stack Size for Compost and Gemstone Sack
Diffstat (limited to 'src/main/kotlin/util')
| -rw-r--r-- | src/main/kotlin/util/SkyblockId.kt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/kotlin/util/SkyblockId.kt b/src/main/kotlin/util/SkyblockId.kt index 2a0c477..07d4c30 100644 --- a/src/main/kotlin/util/SkyblockId.kt +++ b/src/main/kotlin/util/SkyblockId.kt @@ -206,15 +206,21 @@ fun ItemStack.setSkyBlockId(skyblockId: SkyblockId): ItemStack { } private val STORED_REGEX = "Stored: ($SHORT_NUMBER_FORMAT)/.+".toPattern() -private val AMOUNT_REGEX = "(?:Offer amount|Amount|Order amount): ($SHORT_NUMBER_FORMAT)x".toPattern() +private val COMPOST_REGEX = "Compost Available: ($SHORT_NUMBER_FORMAT)".toPattern() +private val GEMSTONE_SACK_REGEX = " Amount: ($SHORT_NUMBER_FORMAT)".toPattern() +private val AMOUNT_REGEX = ".*(?:Offer amount|Amount|Order amount): ($SHORT_NUMBER_FORMAT)x".toPattern() fun ItemStack.getLogicalStackSize(): Long { return loreAccordingToNbt.firstNotNullOfOrNull { val string = it.unformattedString - STORED_REGEX.useMatch(string) { + GEMSTONE_SACK_REGEX.useMatch(string) { + parseShortNumber(group(1)).toLong() + } ?: STORED_REGEX.useMatch(string) { parseShortNumber(group(1)).toLong() } ?: AMOUNT_REGEX.useMatch(string) { parseShortNumber(group(1)).toLong() - } + } ?: COMPOST_REGEX.useMatch(string) { + parseShortNumber(group(1)).toLong() + } } ?: count.toLong() } |
