SPIGOT-6408: Narrator chat only does not work

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-04-05 15:31:26 +10:00
parent 79672394a1
commit 0352f0e143

View File

@ -1023,8 +1023,8 @@
+ String message = String.format(queueEvent.getFormat(), queueEvent.getPlayer().getDisplayName(), queueEvent.getMessage()); + String message = String.format(queueEvent.getFormat(), queueEvent.getPlayer().getDisplayName(), queueEvent.getMessage());
+ PlayerConnection.this.minecraftServer.console.sendMessage(message); + PlayerConnection.this.minecraftServer.console.sendMessage(message);
+ if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) { + if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) {
+ for (Object player : PlayerConnection.this.minecraftServer.getPlayerList().players) { + for (EntityPlayer recipient : minecraftServer.getPlayerList().players) {
+ ((EntityPlayer) player).sendMessage(PlayerConnection.this.player.getUniqueID(), CraftChatMessage.fromString(message)); + recipient.getBukkitEntity().sendMessage(PlayerConnection.this.player.getUniqueID(), message);
+ } + }
+ } else { + } else {
+ for (Player player : queueEvent.getRecipients()) { + for (Player player : queueEvent.getRecipients()) {
@ -1053,8 +1053,8 @@
+ s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()); + s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
+ minecraftServer.console.sendMessage(s); + minecraftServer.console.sendMessage(s);
+ if (((LazyPlayerSet) event.getRecipients()).isLazy()) { + if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
+ for (Object recipient : minecraftServer.getPlayerList().players) { + for (EntityPlayer recipient : minecraftServer.getPlayerList().players) {
+ ((EntityPlayer) recipient).sendMessage(PlayerConnection.this.player.getUniqueID(), CraftChatMessage.fromString(s)); + recipient.getBukkitEntity().sendMessage(PlayerConnection.this.player.getUniqueID(), s);
+ } + }
+ } else { + } else {
+ for (Player recipient : event.getRecipients()) { + for (Player recipient : event.getRecipients()) {