mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
72d0717d5d
A recent commit has been made that caused patches to be out of order, rebuilding
36 lines
No EOL
1.8 KiB
Diff
36 lines
No EOL
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 37315233e..044da2754 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
|
break;
|
|
}
|
|
}
|
|
+ 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
|
|
index 497372124..0e0c7b1ab 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
|
|
Long2ObjectMap long2objectmap = this.chunks;
|
|
|
|
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
|
|
|
|
return chunk != null ? chunk : this.loadChunkAt(i, j);
|
|
}
|
|
--
|