2018-08-03 07:33:34 +02:00
|
|
|
From 58d0f47f63481d1f00a5aa9628248cb1e77e58ef Mon Sep 17 00:00:00 2001
|
2018-04-22 16:40:49 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 21 Apr 2018 11:21:48 -0400
|
|
|
|
Subject: [PATCH] Configurable Allowance of Permanent Chunk Loaders
|
|
|
|
|
|
|
|
This disables the behavior that allows players to keep chunks permanently loaded
|
|
|
|
by default and allows server operators to enable it if they wish.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-08-03 07:33:34 +02:00
|
|
|
index 809441fc63..4a135d84db 100644
|
2018-04-22 16:40:49 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-08-03 07:33:34 +02:00
|
|
|
@@ -471,4 +471,9 @@ public class PaperWorldConfig {
|
2018-07-21 23:03:26 +02:00
|
|
|
break;
|
|
|
|
}
|
2018-04-22 16:40:49 +02:00
|
|
|
}
|
|
|
|
+ public boolean allowPermaChunkLoaders = false;
|
|
|
|
+ private void allowPermaChunkLoaders() {
|
|
|
|
+ allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders);
|
|
|
|
+ log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled"));
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2018-08-03 07:29:20 +02:00
|
|
|
index 4973721243..0e0c7b1abe 100644
|
2018-04-22 16:40:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2018-07-21 23:03:26 +02:00
|
|
|
@@ -111,7 +111,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|
|
|
Long2ObjectMap long2objectmap = this.chunks;
|
2018-04-22 16:40:49 +02:00
|
|
|
|
2018-07-21 23:03:26 +02:00
|
|
|
synchronized (this.chunks) {
|
|
|
|
- Chunk chunk = this.getLoadedChunkAt(i, j);
|
|
|
|
+ Chunk chunk = world.paperConfig.allowPermaChunkLoaders ? getLoadedChunkAt(i, j) : getChunkIfLoaded(i, j); // Paper - Configurable perma chunk loaders
|
2018-04-22 16:40:49 +02:00
|
|
|
|
2018-07-21 23:03:26 +02:00
|
|
|
return chunk != null ? chunk : this.loadChunkAt(i, j);
|
|
|
|
}
|
2018-04-22 16:40:49 +02:00
|
|
|
--
|
2018-06-30 07:40:52 +02:00
|
|
|
2.18.0
|
2018-04-22 16:40:49 +02:00
|
|
|
|