Paper/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch

45 lines
2.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 92d1dffbf436a21943b4a6aa0fabf54f064e6046..725958efab3dd05e04b7b18e169230762ef800d0 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -231,4 +231,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/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
2020-06-25 11:00:35 +00:00
index dc65ad095f9ec281c13f04254311d9cea80f43f8..c0b5d25f63741947c0d8ee32f317eb7fd3db4b65 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
2020-06-25 11:00:35 +00:00
@@ -977,7 +977,7 @@ public class Chunk implements IChunkAccess {
2019-04-27 03:05:36 +00:00
@Override
2019-12-11 02:43:21 +00:00
public long getInhabitedTime() {
- return this.inhabitedTime;
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : world.paperConfig.fixedInhabitedTime; // Paper
}
2019-04-27 03:05:36 +00:00
@Override