mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Send unload packet
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
e1c4a7afce
commit
3e386a1491
@ -1181,7 +1181,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
ArrayUtils.forDifferencesBetweenArray(lastVisibleChunks, updatedVisibleChunks, chunkIndex -> {
|
ArrayUtils.forDifferencesBetweenArray(lastVisibleChunks, updatedVisibleChunks, chunkIndex -> {
|
||||||
final int chunkX = ChunkUtils.getChunkCoordX(chunkIndex);
|
final int chunkX = ChunkUtils.getChunkCoordX(chunkIndex);
|
||||||
final int chunkZ = ChunkUtils.getChunkCoordZ(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);
|
final Chunk chunk = instance.getChunk(chunkX, chunkZ);
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunk.removeViewer(this);
|
chunk.removeViewer(this);
|
||||||
@ -1193,7 +1193,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
final int chunkZ = ChunkUtils.getChunkCoordZ(chunkIndex);
|
final int chunkZ = ChunkUtils.getChunkCoordZ(chunkIndex);
|
||||||
this.instance.loadOptionalChunk(chunkX, chunkZ).thenAccept(chunk -> {
|
this.instance.loadOptionalChunk(chunkX, chunkZ).thenAccept(chunk -> {
|
||||||
if (chunk == null) {
|
if (chunk == null) {
|
||||||
// Cannot load chunk (auto load is not enabled)
|
// Cannot load chunk (auto-load is not enabled)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user