2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-12-13 01:40:29 +01: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
|
2020-05-06 11:48:49 +02:00
|
|
|
index 6ef0e1399e9ff260712db1a044068c125b1316d3..5872e6b171416686b11678ac9f65706b83b4e231 100644
|
2018-12-13 01:40:29 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-01-18 18:28:32 +01:00
|
|
|
@@ -236,4 +236,14 @@ public class PaperWorldConfig {
|
2019-02-26 02:38:55 +01:00
|
|
|
skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
}
|
2018-12-13 01:40:29 +01: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);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 4b162a768ed7f0a319309430b081943bf9c39b9c..6694d0e36c0a3dc86c5b4e6fc1f132395ac36fc0 100644
|
2018-12-13 01:40:29 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2020-05-06 09:44:47 +02:00
|
|
|
@@ -970,7 +970,7 @@ public class Chunk implements IChunkAccess {
|
2018-12-13 01:40:29 +01:00
|
|
|
|
2019-04-27 05:05:36 +02:00
|
|
|
@Override
|
2019-12-11 03:43:21 +01:00
|
|
|
public long getInhabitedTime() {
|
|
|
|
- return this.inhabitedTime;
|
|
|
|
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : world.paperConfig.fixedInhabitedTime; // Paper
|
2018-12-13 01:40:29 +01:00
|
|
|
}
|
|
|
|
|
2019-04-27 05:05:36 +02:00
|
|
|
@Override
|