summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockCocoa.patch
blob: 7ee24a95897fe004929b09ef05d5ce683fed7eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- a/net/minecraft/server/BlockCocoa.java
+++ b/net/minecraft/server/BlockCocoa.java
@@ -3,6 +3,8 @@
 import java.util.Random;
 import javax.annotation.Nullable;
 
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
 public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
 
     public static final BlockStateInteger AGE = BlockProperties.T;
@@ -21,7 +23,7 @@
             int i = (Integer) iblockdata.get(BlockCocoa.AGE);
 
             if (i < 2) {
-                world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, i + 1), 2);
+                CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, i + 1), 2); // CraftBukkkit
             }
         }
 
@@ -106,7 +108,7 @@
     }
 
     public void b(World world, Random random, BlockPosition blockposition, IBlockData iblockdata) {
-        world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, (Integer) iblockdata.get(BlockCocoa.AGE) + 1), 2);
+        CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, (Integer) iblockdata.get(BlockCocoa.AGE) + 1), 2); // CraftBukkit
     }
 
     public TextureType c() {