2019-02-26 02:38:55 +01:00
|
|
|
From 1d5190a00dcb30b662df5214303fc3ed91ef1600 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
|
2019-02-26 02:38:55 +01:00
|
|
|
index 0faef7cf28..d2559f7c48 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
|
2019-02-26 02:38:55 +01:00
|
|
|
@@ -228,4 +228,19 @@ public class PaperWorldConfig {
|
|
|
|
skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
}
|
2018-12-13 01:40:29 +01:00
|
|
|
}
|
|
|
|
+
|
2019-02-26 02:38:55 +01:00
|
|
|
+ public boolean firePhysicsEventForRedstone = false;
|
|
|
|
+ private void firePhysicsEventForRedstone() {
|
|
|
|
+ firePhysicsEventForRedstone = getBoolean("fire-physics-event-for-redstone", firePhysicsEventForRedstone);
|
|
|
|
+ }
|
|
|
|
+
|
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
|
2019-02-26 02:38:55 +01:00
|
|
|
index 182a637add..0421f8f959 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
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -1289,7 +1289,7 @@ public class Chunk implements IChunkAccess {
|
2018-12-13 01:40:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public long m() {
|
|
|
|
- return this.z;
|
|
|
|
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.z : world.paperConfig.fixedInhabitedTime; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
public void b(long i) {
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2018-12-13 01:40:29 +01:00
|
|
|
|