aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0075-Configurable-Chunk-Inhabited-Time.patch
diff options
context:
space:
mode:
authorOwen <[email protected]>2022-03-11 15:13:46 -0500
committerGitHub <[email protected]>2022-03-11 21:13:46 +0100
commitea1efef1164aa7653119eb4be000749930e5b4da (patch)
tree104968ec407cf897e14388b14d2bf397844c8279 /patches/server/0075-Configurable-Chunk-Inhabited-Time.patch
parent1790528a6104c7c801e02a6f6d2ec0dda70e2af9 (diff)
downloadPaper-ea1efef1164aa7653119eb4be000749930e5b4da.tar.gz
Paper-ea1efef1164aa7653119eb4be000749930e5b4da.zip
Remove Patches (#7541)
Diffstat (limited to 'patches/server/0075-Configurable-Chunk-Inhabited-Time.patch')
-rw-r--r--patches/server/0075-Configurable-Chunk-Inhabited-Time.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches/server/0075-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0075-Configurable-Chunk-Inhabited-Time.patch
new file mode 100644
index 0000000000..bf6d556f43
--- /dev/null
+++ b/patches/server/0075-Configurable-Chunk-Inhabited-Time.patch
@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Mon, 28 Mar 2016 20:46:14 -0400
+Subject: [PATCH] Configurable Chunk Inhabited Time
+
+Vanilla stores how long a chunk has been active on a server, and dynamically scales some
+aspects of vanilla gameplay to this factor.
+
+For people who want all chunks to be treated equally, you can chose a fixed value.
+
+This allows to fine-tune vanilla gameplay.
+
+diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+index aa8cd5965632626e4cbd4952acf9b349f79b2b1c..e7534ed3f995be64c99399ab76e98086cf37bb7f 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+@@ -284,4 +284,14 @@ public class PaperWorldConfig {
+ skeleHorseSpawnChance = 0.01D; // Vanilla value
+ }
+ }
++
++ public int fixedInhabitedTime;
++ private void fixedInhabitedTime() {
++ if (PaperConfig.version < 16) {
++ if (!config.getBoolean("world-settings.default.use-chunk-inhabited-timer", true)) config.set("world-settings.default.fixed-chunk-inhabited-time", 0);
++ if (!config.getBoolean("world-settings." + worldName + ".use-chunk-inhabited-timer", true)) config.set("world-settings." + worldName + ".fixed-chunk-inhabited-time", 0);
++ set("use-chunk-inhabited-timer", null);
++ }
++ fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
++ }
+ }
+diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+index aa8524af06132096cf593614301cde6a814ff41f..7b964beaaa66ac1c8b20dd7bda665ee30ca61b98 100644
+--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
++++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+@@ -281,6 +281,13 @@ public class LevelChunk extends ChunkAccess {
+ return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
+ }
+
++ // Paper start
++ @Override
++ public long getInhabitedTime() {
++ return this.level.paperConfig.fixedInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig.fixedInhabitedTime;
++ }
++ // Paper end
++
+ @Override
+ public GameEventDispatcher getEventDispatcher(int ySectionCoord) {
+ return (GameEventDispatcher) this.gameEventDispatcherSections.computeIfAbsent(ySectionCoord, (j) -> {