diff --git a/Spigot-API-Patches/Adventure.patch b/Spigot-API-Patches/Adventure.patch index 5c4dc1b51b..fcb4253a4f 100644 --- a/Spigot-API-Patches/Adventure.patch +++ b/Spigot-API-Patches/Adventure.patch @@ -191,8 +191,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ +@FunctionalInterface +public interface ChatRenderer { -+ ChatRenderer DEFAULT = viewerUnaware((source, sourceDisplayName, message) -> Component.translatable("chat.type.text", sourceDisplayName, message)); -+ + /** + * Renders a chat message. This will be called once for each receiving {@link Audience}. + * @@ -206,6 +204,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message, @NotNull Audience viewer); + + /** ++ * Create a new instance of the default {@link ChatRenderer}. ++ * ++ * @return a new {@link ChatRenderer} ++ */ ++ @NotNull ++ static ChatRenderer defaultRenderer() { ++ return viewerUnaware((source, sourceDisplayName, message) -> Component.translatable("chat.type.text", sourceDisplayName, message)); ++ } ++ ++ /** + * Creates a new viewer-unaware {@link ChatRenderer}, which will render the chat message a single time, + * displaying the same rendered message to every viewing {@link Audience}. + * diff --git a/Spigot-Server-Patches/Adventure.patch b/Spigot-Server-Patches/Adventure.patch index 72ab1a1017..62337c9c79 100644 --- a/Spigot-Server-Patches/Adventure.patch +++ b/Spigot-Server-Patches/Adventure.patch @@ -189,7 +189,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // no legacy events called, all nice and fresh! + () -> { + this.processModern( -+ ChatRenderer.DEFAULT, ++ ChatRenderer.defaultRenderer(), + new LazyPlayerSet(this.server), + Component.text(this.message).replaceText(URL_REPLACEMENT_CONFIG), + false