Skip to content

Commit 86977bb

Browse files
committed
change: rename lowMemoryMode to !useLegacyScheduling
1 parent 06c51bb commit 86977bb

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/Config.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ Whether to allow POIs (Point of Interest) to be unloaded
8080
""")
8181
.getBoolean(true, false);
8282

83-
public static final boolean lowMemoryMode = new ConfigSystem.ConfigAccessor()
84-
.key("chunkSystem.lowMemoryMode")
83+
public static final boolean useLegacyScheduling = new ConfigSystem.ConfigAccessor()
84+
.key("chunkSystem.useLegacyScheduling")
8585
.comment("""
86-
Whether to enable low memory mode
86+
Whether to use legacy scheduling for neighbor chunks
8787
88-
This will attempt to aggressively unload unneeded chunks, saving memory at the cost of additional
89-
overhead when generating new chunks.
88+
Enabling this restores the behavior of always loading in neighbor chunks when a chunk is loaded.
89+
90+
This is currently deprecated and will be removed in the future.
9091
""")
91-
.getBoolean(true, false);
92+
.getBoolean(false, false);
9293

9394
public static void init() {
9495
// intentionally empty

c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/NewChunkHolderVanillaInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void updateDeferredStatus(NewChunkStatus status) {
182182
}
183183

184184
private void triggerDeferredLoad(NewChunkStatus requestedStatus) {
185-
if (!Config.lowMemoryMode) return;
185+
if (Config.useLegacyScheduling) return;
186186
synchronized (this) {
187187
if (this.loadedDeferredStatus != null && this.loadedDeferredStatus.ordinal() >= requestedStatus.ordinal()) {
188188
return; // nothing to do

c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/TheChunkSystem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected void onItemDowngrade(ItemHolder<ChunkPos, ChunkState, ChunkLoadingCont
151151
Assertions.assertTrue(holder != null, "Holder should be managed by the vanilla interface");
152152
assert holder != null;
153153
vanillaHolder = holder.getUserData().get();
154-
if (Config.lowMemoryMode) {
154+
if (!Config.useLegacyScheduling) {
155155
vanillaHolder.updateDeferredStatus(NewChunkStatus.fromVanillaLevel(level));
156156
}
157157

@@ -168,7 +168,7 @@ protected void onItemDowngrade(ItemHolder<ChunkPos, ChunkState, ChunkLoadingCont
168168
} else {
169169
vanillaHolder = null;
170170
}
171-
if (Config.lowMemoryMode && vanillaHolder != null) {
171+
if (!Config.useLegacyScheduling && vanillaHolder != null) {
172172
vanillaHolder.updateDeferredStatus(NewChunkStatus.fromVanillaLevel(level));
173173
}
174174
if (newStatus != this.getUnloadedStatus() && vanillaHolder != null) {
@@ -181,7 +181,7 @@ protected void onItemDowngrade(ItemHolder<ChunkPos, ChunkState, ChunkLoadingCont
181181

182182
private static NewChunkStatus c2me$getDeferredStatusFromVanillaLevel(int level) {
183183
NewChunkStatus status = NewChunkStatus.fromVanillaLevel(level);
184-
if (Config.lowMemoryMode) {
184+
if (!Config.useLegacyScheduling) {
185185
if (status == NewChunkStatus.NEW) {
186186
return status;
187187
} else if (status.ordinal() < NewChunkStatus.SERVER_ACCESSIBLE.ordinal()) {

0 commit comments

Comments
 (0)