aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-07-14 02:18:16 +1000
committerGitHub <noreply@github.com>2024-07-13 18:18:16 +0200
commit821c177944db38d038f635d2ba499392265a02eb (patch)
tree6415fb56cd2a402297471dff070d7265cf823213
parent5d77f2c5d873c37a88ede101b952d26f83f07a39 (diff)
downloadnotenoughupdates-821c177944db38d038f635d2ba499392265a02eb.tar.gz
notenoughupdates-821c177944db38d038f635d2ba499392265a02eb.tar.bz2
notenoughupdates-821c177944db38d038f635d2ba499392265a02eb.zip
Fix powder grinding overlay (#1231)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java
index ee48b105..68699cfc 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java
@@ -37,7 +37,7 @@ import java.util.regex.Pattern;
public class PowderGrindingOverlay extends TextTabOverlay {
private final static Pattern POWDER_PATTERN =
- Pattern.compile("You received \\+([0-9]+(?:,\\d+)*) (Mithril|Gemstone) Powder\\.");
+ Pattern.compile(" {4}(Mithril|Gemstone) Powder x([0-9]+(?:,\\d+)*)");
private final static Pattern EVENT_PATTERN = Pattern.compile("PASSIVE EVENT (.+) RUNNING FOR \\d{2}:\\d{2}");
public int chestCount = 0;
@@ -166,15 +166,18 @@ public class PowderGrindingOverlay extends TextTabOverlay {
public void onMessage(String message) {
if (message.equals("You uncovered a treasure chest!")) {
this.chestCount++;
- } else if (message.equals("You have successfully picked the lock on this chest!")) {
+ } else if (message.equals(" LOOT CHEST COLLECTED ")) {
+ this.chestCount++;
+ this.openedChestCount++;
+ } else if (message.equals(" CHEST LOCKPICKED ")) {
this.openedChestCount++;
} else {
Matcher matcher = POWDER_PATTERN.matcher(message);
if (matcher.matches()) {
- String rawNumber = matcher.group(1).replace(",", "");
+ String rawNumber = matcher.group(2).replace(",", "");
try {
int amount = Integer.parseInt(rawNumber);
- String type = matcher.group(2);
+ String type = matcher.group(1);
if (type.equals("Mithril")) {
this.mithrilPowderFound += miningEvent == MiningEvent.DOUBLE_POWDER ? amount * 2 : amount;
} else if (type.equals("Gemstone")) {