Fix crop growth patch

This commit is contained in:
md_5 2015-05-26 19:13:21 +10:00
parent 2e3882ba60
commit fc9d5d432a

View File

@ -26,27 +26,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Spigot end
}
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
@@ -0,0 +0,0 @@ public class BlockNetherWart extends BlockPlant {
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
int i = ((Integer) iblockdata.get(BlockNetherWart.AGE)).intValue();
- if (i < 3 && random.nextInt(10) == 0) {
- iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
- // world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit
- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit
+ if (i >= (byte) range(3, (world.growthOdds / world.spigotConfig.wartModifier * 15) + 0.5F, 15)) { // Spigot
+ if (i < 3 && random.nextInt(10) == 0) {
+ iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
+ // world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit
+ }
}
super.b(world, blockposition, iblockdata, random);
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
@ -113,6 +92,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
IBlockData iblockdata1 = world.getType(blockposition1);
Block block = world.getType(blockposition1.up()).getBlock();
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
@@ -0,0 +0,0 @@ public class BlockNetherWart extends BlockPlant {
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
int i = ((Integer) iblockdata.get(BlockNetherWart.AGE)).intValue();
- if (i < 3 && random.nextInt(10) == 0) {
+ if (i < 3 && random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.wartModifier * 10)) == 0) { // Spigot
iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
// world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
@ -170,7 +162,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public int saplingModifier;
+ public int wheatModifier;
+ public int wartModifier;
+
+ private int getAndValidateGrowth(String crop)
+ {
+ int modifier = getInt( "growth." + crop.toLowerCase() + "-modifier", 100 );