Fix chat message api using overlay

This commit is contained in:
Nassim Jahnke 2022-07-28 00:38:37 +02:00
parent d41ecbe5c3
commit 2184cd2252
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B

View file

@ -2486,7 +2486,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa
public boolean isOp() { public boolean isOp() {
return true; return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cadafdfd3469b6f813f5e0add116640313fb6209..3fe120364ac61d40d6d8b16339e3086a3c0ac512 100644 index cadafdfd3469b6f813f5e0add116640313fb6209..ac6fd14f18f2fa2247db4d2d8c9233f862b85111 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -269,14 +269,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -269,14 +269,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -2732,7 +2732,7 @@ index cadafdfd3469b6f813f5e0add116640313fb6209..3fe120364ac61d40d6d8b16339e3086a
+ public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { + 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; + if (getHandle().connection == null) return;
+ final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level.registryAccess().registryOrThrow(net.minecraft.core.Registry.CHAT_TYPE_REGISTRY); + final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level.registryAccess().registryOrThrow(net.minecraft.core.Registry.CHAT_TYPE_REGISTRY);
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, type == net.kyori.adventure.audience.MessageType.SYSTEM)); + this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, false));
+ } + }
+ +
+ @Override + @Override