2018-01-11 05:31:19 +00:00
From 7745c33d90b8c89977af2aa75adff679f16f222f Mon Sep 17 00:00:00 2001
2016-04-03 20:29:39 +00:00
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 16:28:17 -0400
Subject: [PATCH] Configurable Grass Spread Tick Rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2018-01-11 05:31:19 +00:00
index aa923406..afbfbdf8 100644
2016-04-03 20:29:39 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2018-01-11 05:31:19 +00:00
@@ -270,4 +270,10 @@ public class PaperWorldConfig {
2016-04-03 20:29:39 +00:00
private void useInhabitedTime() {
useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true);
}
+
+ public int grassUpdateRate = 1;
+ private void grassUpdateRate() {
+ grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate));
+ log("Grass Spread Tick Rate: " + grassUpdateRate);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
2017-06-19 01:36:55 +00:00
index 8fc736d6..b656994b 100644
2016-04-03 20:29:39 +00:00
--- a/src/main/java/net/minecraft/server/BlockGrass.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java
2016-11-17 02:23:38 +00:00
@@ -28,6 +28,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement {
2016-04-03 20:29:39 +00:00
}
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
+ if (world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper
if (!world.isClientSide) {
int lightLevel = -1; // Paper
if (world.getType(blockposition.up()).c() > 2 && (lightLevel = world.getLightLevel(blockposition.up())) < 4) { // Paper - move light check to end to avoid unneeded light lookups
--
2018-01-11 05:31:19 +00:00
2.14.3
2016-04-03 20:29:39 +00:00