summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockCrops.patch
blob: da3a8644f09884a3f0b21de8afbf95659a99ac2e (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/BlockCrops.java
+++ b/net/minecraft/server/BlockCrops.java
@@ -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 = BlockProperties.W;
@@ -49,7 +51,7 @@
                 float f = a((Block) this, (IBlockAccess) world, blockposition);
 
                 if (random.nextInt((int) (25.0F / f) + 1) == 0) {
-                    world.setTypeAndData(blockposition, this.setAge(i + 1), 2);
+                    CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.setAge(i + 1), 2); // CraftBukkit
                 }
             }
         }
@@ -64,7 +66,7 @@
             i = j;
         }
 
-        world.setTypeAndData(blockposition, this.setAge(i), 2);
+        CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.setAge(i), 2); // CraftBukkit
     }
 
     protected int a(World world) {