mirror of https://github.com/Minestom/Minestom.git
No need to retrieve the chunk to send unload packets
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
bf5c5aa479
commit
cca614fea8
|
@ -129,13 +129,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||
};
|
||||
final IntegerBiConsumer chunkRemover = (chunkX, chunkZ) -> {
|
||||
// Unload old chunks
|
||||
final Instance instance = this.instance;
|
||||
if (instance == null) return;
|
||||
final Chunk chunk = instance.getChunk(chunkX, chunkZ);
|
||||
if (chunk != null) {
|
||||
sendPacket(new UnloadChunkPacket(chunkX, chunkZ));
|
||||
GlobalHandles.PLAYER_CHUNK_UNLOAD.call(new PlayerChunkUnloadEvent(this, chunkX, chunkZ));
|
||||
}
|
||||
sendPacket(new UnloadChunkPacket(chunkX, chunkZ));
|
||||
GlobalHandles.PLAYER_CHUNK_UNLOAD.call(new PlayerChunkUnloadEvent(this, chunkX, chunkZ));
|
||||
};
|
||||
|
||||
private final AtomicInteger teleportId = new AtomicInteger();
|
||||
|
|
Loading…
Reference in New Issue