Files
CatServer/patches/net/minecraft/block/BlockNetherWart.java.patch
2018-07-19 21:40:40 +08:00

16 lines
970 B
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -50,10 +50,10 @@
{
int i = ((Integer)state.getValue(AGE)).intValue();
- if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, pos, state, rand.nextInt(10) == 0))
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, pos, state, rand.nextInt(Math.max(1, (int) (100.0F / worldIn.spigotConfig.wartModifier) * 10)) == 0)) //Spigot
{
state = state.withProperty(AGE, Integer.valueOf(i + 1));
- worldIn.setBlockState(pos, state, 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldIn, pos.getX(), pos.getY(), pos.getZ(), this, getMetaFromState(state)); // CraftBukkit
net.minecraftforge.common.ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos));
}