2019-10-26 22:55:58 +00:00
|
|
|
From b9d7b4651e3d7de16245a87466372c48aad93637 Mon Sep 17 00:00:00 2001
|
2018-07-15 01:53:17 +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
|
2019-10-26 22:55:58 +00:00
|
|
|
index 4afd7553d..88a4f8882 100644
|
2018-07-15 01:53:17 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-10-26 22:55:58 +00:00
|
|
|
@@ -244,4 +244,10 @@ public class PaperWorldConfig {
|
2018-12-13 00:40:29 +00:00
|
|
|
}
|
|
|
|
fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
|
2018-07-15 01:53:17 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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
|
2019-10-26 22:55:58 +00:00
|
|
|
index c4c9a353a..cb90b74ca 100644
|
2018-07-15 01:53:17 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
|
2019-04-27 03:05:36 +00:00
|
|
|
@@ -29,6 +29,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
|
2018-07-15 01:53:17 +00:00
|
|
|
|
2019-04-27 03:05:36 +00:00
|
|
|
@Override
|
|
|
|
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
2018-07-15 01:53:17 +00:00
|
|
|
+ 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) {
|
2019-04-27 03:05:36 +00:00
|
|
|
if (!b(iblockdata, (IWorldReader) world, blockposition)) {
|
2018-07-15 01:53:17 +00:00
|
|
|
// CraftBukkit start
|
|
|
|
--
|
2019-10-26 22:55:58 +00:00
|
|
|
2.23.0
|
2018-07-15 01:53:17 +00:00
|
|
|
|