From 35bd5fa414ebc28e8108d062e0e232e8f39af061 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:40:47 +1000 Subject: [PATCH] forward neighbor edge msk --- .../core/rendering/hierachical/AsyncNodeManager.java | 2 +- .../java/me/cortex/voxy/common/world/WorldEngine.java | 8 ++++---- .../java/me/cortex/voxy/common/world/WorldUpdater.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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 4055a00f..c71317e6 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 @@ -760,7 +760,7 @@ public class AsyncNodeManager { return this.workCounter.get()!=0 || RESULT_HANDLE.get(this) != null; } - public void worldEvent(WorldSection section, int flags) { + public void worldEvent(WorldSection section, int flags, int neighborMask) { //If there is any change, we need to clear the geometry cache before emitting update this.geometryCache.clear(section.key); diff --git a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java index 3645375f..32b3a1e1 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java @@ -19,7 +19,7 @@ public class WorldEngine { public static final int UPDATE_TYPE_DONT_SAVE = 4; public static final int DEFAULT_UPDATE_FLAGS = UPDATE_TYPE_BLOCK_BIT | UPDATE_TYPE_CHILD_EXISTENCE_BIT; - public interface ISectionChangeCallback {void accept(WorldSection section, int updateFlags);} + public interface ISectionChangeCallback {void accept(WorldSection section, int updateFlags, int neighborMsk);} public interface ISectionSaveCallback {void save(WorldEngine engine, WorldSection section);} private final TrackedObject thisTracker = TrackedObject.createTrackedObject(this); @@ -113,16 +113,16 @@ public class WorldEngine { //Marks a section as dirty, enqueuing it for saving and or render data rebuilding public void markDirty(WorldSection section) { - this.markDirty(section, DEFAULT_UPDATE_FLAGS); + this.markDirty(section, DEFAULT_UPDATE_FLAGS, 0); } - public void markDirty(WorldSection section, int changeState) { + public void markDirty(WorldSection section, int changeState, int neighborMsk) { if (!this.isLive) throw new IllegalStateException("World is not live"); if (section.tracker != this.sectionTracker) { throw new IllegalStateException("Section is not from here"); } if (this.dirtyCallback != null) { - this.dirtyCallback.accept(section, changeState); + this.dirtyCallback.accept(section, changeState, neighborMsk); } if ((!section.inSaveQueue)&&(changeState&UPDATE_TYPE_DONT_SAVE)==0) { section.markDirty(); diff --git a/src/main/java/me/cortex/voxy/common/world/WorldUpdater.java b/src/main/java/me/cortex/voxy/common/world/WorldUpdater.java index ddaee5c1..22a402ba 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldUpdater.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldUpdater.java @@ -113,7 +113,7 @@ public class WorldUpdater { neighbors |= ((section.z^(section.z+1))>>(lvl+1))==0?0:1<<5;//+z } - into.markDirty(worldSection, (didStateChange?UPDATE_TYPE_BLOCK_BIT:0)|(emptinessStateChange!=0?UPDATE_TYPE_CHILD_EXISTENCE_BIT:0)); + into.markDirty(worldSection, (didStateChange?UPDATE_TYPE_BLOCK_BIT:0)|(emptinessStateChange!=0?UPDATE_TYPE_CHILD_EXISTENCE_BIT:0), neighbors); } //Need to release the section after using it