Skip to content

Commit

Permalink
Add catch around velocity-kick-message (because it seems to be causin…
Browse files Browse the repository at this point in the history
…g some issues ofr some people for some reason)
  • Loading branch information
ajgeiss0702 committed Jan 28, 2024
1 parent 7af094d commit 2b0d6ce
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b0d6ce

Please sign in to comment.