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

27 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -1,6 +1,9 @@
package net.minecraft.block;
import java.util.Random;
+
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
@@ -51,10 +54,11 @@
if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, blockpos, state, true))
{
- if (j == 15)
+ if (j >= (byte) range(3,((100.0F/ worldIn.spigotConfig.cactusModifier)*15) + 0.5F, 15)) //Spigot
{
- worldIn.setBlockState(blockpos, this.getDefaultState());
IBlockState iblockstate = state.withProperty(AGE, Integer.valueOf(0));
+
+ CraftEventFactory.handleBlockGrowEvent(worldIn, pos.getX(), pos.getY(), pos.getZ(), this, 0); // CraftBukkit
worldIn.setBlockState(pos, iblockstate, 4);
iblockstate.neighborChanged(worldIn, blockpos, this);
}