From 047c806369d5ce44546baab95f19ff9fc339c5c9 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sun, 30 Apr 2023 09:59:16 -0700 Subject: [PATCH] Throw warning instead of error when trying to send a plugin message to a player thats not connected to a server --- .../us/ajg0702/queue/platforms/velocity/VelocityMethods.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/VelocityMethods.java b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/VelocityMethods.java index 1be9456..b552710 100644 --- a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/VelocityMethods.java +++ b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/VelocityMethods.java @@ -50,7 +50,8 @@ public class VelocityMethods implements PlatformMethods { } Optional 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()); }