summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockCrops.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/BlockCrops.patch')
-rw-r--r--nms-patches/BlockCrops.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/nms-patches/BlockCrops.patch b/nms-patches/BlockCrops.patch
new file mode 100644
index 00000000..fde60f42
--- /dev/null
+++ b/nms-patches/BlockCrops.patch
@@ -0,0 +1,35 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/BlockCrops.java 2014-11-27 08:59:46.517422657 +1100
++++ src/main/java/net/minecraft/server/BlockCrops.java 2014-11-27 08:42:10.160850895 +1100
+@@ -2,6 +2,8 @@
+
+ import java.util.Random;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
+
+ public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 7);
+@@ -31,7 +33,10 @@
+ float f = a((Block) this, world, blockposition);
+
+ if (random.nextInt((int) (25.0F / f) + 1) == 0) {
+- world.setTypeAndData(blockposition, iblockdata.set(BlockCrops.AGE, Integer.valueOf(i + 1)), 2);
++ // CraftBukkit start
++ IBlockData data = iblockdata.set(AGE, Integer.valueOf(i + 1));
++ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
++ // CraftBukkit end
+ }
+ }
+ }
+@@ -45,7 +50,10 @@
+ i = 7;
+ }
+
+- world.setTypeAndData(blockposition, iblockdata.set(BlockCrops.AGE, Integer.valueOf(i)), 2);
++ // CraftBukkit start
++ IBlockData data = iblockdata.set(AGE, Integer.valueOf(i));
++ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
++ // CraftBukkit end
+ }
+
+ protected static float a(Block block, World world, BlockPosition blockposition) {