mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
parent
8e886a3c0a
commit
8b829bd611
22
patches/server/Dont-fire-preview-event-for-console.patch
Normal file
22
patches/server/Dont-fire-preview-event-for-console.patch
Normal file
@ -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();
|
Loading…
Reference in New Issue
Block a user