From 5a5d27f6a12fab94c639c403fd3c04ee55fd5a20 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 29 Jun 2021 22:21:42 +0100 Subject: [PATCH] Fix NPE when using broadcast as players are joining --- patches/server/Adventure.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 3e394a2c6c..46e1ebbb1d 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2241,6 +2241,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { ++ if (getHandle().connection == null) return; + final ClientboundChatPacket packet = new ClientboundChatPacket(null, type == net.kyori.adventure.audience.MessageType.CHAT ? net.minecraft.network.chat.ChatType.CHAT : net.minecraft.network.chat.ChatType.SYSTEM, identity.uuid()); + packet.adventure$message = message; + this.getHandle().connection.send(packet);