Send unload packet

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-07 21:26:24 +02:00
parent e1c4a7afce
commit 3e386a1491

View File

@ -1181,7 +1181,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
ArrayUtils.forDifferencesBetweenArray(lastVisibleChunks, updatedVisibleChunks, chunkIndex -> {
final int chunkX = ChunkUtils.getChunkCoordX(chunkIndex);
final int chunkZ = ChunkUtils.getChunkCoordZ(chunkIndex);
//playerConnection.sendPacket(new UnloadChunkPacket(chunkX, chunkZ));
this.playerConnection.sendPacket(new UnloadChunkPacket(chunkX, chunkZ));
final Chunk chunk = instance.getChunk(chunkX, chunkZ);
if (chunk != null) {
chunk.removeViewer(this);
@ -1193,7 +1193,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
final int chunkZ = ChunkUtils.getChunkCoordZ(chunkIndex);
this.instance.loadOptionalChunk(chunkX, chunkZ).thenAccept(chunk -> {
if (chunk == null) {
// Cannot load chunk (auto load is not enabled)
// Cannot load chunk (auto-load is not enabled)
return;
}
try {