From 3f49a4e8efd0668f4bf10cb3929c244c4bf38652 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Jun 2024 21:15:34 +1000 Subject: Add shift for stack amount for bz offers and orders (#1207) --- .../io/github/moulberry/notenoughupdates/ItemPriceInformation.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index 705db3fe..aea74f58 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -67,6 +67,9 @@ public class ItemPriceInformation { private static final Pattern COMPOSTER_STORED_AMOUNT = Pattern.compile( ".*Compost Available: §.(?[\\d,]+)"); + private static final Pattern BAZAAR_STORED_AMOUNT = Pattern.compile( + ".*(?:Offer|Order) amount: §.(?[\\d,]+)§.x"); + public static void addToTooltip(List tooltip, String internalName, ItemStack stack) { addToTooltip(tooltip, internalName, stack, true); } @@ -144,7 +147,7 @@ public class ItemPriceInformation { boolean foundMulti = false; for (int i = 1; i < tooltip.size(); i++) { if (foundMulti) break; - for (Pattern pattern : new Pattern[]{SACK_STORED_AMOUNT, GEMSTONE_STORED_AMOUNT, COMPOSTER_STORED_AMOUNT}) { + for (Pattern pattern : new Pattern[]{SACK_STORED_AMOUNT, GEMSTONE_STORED_AMOUNT, COMPOSTER_STORED_AMOUNT, BAZAAR_STORED_AMOUNT}) { val matcher = pattern.matcher(tooltip.get(i)); if (matcher.matches()) { String amountString = matcher.group("amount").replace(",", ""); -- cgit