diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/minecraft/MinecraftRenderWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/minecraft/MinecraftRenderWrapper.java index faaf22c27..d9c2a5b95 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/minecraft/MinecraftRenderWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/minecraft/MinecraftRenderWrapper.java @@ -148,64 +148,13 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper * the clipping plane. (For example, if you are high above the ground some chunks * will be incorrectly added, even though they are outside render range). */ - @Override - public HashSet getVanillaRenderedChunks() - { - // TODO: Fix/Implement this! - /* - - HashSet loadedPos = new HashSet<>(); - - // Wow, those are some long names! - // go through every RenderInfo to get the compiled chunks - - LevelRenderer renderer = MC.levelRenderer; - for (LevelRenderer.RenderChunkInfo worldRenderer$LocalRenderInformationContainer : renderer.renderChunks) - { - CompiledChunk compiledChunk = worldRenderer$LocalRenderInformationContainer.chunk.getCompiledChunk(); - if (!compiledChunk.hasNoRenderableLayers()) - { - // add the ChunkPos for every rendered chunk - BlockPos bpos = worldRenderer$LocalRenderInformationContainer.chunk.getOrigin(); - - loadedPos.add(new ChunkPosWrapper(bpos)); - } - } - - */ - - // For now, use a circle check - int chunkRenderDist = this.getRenderDistance(); - // if we have a odd render distance, we'll have a empty gap. This way we'll overlap by 1 instead, - // which is preferable to having a hole in the world - chunkRenderDist = chunkRenderDist % 2 == 0 ? chunkRenderDist : chunkRenderDist - 1; - - AbstractChunkPosWrapper centerChunkPos = MC_WRAPPER.getPlayerChunkPos(); - - // add every position within render distance - HashSet renderedPos = new HashSet(); - for (int chunkDeltaX = -chunkRenderDist; chunkDeltaX <= chunkRenderDist; chunkDeltaX++) - { - for(int chunkDeltaZ = -chunkRenderDist; chunkDeltaZ <= chunkRenderDist; chunkDeltaZ++) - { - if (chunkDeltaX*chunkDeltaX+chunkDeltaZ*chunkDeltaZ >= chunkRenderDist*chunkRenderDist) continue; - renderedPos.add(FACTORY.createChunkPos(centerChunkPos.getX() + chunkDeltaX, centerChunkPos.getZ() + chunkDeltaZ)); - } - } - return renderedPos; - } + + //TODO: impl this properly @Override - public HashSet getSodiumRenderedChunks() - { - // TODO: Implement this! - // For now, call the default method - + public HashSet getMaximumRenderedChunks() { // For now, use a circle check int chunkRenderDist = this.getRenderDistance(); - // if we have a odd render distance, we'll have a empty gap. This way we'll overlap by 1 instead, - // which is preferable to having a hole in the world - chunkRenderDist = chunkRenderDist % 2 == 0 ? chunkRenderDist : chunkRenderDist - 1; AbstractChunkPosWrapper centerChunkPos = MC_WRAPPER.getPlayerChunkPos(); @@ -215,12 +164,13 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper { for(int chunkDeltaZ = -chunkRenderDist; chunkDeltaZ <= chunkRenderDist; chunkDeltaZ++) { - if (chunkDeltaX*chunkDeltaX+chunkDeltaZ*chunkDeltaZ >= chunkRenderDist*chunkRenderDist) continue; + // The circle check using radius+1 because it seems to match the vanilla fog culled circle better + if (chunkDeltaX*chunkDeltaX+chunkDeltaZ*chunkDeltaZ >= (chunkRenderDist+1)*(chunkRenderDist+1)) continue; renderedPos.add(FACTORY.createChunkPos(centerChunkPos.getX() + chunkDeltaX, centerChunkPos.getZ() + chunkDeltaZ)); } } return renderedPos; - } + } @Override diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java index 3b99cbb9b..cdc20d719 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java @@ -486,7 +486,7 @@ public final class WorldGenerationStep { int targetIndex = referencedChunks.offsetOf(centreIndex, ox, oy); ChunkAccess target = referencedChunks.get(targetIndex); params.lodBuilder.generateLodNodeFromChunk(params.lodDim, new ChunkWrapper(target), - new LodBuilderConfig(generationMode)); + new LodBuilderConfig(generationMode), false); } } event.pEvent.endNano = System.nanoTime(); diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGeneratorWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGeneratorWrapper.java index 4b0a02370..3b488364e 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGeneratorWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGeneratorWrapper.java @@ -146,7 +146,7 @@ public class WorldGeneratorWrapper extends AbstractWorldGeneratorWrapper // The bool=true means that we wants to generate chunk, and that the returned ChunkAccess must not be null ChunkAccess ca = serverWorld.getChunkSource().getChunk(chunkX, chunkZ, targetStatus, true); if (ca == null) throw new RuntimeException("This should NEVER be null due to bool being true"); - lodBuilder.generateLodNodeFromChunk(lodDim, new ChunkWrapper(ca), new LodBuilderConfig(generationMode)); + lodBuilder.generateLodNodeFromChunk(lodDim, new ChunkWrapper(ca), new LodBuilderConfig(generationMode), false); // long duration = System.nanoTime()-t; diff --git a/core b/core index a8d52c105..cba75123c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a8d52c10595eecd04c117a3e3dad15d8b5f918d2 +Subproject commit cba75123c75f38d74c8dd81bafafd81f88ea524f