Added growth rate modifier to NetherWart

This commit is contained in:
olivervscreeper 2015-05-26 08:35:03 +01:00
parent 8050f01466
commit 2e3882ba60

View File

@ -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" );
+ }
}
--