mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 05:58:00 +01:00
Fixed entities not being removed from viewing list after changing instance
This commit is contained in:
parent
920a16300e
commit
424256dcb6
@ -564,6 +564,7 @@ public class Player extends LivingEntity implements CommandSender {
|
|||||||
final boolean isLast = counter.get() == length - 1;
|
final boolean isLast = counter.get() == length - 1;
|
||||||
if (isLast) {
|
if (isLast) {
|
||||||
// This is the last chunk to be loaded , spawn player
|
// This is the last chunk to be loaded , spawn player
|
||||||
|
this.viewableEntities.forEach(entity -> entity.removeViewer(this));
|
||||||
super.setInstance(instance);
|
super.setInstance(instance);
|
||||||
PlayerSpawnEvent spawnEvent = new PlayerSpawnEvent(instance, firstSpawn);
|
PlayerSpawnEvent spawnEvent = new PlayerSpawnEvent(instance, firstSpawn);
|
||||||
callEvent(PlayerSpawnEvent.class, spawnEvent);
|
callEvent(PlayerSpawnEvent.class, spawnEvent);
|
||||||
|
Loading…
Reference in New Issue
Block a user