Refactor structure, implement layers, add Erode/Fill/layer panel

- Restructure folder hierarchy: max 4 .rs per dir using subfolders
  (ops/operations -> brush/ + shaping/, model/ -> world/, io/* -> subtypes, etc.)
- Fix golden_test.rs comment, extract BrushApply helper, add World::with_heightmap
- Implement 6 layer data generators (Caves, River, Frost, Trees, Biome, Resources)
  with noise-based (OpenSimplex) and terrain-derived algorithms
- Fix clippy warnings, dead code cleanup, import path fixes
- GUI: add Erode&Fill tool modes with radio buttons/sliders/apply_tool
- GUI: add Layers panel with 6 checkboxes + CPU viewport overlay rendering
This commit is contained in:
loki5512344 2026-06-24 12:27:55 +02:00
parent 3d3798136d
commit bdd4564240
104 changed files with 5184 additions and 3912 deletions

View file

@ -151,9 +151,11 @@ fn test_golden_mca_roundtrip() {
assert_eq!(dim.name, "overworld");
assert_eq!(dim.seed, 42);
// Note: load_save currently has a TODO on line 129 of minecraft.rs —
// parsed chunks are not yet dispatched to tiles, so tiles is always
// empty after loading. We verify chunk parsing via the direct test below.
// Chunks are dispatched to tiles; verify we have data.
assert!(!dim.tiles.is_empty(), "tiles should contain parsed chunks");
let tile = dim.tiles.get(&(0, 0)).expect("tile (0,0) should exist");
// Chunk at global (0,0) → tile (0,0), height = 4 * 16 + 15 = 79
assert_eq!(tile.heightmap[0], 79, "first block height should be 79");
// --- 2. Direct region + chunk parsing verification ---
let region = Region::from_bytes(0, 0, &region_bytes).expect("region should parse");