|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Thu, 11 Jul 2024 17:05:06 -0300 |
| 4 | +Subject: [PATCH] Add some missing growth rates |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/net/minecraft/server/BlockCocoa.java b/src/main/java/net/minecraft/server/BlockCocoa.java |
| 8 | +index 8eb1bebaec2d35b8bfa57be5ef19936ad5770a1f..918f5f601a255887f8f3bd1c87c47997011a3bde 100644 |
| 9 | +--- a/src/main/java/net/minecraft/server/BlockCocoa.java |
| 10 | ++++ b/src/main/java/net/minecraft/server/BlockCocoa.java |
| 11 | +@@ -17,7 +17,7 @@ public class BlockCocoa extends BlockDirectional implements IBlockFragilePlantEl |
| 12 | + public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { |
| 13 | + if (!this.e(world, blockposition, iblockdata)) { |
| 14 | + this.f(world, blockposition, iblockdata); |
| 15 | +- } else if (world.random.nextInt(5) == 0) { |
| 16 | ++ } else if (world.random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.cocoaModifier * 5)) == 0) { // PandaSpigot |
| 17 | + int i = ((Integer) iblockdata.get(BlockCocoa.AGE)).intValue(); |
| 18 | + |
| 19 | + if (i < 2) { |
| 20 | +diff --git a/src/main/java/net/minecraft/server/BlockVine.java b/src/main/java/net/minecraft/server/BlockVine.java |
| 21 | +index 25d19c4c2b110d94d952f33a9a6e8e5f7f2cc1cf..d22f88f03b06752a5bafefc9ea905c2a509bdaba 100644 |
| 22 | +--- a/src/main/java/net/minecraft/server/BlockVine.java |
| 23 | ++++ b/src/main/java/net/minecraft/server/BlockVine.java |
| 24 | +@@ -165,7 +165,7 @@ public class BlockVine extends Block { |
| 25 | + |
| 26 | + public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { |
| 27 | + if (!world.isClientSide) { |
| 28 | +- if (world.random.nextInt(4) == 0) { |
| 29 | ++ if (world.random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.vineModifier * 4)) == 0) { // PandaSpigot |
| 30 | + byte b0 = 4; |
| 31 | + int i = 5; |
| 32 | + boolean flag = false; |
| 33 | +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java |
| 34 | +index 8e86212aa5deae00c55cacc7207525df67a1868e..384c3eac6b67fdb42c12156570b36ed2fe93f260 100644 |
| 35 | +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java |
| 36 | ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java |
| 37 | +@@ -90,6 +90,10 @@ public class SpigotWorldConfig |
| 38 | + public int saplingModifier; |
| 39 | + public int wheatModifier; |
| 40 | + public int wartModifier; |
| 41 | ++ // PandaSpigot start |
| 42 | ++ public int vineModifier; |
| 43 | ++ public int cocoaModifier; |
| 44 | ++ // PandaSpigot end |
| 45 | + private int getAndValidateGrowth(String crop) |
| 46 | + { |
| 47 | + int modifier = getInt( "growth." + crop.toLowerCase() + "-modifier", 100 ); |
| 48 | +@@ -112,6 +116,10 @@ public class SpigotWorldConfig |
| 49 | + saplingModifier = getAndValidateGrowth( "Sapling" ); |
| 50 | + wheatModifier = getAndValidateGrowth( "Wheat" ); |
| 51 | + wartModifier = getAndValidateGrowth( "NetherWart" ); |
| 52 | ++ // PandaSpigot start |
| 53 | ++ vineModifier = getAndValidateGrowth( "Vine" ); |
| 54 | ++ cocoaModifier = getAndValidateGrowth( "Cocoa" ); |
| 55 | ++ // PandaSpigot end |
| 56 | + } |
| 57 | + |
| 58 | + public double itemMerge; |
0 commit comments