From b5be20cce7084314310b8092518ec723968ceffd Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Sat, 25 Feb 2023 20:59:02 +0900 Subject: - Fix #336, by making sure something that ends with ] also starts with [ (prefix check) (#337) Signed-off-by: syeyoung --- .../java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java index 505173f9..82c4b6cb 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java @@ -340,7 +340,8 @@ public class CosmeticsManager { if (startingSearch == -1) break; if (startingSearch-1 >= 0) { char c = beforeUsername.charAt(startingSearch-1); - if (c == ']') continue; + int next = beforeUsername.lastIndexOf(' ', startingSearch-1); + if (c == ']' && beforeUsername.charAt(next+1) == '[') continue; startingSearch ++; break; } -- cgit