2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-12-13 00:40:29 +00:00
|
|
|
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
|
2021-01-11 01:44:06 +00:00
|
|
|
index cd64fb9d0c6d123e1c86cb33f12cd9cefc9f80d0..74ba5dbb83c13ce1721619b755036a7864a1fb90 100644
|
2018-12-13 00:40:29 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-01-11 01:44:06 +00:00
|
|
|
@@ -238,4 +238,14 @@ public class PaperWorldConfig {
|
2019-02-26 01:38:55 +00:00
|
|
|
skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
}
|
2018-12-13 00:40:29 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
}
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
2021-03-16 15:50:45 +00:00
|
|
|
index fdc491f978560c394eec22116572585f9bbdec9f..b6898cd6e6117fef65198db32b98a64c806811d4 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
|
2021-03-16 15:50:45 +00:00
|
|
|
@@ -1022,7 +1022,7 @@ public class Chunk implements IChunkAccess {
|
2018-12-13 00:40:29 +00:00
|
|
|
|
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
|
2018-12-13 00:40:29 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 03:05:36 +00:00
|
|
|
@Override
|