From 5cac71c3aa9cb0f1f6435ad50f4098319f2217a9 Mon Sep 17 00:00:00 2001 From: makamys Date: Mon, 10 May 2021 16:23:41 +0200 Subject: Fix chunk load queue getting reset when the player moves --- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 28dd175..56ca600 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -169,7 +169,7 @@ public class LODRenderer { } } Collections.sort(newServerChunkLoadQueue, new ChunkCoordDistanceComparator(player.posX, player.posY, player.posZ)); - setServerChunkLoadQueue(newServerChunkLoadQueue); + addToServerChunkLoadQueue(newServerChunkLoadQueue); lastSortX = player.posX; lastSortY = player.posY; @@ -450,8 +450,8 @@ public class LODRenderer { return Math.pow(lastSortX - player.posX, 2) + Math.pow(lastSortZ - player.posZ, 2); } - private synchronized void setServerChunkLoadQueue(List coords) { - serverChunkLoadQueue = coords; + private synchronized void addToServerChunkLoadQueue(List coords) { + serverChunkLoadQueue.addAll(coords); } private LODChunk receiveFarChunk(Chunk chunk) { -- cgit