OpenCubicChunks / CubicChunks2

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

SurfaceTracker cleanup (WIP) #100

Open Cyclonit opened 2 years ago

Cyclonit commented 2 years ago

This PR is supposed to tackle the following issues:

  1. Complex coupling between HeightmapNode, SurfaceTrackerLeaf and SurfaceTrackerBranch HeightmapNodes (LevelCube and ProtoCube) contain references to SurfaceTrackerLeaves and vice-versa. The HightmapNodes create SurfaceTrackerLeaves, which then invoke a method "sectionLoaded" that adds the SurfaceTrackerLeaf to a reference list within the HeightmapNode. Instead HeightmapNodes should simply create the leaves and add them to their internal lists themselves.

  2. Faulty handling of heightmaps during ProtoCube promotion to LevelCube When a LevelCube is created based on a ProtoCube, it should inherit all of the ProtoCube's heightmaps. As of right now, this behaviour is faulty because of the overly complex interactions between cubes and heightmaps.