diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 95ba2c24..c1afb07c 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -177,6 +177,7 @@ public class ServerConnector extends PacketHandler // TODO: Move this to the connected() method of DownstreamBridge target.addPlayer( user ); user.getPendingConnects().remove( target ); + user.setDimensionChange( false ); user.setServer( server ); ch.getHandle().pipeline().get( HandlerBoss.class ).setHandler( new DownstreamBridge( bungee, user, server ) ); @@ -211,7 +212,7 @@ public class ServerConnector extends PacketHandler } String message = bungee.getTranslation( "connect_kick" ) + target.getName() + ": " + event.getKickReason(); - if ( user.getServer() == null ) + if ( user.isDimensionChange() ) { user.disconnect( message ); } else 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 621b2347..436051c3 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -60,6 +60,9 @@ public final class UserConnection implements ProxiedPlayer @Setter private ServerConnection server; @Getter + @Setter + private boolean dimensionChange = true; + @Getter private final Object switchMutex = new Object(); @Getter private final Collection pendingConnects = new HashSet<>(); @@ -161,6 +164,7 @@ public final class UserConnection implements ProxiedPlayer void sendDimensionSwitch() { + dimensionChange = true; unsafe().sendPacket( PacketConstants.DIM1_SWITCH ); unsafe().sendPacket( PacketConstants.DIM2_SWITCH ); } @@ -224,7 +228,7 @@ public final class UserConnection implements ProxiedPlayer connect( def, false ); } else { - if ( server == null ) + if ( dimensionChange ) { disconnect( bungee.getTranslation( "fallback_kick" ) + future.cause().getClass().getName() ); } else