2018-09-26 06:57:59 +02:00
|
|
|
From 92db70f012d7896c9da4fc6386c51e20df08d2a1 Mon Sep 17 00:00:00 2001
|
2018-07-15 03:53:17 +02: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-09-26 06:57:59 +02:00
|
|
|
index dd23ea45e5..17755108a8 100644
|
2018-07-15 03:53:17 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-09-26 06:57:59 +02:00
|
|
|
@@ -238,4 +238,10 @@ public class PaperWorldConfig {
|
2018-07-15 03:53:17 +02: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/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
|
2018-08-26 20:11:49 +02:00
|
|
|
index b0e08a3365..52ae980d37 100644
|
2018-07-15 03:53:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
|
|
|
|
@@ -21,6 +21,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
|
|
|
+ if (this instanceof BlockGrass && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper
|
|
|
|
if (!world.isClientSide) {
|
|
|
|
if (!a((IWorldReader) world, blockposition)) {
|
|
|
|
// CraftBukkit start
|
|
|
|
--
|
2018-09-23 04:48:30 +02:00
|
|
|
2.19.0
|
2018-07-15 03:53:17 +02:00
|
|
|
|