Throw warning instead of error when trying to send a plugin message to a player thats not connected to a server

This commit is contained in:
ajgeiss0702
2023-04-30 09:59:16 -07:00
committed by ajgeiss0702
parent b049db715a
commit 047c806369
@@ -50,7 +50,8 @@ public class VelocityMethods implements PlatformMethods {
}
Optional<ServerConnection> server = velocityPlayer.getCurrentServer();
if(!server.isPresent()) {
throw new IllegalStateException("No server to send data to");
logger.warn("Unable to send message to " + player.getName() + ", as they are not connected to any server!");
return;
}
server.get().sendPluginMessage(MinecraftChannelIdentifier.from("ajqueue:tospigot"), out.toByteArray());
}