diff --git a/patches/server/Dont-fire-preview-event-for-console.patch b/patches/server/Dont-fire-preview-event-for-console.patch new file mode 100644 index 0000000000..4857a4e7cb --- /dev/null +++ b/patches/server/Dont-fire-preview-event-for-console.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <nassim@njahnke.dev> +Date: Thu, 28 Jul 2022 01:57:24 +0200 +Subject: [PATCH] Dont fire preview event for console + + +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + + public ChatDecorator getChatDecorator() { + return (entityplayer, ichatbasecomponent) -> { ++ // Paper start - fix non-player sender ++ if (entityplayer == null) { ++ return CompletableFuture.completedFuture(ichatbasecomponent); ++ } ++ // Paper end + return CompletableFuture.supplyAsync(() -> { + AsyncPlayerChatPreviewEvent event = new AsyncPlayerChatPreviewEvent(true, entityplayer.getBukkitEntity(), CraftChatMessage.fromComponent(ichatbasecomponent), new LazyPlayerSet(this)); + String originalFormat = event.getFormat(), originalMessage = event.getMessage();