mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 18:50:51 +01:00
23 lines
1.3 KiB
Diff
23 lines
1.3 KiB
Diff
|
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();
|