2020-05-02 00:03:47 +02:00
|
|
|
From 49e9a07a84c5ecd9a5aa3d63c5963268f2e05837 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
|
2020-04-02 23:07:06 +02:00
|
|
|
index 5872e6b171..47f5f8055e 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
|
2020-01-18 18:28:32 +01:00
|
|
|
@@ -246,4 +246,10 @@ public class PaperWorldConfig {
|
2018-12-13 01:40:29 +01:00
|
|
|
}
|
|
|
|
fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
|
2018-07-15 03:53:17 +02: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
|
2020-04-02 23:07:06 +02:00
|
|
|
index 9b25fc2f9e..2b19b6754a 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
|
2019-04-27 05:05:36 +02:00
|
|
|
@@ -29,6 +29,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
|
2018-07-15 03:53:17 +02:00
|
|
|
|
2019-04-27 05:05:36 +02:00
|
|
|
@Override
|
2019-12-11 03:43:21 +01:00
|
|
|
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
|
|
|
+ if (this instanceof BlockGrass && worldserver.paperConfig.grassUpdateRate != 1 && (worldserver.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % worldserver.paperConfig.grassUpdateRate != 0)) { return; } // Paper
|
|
|
|
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
|
|
|
|
// CraftBukkit start
|
|
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
|
2018-07-15 03:53:17 +02:00
|
|
|
--
|
2020-05-02 00:03:47 +02:00
|
|
|
2.26.2
|
2018-07-15 03:53:17 +02:00
|
|
|
|