mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
3360d06f76
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
97 lines
No EOL
5.4 KiB
Diff
97 lines
No EOL
5.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Phoenix616 <mail@moep.tv>
|
|
Date: Sun, 15 Sep 2019 11:32:32 -0500
|
|
Subject: [PATCH] Fix zero-tick instant grow farms MC-113809
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index fd9bedf5a..8648d9e3d 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
|
disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false);
|
|
}
|
|
|
|
+ public boolean fixZeroTickInstantGrowFarms = true;
|
|
+ private void fixZeroTickInstantGrowFarms() {
|
|
+ fixZeroTickInstantGrowFarms = getBoolean("fix-zero-tick-instant-grow-farms", fixZeroTickInstantGrowFarms);
|
|
+ }
|
|
+
|
|
public boolean altItemDespawnRateEnabled;
|
|
public Map<Material, Integer> altItemDespawnRateMap;
|
|
private void altItemDespawnRate() {
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
|
index 46490a943..54a61283e 100644
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
|
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
|
private final float g;
|
|
protected final BlockStateList<Block, IBlockData> blockStateList;
|
|
private IBlockData blockData;
|
|
+ public boolean randomTick = false; // Paper - fix MC-113809
|
|
protected final boolean v;
|
|
private final boolean i;
|
|
private final boolean j;
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
index c482aad3e..02c548dd9 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
@@ -0,0 +0,0 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
|
worldserver.b(blockposition, true);
|
|
} else if ((Integer) iblockdata.get(BlockBamboo.f) == 0) {
|
|
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
|
if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot
|
|
int i = this.b(worldserver, blockposition) + 1;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
|
|
index 4c82fe335..728491dd9 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
|
|
@@ -0,0 +0,0 @@ public class BlockCactus extends Block {
|
|
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
|
worldserver.b(blockposition, true);
|
|
} else {
|
|
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
|
BlockPosition blockposition1 = blockposition.up();
|
|
|
|
if (worldserver.isEmpty(blockposition1)) {
|
|
diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
|
index d70b52cad..ff0ba15f8 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
|
@@ -0,0 +0,0 @@ public class BlockChorusFlower extends Block {
|
|
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
|
worldserver.b(blockposition, true);
|
|
} else {
|
|
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
|
BlockPosition blockposition1 = blockposition.up();
|
|
|
|
if (worldserver.isEmpty(blockposition1) && blockposition1.getY() < 256) {
|
|
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
|
|
index baa2ed2b6..083b7ee59 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockReed.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockReed.java
|
|
@@ -0,0 +0,0 @@ public class BlockReed extends Block {
|
|
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
|
worldserver.b(blockposition, true);
|
|
} else if (worldserver.isEmpty(blockposition.up())) {
|
|
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
|
int i;
|
|
|
|
for (i = 1; worldserver.getType(blockposition.down(i)).getBlock() == this; ++i) {
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
|
index fd42390d4..4c53f8063 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
|
IBlockData iblockdata = this.getType(nextticklistentry.a);
|
|
|
|
if (iblockdata.getBlock() == nextticklistentry.b()) {
|
|
+ iblockdata.getBlock().randomTick = true; // Paper - fix MC-113809
|
|
iblockdata.a(this, nextticklistentry.a, this.random);
|
|
+ iblockdata.getBlock().randomTick = false; // Paper - fix MC-113809
|
|
}
|
|
|
|
}
|
|
--
|