#2873: BossBar stays after switching servers

This commit is contained in:
md_5 2020-06-27 08:44:53 +10:00
parent 6cff5a955c
commit afcfac31a9
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -222,6 +222,12 @@ public class ServerConnector extends PacketHandler
user.getServer().setObsolete( true ); user.getServer().setObsolete( true );
user.getServerSentScoreboard().clear(); user.getServerSentScoreboard().clear();
for ( UUID bossbar : user.getSentBossBars() )
{
// Send remove bossbar packet
user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.BossBar( bossbar, 1 ) );
}
user.getSentBossBars().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 ) );