From f15bbfeabe4a3a6cc33b7a2775cad26d53472445 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 24 Oct 2023 00:34:58 +1100 Subject: Fix chat symbols in click to pv (#892) fix symbols in pv chat --- .../io/github/moulberry/notenoughupdates/listener/ChatListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index 82e06d73..68605ed4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -28,7 +28,6 @@ import io.github.moulberry.notenoughupdates.miscfeatures.StreamerMode; import io.github.moulberry.notenoughupdates.miscfeatures.world.EnderNodeHighlighter; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; -import io.github.moulberry.notenoughupdates.overlays.TimersOverlay; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -150,6 +149,7 @@ public class ChatListener { String username = startsWith.equals("/viewprofile") ? Utils.getNameFromChatComponent(chatComponent) : chatComponent.getSiblings().get(chatComponentsCount).getChatStyle().getChatClickEvent().getValue().substring(15); + username = username.replaceAll("[^a-zA-Z0-9_]", ""); if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 == 1) { @@ -174,6 +174,7 @@ public class ChatListener { } private static ChatStyle getPVChatStyle(String username) { + username = username.replaceAll("[^a-zA-Z0-9_]", ""); return Utils.createClickStyle( ClickEvent.Action.RUN_COMMAND, "/pv " + username, -- cgit