aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 20:37:01 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 20:37:01 +0200
commitbaa59f3fbd5de182de97083b73cd1dc23151ee35 (patch)
tree207e2b64e13df0664a9293bac67531d4d82d512b
parent18b1578d65e59944e721487a21adaf515491d522 (diff)
downloadNotEnoughUpdates-baa59f3fbd5de182de97083b73cd1dc23151ee35.tar.gz
NotEnoughUpdates-baa59f3fbd5de182de97083b73cd1dc23151ee35.tar.bz2
NotEnoughUpdates-baa59f3fbd5de182de97083b73cd1dc23151ee35.zip
fixed 2 bugs
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java5
2 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java
index 451e6896..bef633d2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java
@@ -41,7 +41,8 @@ public class MinionHelperChatLoader {
//§aYou crafted a §eTier VI Enderman Minion§a! That's a new one!
//§b[MVP§3+§b] Eisengolem§f §acrafted a §eTier I Birch Minion§a!
- private final Pattern PATTERN_COOP_MINION = Pattern.compile("(.+)§f §acrafted a §eTier (\\S+) (.+) Minion§a!");
+ private final Pattern PATTERN_COOP_MINION = Pattern.compile(
+ "(.+)§f §acrafted a §eTier (\\S+) (.+) Minion§a!(§r)?(\\r\\n|\\r|\\n)?(.*)?");
public MinionHelperChatLoader(MinionHelperManager manager) {
this.manager = manager;
@@ -56,18 +57,18 @@ public class MinionHelperChatLoader {
try {
Matcher ownMatcher = PATTERN_OWN_MINION.matcher(message);
if (ownMatcher.matches()) {
- String name = ownMatcher.group(1) + " Minion";
- String rawTier = ownMatcher.group(2);
+ String rawTier = ownMatcher.group(1);
int tier = Utils.parseRomanNumeral(rawTier);
+ String name = ownMatcher.group(2) + " Minion";
setCrafted(manager.getMinionByName(name, tier));
}
Matcher coopMatcher = PATTERN_COOP_MINION.matcher(message);
if (coopMatcher.matches()) {
- String name = coopMatcher.group(2) + " Minion";
- String rawTier = coopMatcher.group(3);
+ String rawTier = coopMatcher.group(2);
int tier = Utils.parseRomanNumeral(rawTier);
+ String name = coopMatcher.group(3) + " Minion";
setCrafted(manager.getMinionByName(name, tier));
manager.getOverlay().resetCache();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java
index e638c819..4a1b96b5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java
@@ -62,6 +62,11 @@ public class MinionHelperRequirementsManager {
}
}
+ Minion parent = minion.getParent();
+ if (parent != null) {
+ return meetAllRequirements(parent);
+ }
+
return true;
}