From 2e3882ba60a410ceb65c62e0b8237c4329faa26d Mon Sep 17 00:00:00 2001 From: olivervscreeper Date: Tue, 26 May 2015 08:35:03 +0100 Subject: [PATCH] Added growth rate modifier to NetherWart --- .../0007-Crop-Growth-Rates.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch b/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch index 79e0ae2e7e..6a19bb7dc8 100644 --- a/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch +++ b/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch @@ -26,6 +26,27 @@ 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 @@ -148,6 +169,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int pumpkinModifier; + public int saplingModifier; + public int wheatModifier; ++ public int wartModifier; ++ + private int getAndValidateGrowth(String crop) + { + int modifier = getInt( "growth." + crop.toLowerCase() + "-modifier", 100 ); @@ -169,6 +192,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + pumpkinModifier = getAndValidateGrowth( "Pumpkin" ); + saplingModifier = getAndValidateGrowth( "Sapling" ); + wheatModifier = getAndValidateGrowth( "Wheat" ); ++ wartModifier = getAndValidateGrowth( "NetherWart" ); + } } -- \ No newline at end of file