aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-12-08 11:56:50 +0100
committerGitHub <noreply@github.com>2022-12-08 21:56:50 +1100
commit77734f25f1e0b3d093e3506c059a97536b0f3972 (patch)
tree95f1d34e0c4eca81056ef14347e569453131a184
parent377df44813f057405ce6b09cee73eab9755384ab (diff)
downloadNotEnoughUpdates-77734f25f1e0b3d093e3506c059a97536b0f3972.tar.gz
NotEnoughUpdates-77734f25f1e0b3d093e3506c059a97536b0f3972.tar.bz2
NotEnoughUpdates-77734f25f1e0b3d093e3506c059a97536b0f3972.zip
FairySouls: Fix first click not being detected (#480)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
index 5fa68fc2..9e3343a4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
@@ -26,10 +26,12 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.commands.ClientCommandBase;
+import io.github.moulberry.notenoughupdates.core.util.StringUtils;
import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils;
import io.github.moulberry.notenoughupdates.util.Constants;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import io.github.moulberry.notenoughupdates.util.Utils;
+import lombok.var;
import net.minecraft.client.Minecraft;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
@@ -38,6 +40,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.world.WorldEvent;
+import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.io.BufferedReader;
@@ -393,13 +396,12 @@ public class FairySouls {
print("");
}
- @SubscribeEvent
+ @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onChatReceived(ClientChatReceivedEvent event) {
if (!trackSouls || event.type == 2) return;
- if (event.message.getUnformattedText().equals("You have already found that Fairy Soul!") ||
- event.message.getUnformattedText().equals(
- "SOUL! You found a Fairy Soul!")) {
+ var cleanString = StringUtils.cleanColour(event.message.getUnformattedText());
+ if (cleanString.equals("You have already found that Fairy Soul!") || cleanString.equals("SOUL! You found a Fairy Soul!")) {
markClosestSoulFound();
}
}