diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2023-10-24 00:34:58 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 15:34:58 +0200 |
commit | f15bbfeabe4a3a6cc33b7a2775cad26d53472445 (patch) | |
tree | c5b8e5060cbf983162dd0da431c808af8608d0f1 /src | |
parent | 4e02ab15caadec0134e090f60210c5f330c49e2f (diff) | |
download | NotEnoughUpdates-f15bbfeabe4a3a6cc33b7a2775cad26d53472445.tar.gz NotEnoughUpdates-f15bbfeabe4a3a6cc33b7a2775cad26d53472445.tar.bz2 NotEnoughUpdates-f15bbfeabe4a3a6cc33b7a2775cad26d53472445.zip |
Fix chat symbols in click to pv (#892)
fix symbols in pv chat
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java | 3 |
1 files changed, 2 insertions, 1 deletions
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, |