OpenCubicChunks / CubicChunks2

Infinite* height mod for Minecraft - rewrite for versions above 1.12
MIT License
72 stars 21 forks source link

Heightmap reference tracking implementation #93

Closed NotStirred closed 2 years ago

NotStirred commented 2 years ago

SurfaceTrackerSection was split into a base class SurfaceTrackerNode, and two derived classes: SurfaceTrackerBranch, SurfaceTrackerLeaf, which splits their implementation making it far simpler.

All of the Light specific SurfaceTrackerSection stuff is now gone, leaving only the LightSurfaceTrackerWrapper and the light cube implementation remaining.

SurfaceTrackerBranches have a requiredChildren value, which for scale 1 branches is the number of their children (leaves) with a cube loaded. Any node with requiredChildren will be required by its parent. If the requiredChildren is 0, all children can be unloaded.

NotStirred commented 2 years ago

More tests to come, once I get around to writing them

NotStirred commented 2 years ago

I'd like to write some debug output for runtime that verifies the state of the heightmap tree for each column

Once I have, I'll be much more confident to merge