Commits
md_5 authored 342f4939f5e
1 + | From a40380650d8733bf7fd29bece2a61ded1ef4d246 Mon Sep 17 00:00:00 2001 |
2 + | From: md_5 <git@md-5.net> |
3 + | Date: Sat, 18 May 2024 11:39:58 +1000 |
4 + | Subject: [PATCH] Add unload-frozen-chunks option |
5 + | |
6 + | |
7 + | diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java |
8 + | index 9ae503080..9702d288a 100644 |
9 + | --- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java |
10 + | +++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java |
11 + | |
12 + | public void tick(BooleanSupplier booleansupplier, boolean flag) { |
13 + | this.level.getProfiler().push("purge"); |
14 + | this.level.timings.doChunkMap.startTiming(); // Spigot |
15 + | - if (this.level.tickRateManager().runsNormally() || !flag) { |
16 + | + if (this.level.tickRateManager().runsNormally() || !flag || this.level.spigotConfig.unloadFrozenChunks) { // Spigot |
17 + | this.distanceManager.purgeStaleTickets(); |
18 + | } |
19 + | |
20 + | diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java |
21 + | index ebddbf6d0..2891e2537 100644 |
22 + | --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java |
23 + | +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java |
24 + | |
25 + | private void belowZeroGenerationInExistingChunks() { |
26 + | belowZeroGenerationInExistingChunks = getBoolean("below-zero-generation-in-existing-chunks", true); |
27 + | } |
28 + | + |
29 + | + public boolean unloadFrozenChunks; |
30 + | + private void unloadFrozenChunks() { |
31 + | + unloadFrozenChunks = getBoolean("unload-frozen-chunks", false); |
32 + | + } |
33 + | } |
34 + | -- |
35 + | 2.45.1 |
36 + | |