diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-06-07 21:15:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 13:15:34 +0200 |
commit | 3f49a4e8efd0668f4bf10cb3929c244c4bf38652 (patch) | |
tree | 5c347b4e55270de6d5147899a8f13bd67eefd187 | |
parent | ade9ba2aa9b461e80c3d69e389ee3e467e658ef3 (diff) | |
download | NotEnoughUpdates-3f49a4e8efd0668f4bf10cb3929c244c4bf38652.tar.gz NotEnoughUpdates-3f49a4e8efd0668f4bf10cb3929c244c4bf38652.tar.bz2 NotEnoughUpdates-3f49a4e8efd0668f4bf10cb3929c244c4bf38652.zip |
Add shift for stack amount for bz offers and orders (#1207)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java | 5 |
1 files changed, 4 insertions, 1 deletions
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: §.(?<amount>[\\d,]+)"); + private static final Pattern BAZAAR_STORED_AMOUNT = Pattern.compile( + ".*(?:Offer|Order) amount: §.(?<amount>[\\d,]+)§.x"); + public static void addToTooltip(List<String> 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(",", ""); |