2021-06-11 14:02:28 +02:00
|
|
|
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
|
2021-09-01 11:54:41 +02:00
|
|
|
index eae8a876b05c17d87b3971f8f2568ae5379feddb..8ccdae60f97c38f7a56b68e94a801c7ee3fa9079 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-09-01 11:54:41 +02:00
|
|
|
@@ -243,4 +243,14 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
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
|
2021-07-17 03:48:27 +02:00
|
|
|
index 29fda19d7e1a8b6675598de22967e2aec81091fa..702dbe24bfd19b0999648d4364f68a5675bee6e0 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
2021-07-17 03:48:27 +02:00
|
|
|
@@ -984,7 +984,7 @@ public class LevelChunk implements ChunkAccess {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public long getInhabitedTime() {
|
|
|
|
- return this.inhabitedTime;
|
2021-06-12 04:24:43 +02:00
|
|
|
+ return this.level.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : this.level.paperConfig.fixedInhabitedTime; // Paper
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|