2019-06-14 10:27:40 +08:00
|
|
|
From e0f769ea12c51efaaabab602dd595c0d16b922c0 Mon Sep 17 00:00:00 2001
|
2018-12-13 08:40:29 +08: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
|
2019-05-28 07:01:45 +08:00
|
|
|
index 2a71381dae..e43866991c 100644
|
2018-12-13 08:40:29 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-27 11:05:36 +08:00
|
|
|
@@ -229,4 +229,19 @@ public class PaperWorldConfig {
|
2019-02-26 09:38:55 +08:00
|
|
|
skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
}
|
2018-12-13 08:40:29 +08:00
|
|
|
}
|
|
|
|
+
|
2019-02-26 09:38:55 +08:00
|
|
|
+ public boolean firePhysicsEventForRedstone = false;
|
|
|
|
+ private void firePhysicsEventForRedstone() {
|
|
|
|
+ firePhysicsEventForRedstone = getBoolean("fire-physics-event-for-redstone", firePhysicsEventForRedstone);
|
|
|
|
+ }
|
|
|
|
+
|
2018-12-13 08:40:29 +08: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
|
2019-05-28 07:01:45 +08:00
|
|
|
index d06e8dbc11..f9b6970ae6 100644
|
2018-12-13 08:40:29 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2019-05-28 07:01:45 +08:00
|
|
|
@@ -839,7 +839,7 @@ public class Chunk implements IChunkAccess {
|
2018-12-13 08:40:29 +08:00
|
|
|
|
2019-04-27 11:05:36 +08:00
|
|
|
@Override
|
|
|
|
public long q() {
|
|
|
|
- return this.t;
|
|
|
|
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.t : world.paperConfig.fixedInhabitedTime; // Paper
|
2018-12-13 08:40:29 +08:00
|
|
|
}
|
|
|
|
|
2019-04-27 11:05:36 +08:00
|
|
|
@Override
|
2018-12-13 08:40:29 +08:00
|
|
|
--
|
2019-04-05 12:52:02 +08:00
|
|
|
2.21.0
|
2018-12-13 08:40:29 +08:00
|
|
|
|