mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
28 lines
1.3 KiB
Diff
28 lines
1.3 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
|
@@ -2,6 +2,9 @@
|
|
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+
|
|
import net.minecraft.block.properties.IProperty;
|
|
import net.minecraft.block.properties.PropertyInteger;
|
|
import net.minecraft.block.state.BlockStateContainer;
|
|
@@ -79,9 +82,12 @@
|
|
{
|
|
float f = getGrowthChance(this, worldIn, pos);
|
|
|
|
- if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, pos, state, rand.nextInt((int)(25.0F / f) + 1) == 0))
|
|
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, pos, state, rand.nextInt((int)((100.0F / worldIn.spigotConfig.wheatModifier) * (25.0F / f)) + 1) == 0)) //Spigot
|
|
{
|
|
- worldIn.setBlockState(pos, this.withAge(i + 1), 2);
|
|
+ // CraftBukkit start
|
|
+ IBlockState data = this.withAge(i + 1);
|
|
+ CraftEventFactory.handleBlockGrowEvent(worldIn, pos.getX(), pos.getY(), pos.getZ(), this, getMetaFromState(data));
|
|
+ // CraftBukkit end
|
|
net.minecraftforge.common.ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos));
|
|
}
|
|
}
|