mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
--- a/net/minecraft/server/BlockCrops.java
|
|
+++ b/net/minecraft/server/BlockCrops.java
|
|
@@ -3,6 +3,8 @@
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
+
|
|
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
|
|
|
|
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 7);
|
|
@@ -54,7 +56,10 @@
|
|
float f = a((Block) this, world, blockposition);
|
|
|
|
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
|
- world.setTypeAndData(blockposition, this.setAge(i + 1), 2);
|
|
+ // CraftBukkit start
|
|
+ IBlockData data = this.setAge(i + 1);
|
|
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
|
|
+ // CraftBukkit end
|
|
}
|
|
}
|
|
}
|
|
@@ -69,7 +74,10 @@
|
|
i = j;
|
|
}
|
|
|
|
- world.setTypeAndData(blockposition, this.setAge(i), 2);
|
|
+ // CraftBukkit start
|
|
+ IBlockData data = this.setAge(i);
|
|
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
|
|
+ // CraftBukkit end
|
|
}
|
|
|
|
protected int b(World world) {
|