Skip to content

Commit

Permalink
Fix stale ViewFurstum state on the client before changing render dist…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
Barteks2x committed Dec 26, 2023
1 parent 9fa3626 commit 929d75c
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Expand Down

0 comments on commit 929d75c

Please sign in to comment.