Clear scoreboards and bossbars on new style server switch

This commit is contained in:
md_5 2020-06-25 15:25:15 +10:00
parent 4786c0986b
commit 3409fe6dd3
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -220,6 +220,10 @@ public class ServerConnector extends PacketHandler
if ( user.getServer() != null ) if ( user.getServer() != null )
{ {
user.getServer().setObsolete( true ); user.getServer().setObsolete( true );
user.getServerSentScoreboard().clear();
user.getSentBossBars().clear();
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) );
user.getServer().disconnect( "Quitting" ); user.getServer().disconnect( "Quitting" );
} else } else