From a111b136556b543836e5942f2d79b6c1a8e7dde5 Mon Sep 17 00:00:00 2001 From: Professor Bloodstone Date: Sun, 4 Apr 2021 22:43:11 +0200 Subject: [PATCH] Send post ChatEvent messages as MessageType.CHAT Fixes narrator issue #5450 --- Spigot-Server-Patches/0010-Adventure.patch | 8 +++++--- ...on-to-use-vanilla-per-world-scoreboard-coloring-.patch | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Spigot-Server-Patches/0010-Adventure.patch b/Spigot-Server-Patches/0010-Adventure.patch index 1f561bce6f..e5aec1548c 100644 --- a/Spigot-Server-Patches/0010-Adventure.patch +++ b/Spigot-Server-Patches/0010-Adventure.patch @@ -105,10 +105,10 @@ index 0000000000000000000000000000000000000000..89597b4a3064c3c6001c7e927a848ee7 +} diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java new file mode 100644 -index 0000000000000000000000000000000000000000..8774f5f8d1c6dbc2c504dc028368e8ab8cd3c38d +index 0000000000000000000000000000000000000000..75c36e772be93c9808cd8b72410ad8baa3d47006 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java -@@ -0,0 +1,212 @@ +@@ -0,0 +1,214 @@ +package io.papermc.paper.adventure; + +import io.papermc.paper.chat.ChatComposer; @@ -119,6 +119,8 @@ index 0000000000000000000000000000000000000000..8774f5f8d1c6dbc2c504dc028368e8ab +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; +import java.util.regex.Pattern; ++ ++import net.kyori.adventure.audience.MessageType; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.TextReplacementConfig; +import net.kyori.adventure.text.event.ClickEvent; @@ -273,7 +275,7 @@ index 0000000000000000000000000000000000000000..8774f5f8d1c6dbc2c504dc028368e8ab + } + } else { + for (final Player recipient : event.recipients()) { -+ recipient.sendMessage(player, message); ++ recipient.sendMessage(player, message, MessageType.CHAT); + } + } + } diff --git a/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 6e96267acf..84c975cbc8 100644 --- a/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -26,10 +26,10 @@ index db2dddd12f54e6d15916c4cee623676541de37fb..1942f5224aaebb18adb591d6f70a419c + } } diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java -index ed00e5e825856e790da467f429d026772e6303bd..472adbd2aa2a9e1d8d481749ba92c3a290a5fa36 100644 +index 75c36e772be93c9808cd8b72410ad8baa3d47006..636c60c7a8d674150fad0579c642cd037debde28 100644 --- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java -@@ -14,7 +14,11 @@ import net.kyori.adventure.text.event.ClickEvent; +@@ -16,7 +16,11 @@ import net.kyori.adventure.text.event.ClickEvent; import net.minecraft.network.chat.IChatBaseComponent; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.EntityPlayer; @@ -41,7 +41,7 @@ index ed00e5e825856e790da467f429d026772e6303bd..472adbd2aa2a9e1d8d481749ba92c3a2 import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.util.LazyPlayerSet; import org.bukkit.craftbukkit.util.Waitable; -@@ -176,10 +180,22 @@ public final class ChatProcessor { +@@ -178,10 +182,22 @@ public final class ChatProcessor { } private static String legacyDisplayName(final CraftPlayer player) {