diff options
author | makamys <makamys@outlook.com> | 2021-06-16 16:13:45 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-06-16 17:30:34 +0200 |
commit | 9360f9d3a8d7ddd6079341f48a3464ccff06deaa (patch) | |
tree | 49a3474fa9be24a791566a4036eafc3864d6d164 /src/main/java/makamys/lodmod/renderer | |
parent | ee1600619e7e0c4cb7b19ebe09ceade8d72f4b24 (diff) | |
download | Neodymium-9360f9d3a8d7ddd6079341f48a3464ccff06deaa.tar.gz Neodymium-9360f9d3a8d7ddd6079341f48a3464ccff06deaa.tar.bz2 Neodymium-9360f9d3a8d7ddd6079341f48a3464ccff06deaa.zip |
Fix mod breaking when travelling between dimensions
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index fd04dcc..2d08bfb 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -74,6 +74,8 @@ public class LODRenderer { private boolean hasServerInited = false; private Map<ChunkCoordIntPair, LODRegion> loadedRegionsMap = new HashMap<>(); + public World world; + // TODO make these packets to make this work on dedicated servers Queue<Chunk> farChunks = new ConcurrentLinkedQueue<>(); @@ -93,8 +95,9 @@ public class LODRenderer { private boolean freezeMeshes; public boolean disableChunkMeshes = true; - public LODRenderer(){ + public LODRenderer(World world){ hasInited = init(); + this.world = world; } public void preRenderSortedRenderers(int renderPass, double alpha, WorldRenderer[] sortedWorldRenderers) { @@ -497,7 +500,7 @@ public class LODRenderer { int chunkLoadsRemaining = LODMod.chunkLoadsPerTick; while(!serverChunkLoadQueue.isEmpty() && chunkLoadsRemaining-- > 0) { ChunkCoordIntPair coords = serverChunkLoadQueue.remove(0); - ChunkProviderServer chunkProviderServer = Minecraft.getMinecraft().getIntegratedServer().worldServers[0].theChunkProviderServer; + ChunkProviderServer chunkProviderServer = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(world.provider.dimensionId).theChunkProviderServer; Chunk chunk = chunkProviderServer.currentChunkProvider.provideChunk(coords.chunkXPos, coords.chunkZPos); SimpleChunkMesh.prepareFarChunkOnServer(chunk); farChunks.add(chunk); |