diff --git a/Spigot-Server-Patches/Adventure.patch b/Spigot-Server-Patches/Adventure.patch index 3a891df8c6..9996c3660e 100644 --- a/Spigot-Server-Patches/Adventure.patch +++ b/Spigot-Server-Patches/Adventure.patch @@ -165,13 +165,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.async = async; + } + -+ @SuppressWarnings("CodeBlock2Expr") ++ @SuppressWarnings({"CodeBlock2Expr", "deprecated"}) + public void process() { + this.processingLegacyFirst( + // continuing from AsyncPlayerChatEvent (without PlayerChatEvent) + event -> { + this.processModern( -+ legacyComposer(event.getFormat(), legacyDisplayName((CraftPlayer) event.getPlayer()), event.getMessage()), ++ legacyComposer(event.getFormat()), + event.getRecipients(), + PaperAdventure.LEGACY_SECTION_UXRC.deserialize(event.getMessage()), + event.isCancelled() @@ -180,7 +180,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // continuing from AsyncPlayerChatEvent and PlayerChatEvent + event -> { + this.processModern( -+ legacyComposer(event.getFormat(), legacyDisplayName((CraftPlayer) event.getPlayer()), event.getMessage()), ++ legacyComposer(event.getFormat()), + event.getRecipients(), + PaperAdventure.LEGACY_SECTION_UXRC.deserialize(event.getMessage()), + event.isCancelled() @@ -297,8 +297,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return player.displayName(); + } + -+ private static ChatComposer legacyComposer(final String format, final String legacyDisplayName, final String legacyMessage) { -+ return (player, displayName, message) -> PaperAdventure.LEGACY_SECTION_UXRC.deserialize(String.format(format, legacyDisplayName, legacyMessage)).replaceText(URL_REPLACEMENT_CONFIG); ++ private static ChatComposer legacyComposer(final String format) { ++ return (player, displayName, message) -> PaperAdventure.LEGACY_SECTION_UXRC.deserialize(String.format(format, legacyDisplayName((CraftPlayer) player), PaperAdventure.LEGACY_SECTION_UXRC.serialize(message))).replaceText(URL_REPLACEMENT_CONFIG); + } + + private void queueIfAsyncOrRunImmediately(final Waitable waitable) {