From 92dceb827caf868be52e5fd08122e33b01c8d9f2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 19 Jul 2018 10:07:04 +1000 Subject: [PATCH] Revert "SPIGOT-4035: Enforce case-sensitivity for chat format code matching." Minecraft allows uppercase colour codes. This reverts commit d480dc74e5a6693695166ab2d53e80616ff56bb5. --- .../org/bukkit/craftbukkit/util/CraftChatMessage.java | 2 +- src/test/java/org/bukkit/ChatTest.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index 9193020f8d..9b62ed436f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -40,7 +40,7 @@ public final class CraftChatMessage { } 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 list = new ArrayList(); private IChatBaseComponent currentChatComponent = new ChatComponentText(""); diff --git a/src/test/java/org/bukkit/ChatTest.java b/src/test/java/org/bukkit/ChatTest.java index 0aa60d61cb..97467c26fb 100644 --- a/src/test/java/org/bukkit/ChatTest.java +++ b/src/test/java/org/bukkit/ChatTest.java @@ -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 public void testURLJsonConversion() { IChatBaseComponent[] components;