From 929d75c778b7d053224ae17fa49aa3439c52e310 Mon Sep 17 00:00:00 2001 From: Bartosz Skrzypczak Date: Tue, 26 Dec 2023 14:46:06 +0100 Subject: [PATCH] Fix stale ViewFurstum state on the client before changing render distance --- .../cubicchunks/core/network/PacketCubicWorldData.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/opencubicchunks/cubicchunks/core/network/PacketCubicWorldData.java b/src/main/java/io/github/opencubicchunks/cubicchunks/core/network/PacketCubicWorldData.java index 8e25a210e..1aedf0f90 100644 --- a/src/main/java/io/github/opencubicchunks/cubicchunks/core/network/PacketCubicWorldData.java +++ b/src/main/java/io/github/opencubicchunks/cubicchunks/core/network/PacketCubicWorldData.java @@ -123,14 +123,8 @@ public void handleClientMessage(World world, EntityPlayer player, PacketCubicWor new IntRange(message.getMinHeight(), message.getMaxHeight()), new IntRange(message.getMinGenerationHeight(), message.getMaxGenerationHeight()) ); - if (FMLClientHandler.instance().hasOptifine()) { - // OptiFine optimizes RenderChunk to contain references to it's neighbors - // These references are first updated before the world is marked as cubic chunks world - // This means there are going to be null values in unexpected places - // after making the world CubicChunks world without updating that - // This updates the renderers to avoid the issue - Minecraft.getMinecraft().renderGlobal.setWorldAndLoadRenderers((WorldClient) world); - } + // Update stale ViewFrustum/RenderChunk-related state, as it was previously set for non-CC world + Minecraft.getMinecraft().renderGlobal.setWorldAndLoadRenderers((WorldClient) world); } }