From f45ed11a59a16791cb898496e3b699e9b06e4f0f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 28 May 2022 13:17:53 +0200 Subject: [PATCH] Fix TeamCommand tp no message --- .../bungeecore/commands/TeamCommand.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index 910243a..16eaf75 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -587,14 +587,18 @@ public class TeamCommand extends BasicCommand { ProxyServer.getInstance().getServers().put(info.getName(), info); return info; }); - player.connect(serverInfo, (success, error) -> { - if (error != null) { - error.printStackTrace(); - } - if (error instanceof ConnectTimeoutException) { - Message.send("TEAM_TIMEOUT", player); - } - }); + try { + player.connect(serverInfo, (success, error) -> { + if (error != null) { + error.printStackTrace(); + } + if (error instanceof ConnectTimeoutException) { + Message.send("TEAM_TIMEOUT", player); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } } private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){