From 4bb0474f4d083df641539cbf1592e61db4027794 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:34:18 +1000 Subject: [PATCH] Add ref method --- src/main/java/me/cortex/voxy/common/world/WorldSection.java | 4 ++++ 1 file changed, 4 insertions(+) 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 add1fd7c..dfdce516 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldSection.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldSection.java @@ -46,6 +46,10 @@ public final class WorldSection { return state>>1; } + public int getRefCount() { + return this.atomicState.get()>>1; + } + public int release() { int state = this.atomicState.addAndGet(-2); if (state < 1) {