mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-11 22:30:26 +01:00
Do not call Chunk#removeViewer
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
c7ee6cecf3
commit
1c9b6f3529
@ -216,12 +216,7 @@ public class InstanceContainer extends Instance {
|
||||
if (!isLoaded(chunk)) return;
|
||||
final int chunkX = chunk.getChunkX();
|
||||
final int chunkZ = chunk.getChunkZ();
|
||||
|
||||
chunk.sendPacketToViewers(new UnloadChunkPacket(chunkX, chunkZ));
|
||||
for (Player viewer : chunk.getViewers()) {
|
||||
chunk.removeViewer(viewer);
|
||||
}
|
||||
|
||||
EventDispatcher.call(new InstanceChunkUnloadEvent(this, chunk));
|
||||
// Remove all entities in chunk
|
||||
getEntityTracker().chunkEntities(chunkX, chunkZ, EntityTracker.Target.ENTITIES).forEach(Entity::remove);
|
||||
|
Loading…
Reference in New Issue
Block a user