aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuna <luna@alexia.lol>2024-07-06 15:07:58 +0200
committerGitHub <noreply@github.com>2024-07-06 15:07:58 +0200
commitb42ce02c4ac30814597f66b9b1758a768da082a6 (patch)
tree5982e78e0541767c861a84b8281ccb530ec306a8
parentfbc6a87600fcc06bdbabacf3dc34ce7261ab6c7c (diff)
downloadnotenoughupdates-b42ce02c4ac30814597f66b9b1758a768da082a6.tar.gz
notenoughupdates-b42ce02c4ac30814597f66b9b1758a768da082a6.tar.bz2
notenoughupdates-b42ce02c4ac30814597f66b9b1758a768da082a6.zip
Fix robot part tracker not working correctly with Mole Pet (#1216)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java
index 7e7c4020..7acc47fb 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java
@@ -435,29 +435,25 @@ public class CrystalHollowOverlay extends TextOverlay {
hidden.automatonParts.put(item, false);
}
} else if (message.startsWith("[NPC] Professor Robot: ")) {
- switch (message) {
- case "[NPC] Professor Robot: That's not one of the components I need! Bring me one of the missing components:":
- hidden.automatonParts.replaceAll((k, v) -> true);
- break;
- case "[NPC] Professor Robot: You've brought me all of the components!":
- hidden.automatonParts.replaceAll((k, v) -> false);
- break;
- default:
- Matcher giveMatcher = givePattern.matcher(message);
- Matcher notFinalMatcher = notFinalPattern.matcher(message);
- if (giveMatcher.matches()) {
- String item = giveMatcher.group("part");
- if (hidden.automatonParts.containsKey(item)) {
- hidden.automatonParts.put(item, true);
- }
- } else if (notFinalMatcher.matches()) {
- String item = notFinalMatcher.group("part");
- if (hidden.automatonParts.containsKey(item)) {
- hidden.automatonParts.replaceAll((k, v) -> true);
- hidden.automatonParts.put(item, false);
- }
+ if (message.equals("[NPC] Professor Robot: That's not one of the components I need! Bring me one of the missing components:")) {
+ hidden.automatonParts.replaceAll((k, v) -> true);
+ } else if (message.startsWith("[NPC] Professor Robot: You've brought me all of the components")) {
+ hidden.automatonParts.replaceAll((k, v) -> false);
+ } else {
+ Matcher giveMatcher = givePattern.matcher(message);
+ Matcher notFinalMatcher = notFinalPattern.matcher(message);
+ if (giveMatcher.matches()) {
+ String item = giveMatcher.group("part");
+ if (hidden.automatonParts.containsKey(item)) {
+ hidden.automatonParts.put(item, true);
}
- break;
+ } else if (notFinalMatcher.matches()) {
+ String item = notFinalMatcher.group("part");
+ if (hidden.automatonParts.containsKey(item)) {
+ hidden.automatonParts.replaceAll((k, v) -> true);
+ hidden.automatonParts.put(item, false);
+ }
+ }
}
}
}