diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 4a04e8eb8..fdc6ee7f4 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -92,8 +92,8 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); - displayName=name; bungee.getTabListHandler().onDisconnect( this ); + displayName=name; bungee.getTabListHandler().onConnect( this ); } @@ -121,6 +121,11 @@ public final class UserConnection implements ProxiedPlayer ServerConnectEvent event = new ServerConnectEvent( this, info ); ProxyServer.getInstance().getPluginManager().callEvent( event ); final ServerInfo target = event.getTarget(); // Update in case the event changed target + if ( getServer() != null && getServer().getInfo() == target ) + { + sendMessage( ChatColor.RED + "Cannot connect to server you are already on!" ); + return; + } new Bootstrap() .channel( NioSocketChannel.class ) .group( BungeeCord.getInstance().eventLoops )