Fix sendPluginMessage (#926)

This commit is contained in:
EpicPlayerA10 2023-01-13 23:43:50 +01:00 committed by GitHub
parent d9ee34feac
commit 8a048f0505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,9 +155,10 @@ public class VelocityRegisteredServer implements RegisteredServer, ForwardingAud
*/
public boolean sendPluginMessage(ChannelIdentifier identifier, ByteBuf data) {
for (ConnectedPlayer player : players.values()) {
VelocityServerConnection connection = player.getConnectedServer();
if (connection != null && connection.getServer() == this) {
return connection.sendPluginMessage(identifier, data);
VelocityServerConnection serverConnection = player.getConnectedServer();
if (serverConnection != null && serverConnection.getConnection() != null
&& serverConnection.getServer() == this) {
return serverConnection.sendPluginMessage(identifier, data);
}
}