From bcc619ae1e5f0e2a992d68a2ec36f06dfe6c1f2b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 28 Jun 2020 20:03:31 -0400 Subject: [PATCH] revert chat changes for now until can get it properly working --- ...-Legacy-Component-serialization-size.patch | 47 ------------------- ...atch => 0524-Paper-dumpitem-command.patch} | 0 ...25-Don-t-allow-null-UUID-s-for-chat.patch} | 0 3 files changed, 47 deletions(-) delete mode 100644 Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch rename Spigot-Server-Patches/{0525-Paper-dumpitem-command.patch => 0524-Paper-dumpitem-command.patch} (100%) rename Spigot-Server-Patches/{0526-Don-t-allow-null-UUID-s-for-chat.patch => 0525-Don-t-allow-null-UUID-s-for-chat.patch} (100%) diff --git a/Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch b/Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch deleted file mode 100644 index 1555016a4..000000000 --- a/Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 28 Jun 2020 19:08:41 -0400 -Subject: [PATCH] Improve Legacy Component serialization size - -Don't constantly send format: false for all formatting options when parent already -has it false - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index a423e3bf3906d3114af885c48d0b45d88d7e7d8b..a223d70b8ae6e6c238877d262b663c8f38d7680c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -@@ -45,6 +45,7 @@ public final class CraftChatMessage { - // Separate pattern with no group 3, new lines are part of previous string - private static final Pattern INCREMENTAL_PATTERN_KEEP_NEWLINES = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-orx])|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " ]|$))))", Pattern.CASE_INSENSITIVE); - // ChatColor.b does not explicitly reset, its more of empty -+ private static final ChatModifier EMPTY = ChatModifier.b; // Paper - OBFHELPER - private static final ChatModifier RESET = ChatModifier.b.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false); - - private final List list = new ArrayList(); -@@ -111,7 +112,25 @@ public final class CraftChatMessage { - throw new AssertionError("Unexpected message format"); - } - } else { // Color resets formatting -- modifier = RESET.setColor(format); -+ // Paper start - improve legacy formatting -+ ChatModifier previous = modifier; -+ modifier = EMPTY.setColor(format); -+ if (previous.isBold()) { -+ modifier = modifier.setBold(false); -+ } -+ if (previous.isItalic()) { -+ modifier = modifier.setItalic(false); -+ } -+ if (previous.isRandom()) { -+ modifier = modifier.setRandom(false); -+ } -+ if (previous.isStrikethrough()) { -+ modifier = modifier.setStrikethrough(false); -+ } -+ if (previous.isUnderlined()) { -+ modifier = modifier.setUnderline(false); -+ } -+ // Paper end - } - needsAdd = true; - break; diff --git a/Spigot-Server-Patches/0525-Paper-dumpitem-command.patch b/Spigot-Server-Patches/0524-Paper-dumpitem-command.patch similarity index 100% rename from Spigot-Server-Patches/0525-Paper-dumpitem-command.patch rename to Spigot-Server-Patches/0524-Paper-dumpitem-command.patch diff --git a/Spigot-Server-Patches/0526-Don-t-allow-null-UUID-s-for-chat.patch b/Spigot-Server-Patches/0525-Don-t-allow-null-UUID-s-for-chat.patch similarity index 100% rename from Spigot-Server-Patches/0526-Don-t-allow-null-UUID-s-for-chat.patch rename to Spigot-Server-Patches/0525-Don-t-allow-null-UUID-s-for-chat.patch