mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 15:33:19 +01:00
Revert "SPIGOT-4035: Enforce case-sensitivity for chat format code matching."
Minecraft allows uppercase colour codes.
This reverts commit d480dc74e5
.
This commit is contained in:
parent
3e5fe3e40d
commit
92dceb827c
2 changed files with 1 additions and 9 deletions
|
@ -40,7 +40,7 @@ public final class CraftChatMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class StringMessage {
|
private static class StringMessage {
|
||||||
private static final Pattern INCREMENTAL_PATTERN = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-or])|(\\n)|(?i)((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " \\n]|$))))");
|
private static final Pattern INCREMENTAL_PATTERN = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-or])|(\\n)|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " \\n]|$))))", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
private final List<IChatBaseComponent> list = new ArrayList<IChatBaseComponent>();
|
private final List<IChatBaseComponent> list = new ArrayList<IChatBaseComponent>();
|
||||||
private IChatBaseComponent currentChatComponent = new ChatComponentText("");
|
private IChatBaseComponent currentChatComponent = new ChatComponentText("");
|
||||||
|
|
|
@ -23,14 +23,6 @@ public class ChatTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testColorConversion() {
|
|
||||||
String test = String.format("%1$sA%1$sa%1$sB%1$sb%1$sC%1$sc%1$sD%1$sd%1$sE%1$se%1$sZ%1$sz%1$s", ChatColor.COLOR_CHAR);
|
|
||||||
IChatBaseComponent name = CraftChatMessage.fromStringOrNull(test);
|
|
||||||
assertEquals(test.replace(String.valueOf(ChatColor.COLOR_CHAR), ""),
|
|
||||||
CraftChatMessage.fromComponent(name).replace(String.valueOf(ChatColor.COLOR_CHAR), ""));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testURLJsonConversion() {
|
public void testURLJsonConversion() {
|
||||||
IChatBaseComponent[] components;
|
IChatBaseComponent[] components;
|
||||||
|
|
Loading…
Reference in a new issue