mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 03:32:46 +01:00
dd8b8df0ca
Also add the create search radius mojang recently introduced to config
47 lines
2 KiB
Diff
47 lines
2 KiB
Diff
From 336592342a931d216667dd38c95b50124050de28 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
|
|
index 6ef0e1399..5872e6b17 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -236,4 +236,14 @@ public class PaperWorldConfig {
|
|
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/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
|
index fd9ba8232..034e8684d 100644
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
@@ -832,7 +832,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@Override
|
|
public long getInhabitedTime() {
|
|
- return this.inhabitedTime;
|
|
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : world.paperConfig.fixedInhabitedTime; // Paper
|
|
}
|
|
|
|
@Override
|
|
--
|
|
2.25.0.windows.1
|
|
|