SPIGOT-6206: Use correct sender UUID for chat messages

By: Mariell Hoversholm <proximyst@proximyst.com>
This commit is contained in:
CraftBukkit/Spigot 2020-11-03 19:02:28 +11:00
parent b180ac1eb9
commit 8a6781edb0
2 changed files with 6 additions and 6 deletions

View file

@ -715,9 +715,9 @@
}
+ // CraftBukkit start - Support multi-line messages
+ public void sendMessage(IChatBaseComponent[] ichatbasecomponent) {
+ public void sendMessage(UUID uuid, IChatBaseComponent[] ichatbasecomponent) {
+ for (IChatBaseComponent component : ichatbasecomponent) {
+ this.sendMessage(component, SystemUtils.b);
+ this.sendMessage(component, (uuid == null) ? SystemUtils.b : uuid);
+ }
+ }
+ // CraftBukkit end

View file

@ -1003,11 +1003,11 @@
+ PlayerConnection.this.minecraftServer.console.sendMessage(message);
+ if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) {
+ for (Object player : PlayerConnection.this.minecraftServer.getPlayerList().players) {
+ ((EntityPlayer) player).sendMessage(CraftChatMessage.fromString(message));
+ ((EntityPlayer) player).sendMessage(PlayerConnection.this.player.getUniqueID(), CraftChatMessage.fromString(message));
+ }
+ } else {
+ for (Player player : queueEvent.getRecipients()) {
+ player.sendMessage(message);
+ player.sendMessage(PlayerConnection.this.player.getUniqueID(), message);
+ }
+ }
+ return null;
@ -1033,11 +1033,11 @@
+ minecraftServer.console.sendMessage(s);
+ if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
+ for (Object recipient : minecraftServer.getPlayerList().players) {
+ ((EntityPlayer) recipient).sendMessage(CraftChatMessage.fromString(s));
+ ((EntityPlayer) recipient).sendMessage(PlayerConnection.this.player.getUniqueID(), CraftChatMessage.fromString(s));
+ }
+ } else {
+ for (Player recipient : event.getRecipients()) {
+ recipient.sendMessage(s);
+ recipient.sendMessage(PlayerConnection.this.player.getUniqueID(), s);
+ }
+ }
+ }