From 7f25f5ff5df2875a891f58dd1d2861ff7404cb31 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:46:39 +1000 Subject: [PATCH] fixed uhoh --- .../me/cortex/voxy/common/world/WorldSection.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/cortex/voxy/common/world/WorldSection.java b/src/main/java/me/cortex/voxy/common/world/WorldSection.java index 39799831..b72694b2 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldSection.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldSection.java @@ -204,12 +204,6 @@ public final class WorldSection { } public int addNonEmptyBlockCount(int delta) { - if (VERIFY_WORLD_SECTION_EXECUTION) { - if (this.lvl != 0) { - throw new IllegalStateException("Tried updating a level 0 lod when its not level 0: " + WorldEngine.pprintPos(this.key)); - } - } - int count = ((int)NON_EMPTY_BLOCK_HANDLE.getAndAdd(this, delta)) + delta; if (VERIFY_WORLD_SECTION_EXECUTION) { if (count < 0) { @@ -220,6 +214,11 @@ public final class WorldSection { } public boolean updateLvl0State() { + if (VERIFY_WORLD_SECTION_EXECUTION) { + if (this.lvl != 0) { + throw new IllegalStateException("Tried updating a level 0 lod when its not level 0: " + WorldEngine.pprintPos(this.key)); + } + } byte prev, next; do { prev = this.getNonEmptyChildren();