From 2b0d6ce1a8e6211aa95b71ad3d4bf467ab69b3db Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 27 Jan 2024 19:47:28 -0700 Subject: [PATCH] Add catch around velocity-kick-message (because it seems to be causing some issues ofr some people for some reason) --- .../velocity/players/VelocityPlayer.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java index c73a1dc1..5aee4726 100644 --- a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java +++ b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java @@ -158,16 +158,20 @@ public void connect(AdaptedServer server) { } } - if(main.getConfig().getBoolean("velocity-kick-message")) { - handle.sendMessage( - main.getMessages().getComponent( - "velocity-kick-message", - "SERVER:" + server.getName(), - "REASON:" + - LegacyComponentSerializer.legacyAmpersand() - .serialize(reason) - ) - ); + try { + if(main.getConfig().getBoolean("velocity-kick-message")) { + handle.sendMessage( + main.getMessages().getComponent( + "velocity-kick-message", + "SERVER:" + server.getName(), + "REASON:" + + LegacyComponentSerializer.legacyAmpersand() + .serialize(reason) + ) + ); + } + } catch(Exception e) { + main.getLogger().warn("Error while sending velocity-kick-message:", e); } main.getEventHandler().onServerKick( this,