summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockPlant.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/BlockPlant.patch')
-rw-r--r--nms-patches/BlockPlant.patch21
1 files changed, 3 insertions, 18 deletions
diff --git a/nms-patches/BlockPlant.patch b/nms-patches/BlockPlant.patch
index ff1d2de5..c9ac5dc7 100644
--- a/nms-patches/BlockPlant.patch
+++ b/nms-patches/BlockPlant.patch
@@ -1,26 +1,11 @@
--- a/net/minecraft/server/BlockPlant.java
+++ b/net/minecraft/server/BlockPlant.java
-@@ -2,6 +2,10 @@
-
- import java.util.Random;
- import javax.annotation.Nullable;
-+// CraftBukkit start
-+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
-+import org.bukkit.event.block.BlockPhysicsEvent;
-+// CraftBukkit end
-
- public class BlockPlant extends Block {
-
-@@ -40,6 +44,15 @@
+@@ -40,6 +40,11 @@
protected void e(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (!this.f(world, blockposition, iblockdata)) {
-+ // CraftBukkit Start
-+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
-+ BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getTypeId());
-+ world.getServer().getPluginManager().callEvent(event);
-+
-+ if (event.isCancelled()) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end