aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexia Luna <me@alexia.lol>2024-04-04 20:05:29 +0200
committerGitHub <noreply@github.com>2024-04-04 20:05:29 +0200
commit49f34426da64d41cf1e560f8eb6f2824fc21c83e (patch)
tree3c15a3b447e219d75f90935bcb35617d2761179e /src
parent35abf8b907c11f534d72314c36d653f7f8e33b7a (diff)
downloadskyhanni-49f34426da64d41cf1e560f8eb6f2824fc21c83e.tar.gz
skyhanni-49f34426da64d41cf1e560f8eb6f2824fc21c83e.tar.bz2
skyhanni-49f34426da64d41cf1e560f8eb6f2824fc21c83e.zip
Fix: Supercraft /gfs not working for 1,000+ items (#1351)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
index 85b6296b5..a5e504245 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
@@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.api.GetFromSackAPI
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.NEUInternalName
+import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.PrimitiveItemStack
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
@@ -12,8 +13,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class SuperCraftFeatures {
private val craftedPattern by RepoPattern.pattern(
- "inventory.supercrafting.craft",
- "§eYou Supercrafted §r§r§r§.(?<item>[^§]+)(?:§r§8x(?<amount>\\d+))?§r§e!"
+ "inventory.supercrafting.craft.new",
+ "§eYou Supercrafted §r§r§r§.(?<item>[^§]+)(?:§r§8x(?<amount>[\\d,]+))?§r§e!"
)
private val config get() = SkyHanniMod.feature.inventory.gfs
@@ -21,7 +22,7 @@ class SuperCraftFeatures {
fun onChat(event: LorenzChatEvent) {
if (!config.superCraftGFS) return
val (internalName, amount) = craftedPattern.matchMatcher(event.message) {
- NEUInternalName.fromItemName(this.group("item")) to (this.group("amount")?.toInt() ?: 1)
+ NEUInternalName.fromItemName(this.group("item")) to (this.group("amount")?.formatInt() ?: 1)
} ?: return
if (!GetFromSackAPI.sackListInternalNames.contains(internalName.asString())) return
DelayedRun.runNextTick {