Added growth rate modifier to NetherWart
This commit is contained in:
parent
e02c239421
commit
48c32652a2
@ -26,6 +26,27 @@ index 4923f8b..6b02059 100644
|
|||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||||
|
index 1bb8015..98ebd2b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||||
|
@@ -27,10 +27,12 @@ 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
|
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||||
index 7f5e5ca..488e5c2 100644
|
index 7f5e5ca..488e5c2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
||||||
@ -148,6 +169,8 @@ index 90a227f..7e79ba5 100644
|
|||||||
+ public int pumpkinModifier;
|
+ public int pumpkinModifier;
|
||||||
+ public int saplingModifier;
|
+ public int saplingModifier;
|
||||||
+ public int wheatModifier;
|
+ public int wheatModifier;
|
||||||
|
+ public int wartModifier;
|
||||||
|
+
|
||||||
+ private int getAndValidateGrowth(String crop)
|
+ private int getAndValidateGrowth(String crop)
|
||||||
+ {
|
+ {
|
||||||
+ int modifier = getInt( "growth." + crop.toLowerCase() + "-modifier", 100 );
|
+ int modifier = getInt( "growth." + crop.toLowerCase() + "-modifier", 100 );
|
||||||
@ -169,6 +192,7 @@ index 90a227f..7e79ba5 100644
|
|||||||
+ pumpkinModifier = getAndValidateGrowth( "Pumpkin" );
|
+ pumpkinModifier = getAndValidateGrowth( "Pumpkin" );
|
||||||
+ saplingModifier = getAndValidateGrowth( "Sapling" );
|
+ saplingModifier = getAndValidateGrowth( "Sapling" );
|
||||||
+ wheatModifier = getAndValidateGrowth( "Wheat" );
|
+ wheatModifier = getAndValidateGrowth( "Wheat" );
|
||||||
|
+ wartModifier = getAndValidateGrowth( "NetherWart" );
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user