Fixed entities not being removed from viewing list after changing instance

This commit is contained in:
Felix Cravic 2020-08-06 18:39:56 +02:00
parent 920a16300e
commit 424256dcb6

View File

@ -564,6 +564,7 @@ public class Player extends LivingEntity implements CommandSender {
final boolean isLast = counter.get() == length - 1;
if (isLast) {
// This is the last chunk to be loaded , spawn player
this.viewableEntities.forEach(entity -> entity.removeViewer(this));
super.setInstance(instance);
PlayerSpawnEvent spawnEvent = new PlayerSpawnEvent(instance, firstSpawn);
callEvent(PlayerSpawnEvent.class, spawnEvent);