summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockCocoa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/BlockCocoa.patch')
-rw-r--r--nms-patches/BlockCocoa.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/nms-patches/BlockCocoa.patch b/nms-patches/BlockCocoa.patch
new file mode 100644
index 00000000..40006fff
--- /dev/null
+++ b/nms-patches/BlockCocoa.patch
@@ -0,0 +1,35 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/BlockCocoa.java 2014-11-27 08:59:46.513422674 +1100
++++ src/main/java/net/minecraft/server/BlockCocoa.java 2014-11-27 08:42:10.152850911 +1100
+@@ -2,6 +2,8 @@
+
+ import java.util.Random;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public class BlockCocoa extends BlockDirectional implements IBlockFragilePlantElement {
+
+ public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 2);
+@@ -19,7 +21,10 @@
+ int i = ((Integer) iblockdata.get(BlockCocoa.AGE)).intValue();
+
+ if (i < 2) {
+- world.setTypeAndData(blockposition, iblockdata.set(BlockCocoa.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
+ }
+ }
+
+@@ -125,7 +130,10 @@
+ }
+
+ public void b(World world, Random random, BlockPosition blockposition, IBlockData iblockdata) {
+- world.setTypeAndData(blockposition, iblockdata.set(BlockCocoa.AGE, Integer.valueOf(((Integer) iblockdata.get(BlockCocoa.AGE)).intValue() + 1)), 2);
++ // CraftBukkit start
++ IBlockData data = iblockdata.set(AGE, Integer.valueOf(((Integer) iblockdata.get(AGE)).intValue() + 1));
++ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
++ // CraftBukkit end
+ }
+
+ public IBlockData fromLegacyData(int i) {