aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-10 16:23:41 +0200
committermakamys <makamys@outlook.com>2021-05-10 16:23:41 +0200
commit5cac71c3aa9cb0f1f6435ad50f4098319f2217a9 (patch)
treee0067113ba25f38324f6281207648ae64ea53abf /src/main
parentf5683b4048072b566839ef07a2b6a06da91a07bc (diff)
downloadNeodymium-5cac71c3aa9cb0f1f6435ad50f4098319f2217a9.tar.gz
Neodymium-5cac71c3aa9cb0f1f6435ad50f4098319f2217a9.tar.bz2
Neodymium-5cac71c3aa9cb0f1f6435ad50f4098319f2217a9.zip
Fix chunk load queue getting reset when the player moves
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java6
1 files changed, 3 insertions, 3 deletions
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<ChunkCoordIntPair> coords) {
- serverChunkLoadQueue = coords;
+ private synchronized void addToServerChunkLoadQueue(List<ChunkCoordIntPair> coords) {
+ serverChunkLoadQueue.addAll(coords);
}
private LODChunk receiveFarChunk(Chunk chunk) {