mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-12 06:44:16 +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;
|
if (!isLoaded(chunk)) return;
|
||||||
final int chunkX = chunk.getChunkX();
|
final int chunkX = chunk.getChunkX();
|
||||||
final int chunkZ = chunk.getChunkZ();
|
final int chunkZ = chunk.getChunkZ();
|
||||||
|
|
||||||
chunk.sendPacketToViewers(new UnloadChunkPacket(chunkX, chunkZ));
|
chunk.sendPacketToViewers(new UnloadChunkPacket(chunkX, chunkZ));
|
||||||
for (Player viewer : chunk.getViewers()) {
|
|
||||||
chunk.removeViewer(viewer);
|
|
||||||
}
|
|
||||||
|
|
||||||
EventDispatcher.call(new InstanceChunkUnloadEvent(this, chunk));
|
EventDispatcher.call(new InstanceChunkUnloadEvent(this, chunk));
|
||||||
// Remove all entities in chunk
|
// Remove all entities in chunk
|
||||||
getEntityTracker().chunkEntities(chunkX, chunkZ, EntityTracker.Target.ENTITIES).forEach(Entity::remove);
|
getEntityTracker().chunkEntities(chunkX, chunkZ, EntityTracker.Target.ENTITIES).forEach(Entity::remove);
|
||||||
|
Loading…
Reference in New Issue
Block a user