From 1d53f658a7ece06ace2b8f98b379f5f4319c2700 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:10:05 +1000 Subject: [PATCH] trigger neighbor mesh rebuild if rebuild mask says so --- .../core/rendering/hierachical/AsyncNodeManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/AsyncNodeManager.java b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/AsyncNodeManager.java index c71317e6..5fb9889a 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/AsyncNodeManager.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/AsyncNodeManager.java @@ -20,6 +20,7 @@ import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.util.AllocationArena; import me.cortex.voxy.common.util.MemoryBuffer; import me.cortex.voxy.common.util.UnsafeUtil; +import me.cortex.voxy.common.world.WorldEngine; import me.cortex.voxy.common.world.WorldSection; import org.lwjgl.system.MemoryUtil; @@ -765,6 +766,15 @@ public class AsyncNodeManager { this.geometryCache.clear(section.key); this.router.forwardEvent(section, flags); + + if (neighborMask != 0) {//trigger rebuilds for neighbors + if ((neighborMask&0b000001)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x, section.y-1, section.z));//-y + if ((neighborMask&0b000010)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x, section.y+1, section.z));//+y + if ((neighborMask&0b000100)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x-1, section.y, section.z));//-x + if ((neighborMask&0b001000)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x+1, section.y, section.z));//+x + if ((neighborMask&0b010000)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x, section.y, section.z-1));//-z + if ((neighborMask&0b100000)!=0) this.router.triggerRemesh(WorldEngine.getWorldSectionId(section.lvl, section.x, section.y, section.z+1));//+z + } } //Results object, which is to be synced between the render thread and worker thread