From 04900a05fda5b010965746d384f823a36df544a9 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Fri, 12 Jun 2026 09:57:28 +0800 Subject: [PATCH] fix(gameplay): re-enable border blending and protect water in cave gen --- src/gameplay/chunk.cpp | 2 +- src/gameplay/chunk_generator.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gameplay/chunk.cpp b/src/gameplay/chunk.cpp index 341bd49..430fd85 100644 --- a/src/gameplay/chunk.cpp +++ b/src/gameplay/chunk.cpp @@ -199,7 +199,7 @@ void Chunk::gen_phase_six( Logger::error("ChunkGenerator is Nullptr"); return; } - // m_generator->blend_surface_blocks_borders(neighbor_block); + m_generator->blend_surface_blocks_borders(neighbor_block); m_generator->generate_cave(); m_generator->generate_river(); } diff --git a/src/gameplay/chunk_generator.cpp b/src/gameplay/chunk_generator.cpp index 0fb9b0b..f57cbe5 100644 --- a/src/gameplay/chunk_generator.cpp +++ b/src/gameplay/chunk_generator.cpp @@ -688,6 +688,10 @@ void ChunkGenerator::generate_cave() { if (blocks[Chunk::index(x, y, z)] == 7) { continue; } + if (y < WORLD_SIZE_Y - 1 && + blocks[Chunk::index(x, y + 1, z)] == 7) { + continue; + } blocks[Chunk::index(x, y, z)] = 0; } }