#2774: doImmediateRespawn not updated when switching servers

This commit is contained in:
md_5
2020-02-21 09:40:13 +11:00
parent 8ea25a8fc7
commit c2cc33c6d7
4 changed files with 58 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ import net.md_5.bungee.protocol.Protocol;
import net.md_5.bungee.protocol.ProtocolConstants;
import net.md_5.bungee.protocol.packet.EncryptionRequest;
import net.md_5.bungee.protocol.packet.EntityStatus;
import net.md_5.bungee.protocol.packet.GameState;
import net.md_5.bungee.protocol.packet.Handshake;
import net.md_5.bungee.protocol.packet.Kick;
import net.md_5.bungee.protocol.packet.Login;
@@ -251,6 +252,11 @@ public class ServerConnector extends PacketHandler
// Update debug info from login packet
user.unsafe().sendPacket( new EntityStatus( user.getClientEntityId(), login.isReducedDebugInfo() ? EntityStatus.DEBUG_INFO_REDUCED : EntityStatus.DEBUG_INFO_NORMAL ) );
// And immediate respawn
if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_15 )
{
user.unsafe().sendPacket( new GameState( GameState.IMMEDIATE_RESPAWN, login.isNormalRespawn() ? 0 : 1 ) );
}
user.setDimensionChange( true );
if ( login.getDimension() == user.getDimension() )