summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-01-31 10:09:45 +1100
committermd_5 <git@md-5.net>2015-01-31 10:09:45 +1100
commitbae259e302efd06b359237fc4310909f5c056665 (patch)
tree6d0248544614093753d966cb982b9ffb63d874ff /nms-patches
parentbc03b6f017ba2120a52813c37de4eace79166f3c (diff)
downloadcraftbukkit-bae259e302efd06b359237fc4310909f5c056665.tar
craftbukkit-bae259e302efd06b359237fc4310909f5c056665.tar.gz
craftbukkit-bae259e302efd06b359237fc4310909f5c056665.tar.lz
craftbukkit-bae259e302efd06b359237fc4310909f5c056665.tar.xz
craftbukkit-bae259e302efd06b359237fc4310909f5c056665.zip
SPIGOT-240: Fire physics events for crops dying.
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/BlockPlant.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/nms-patches/BlockPlant.patch b/nms-patches/BlockPlant.patch
new file mode 100644
index 00000000..dd72d3a5
--- /dev/null
+++ b/nms-patches/BlockPlant.patch
@@ -0,0 +1,27 @@
+--- ../work/decompile-8eb82bde/net/minecraft/server/BlockPlant.java 2015-01-31 10:09:14.372634430 +1100
++++ src/main/java/net/minecraft/server/BlockPlant.java 2015-01-31 10:09:14.372634430 +1100
+@@ -1,6 +1,8 @@
+ package net.minecraft.server;
+
+ import java.util.Random;
++import org.bukkit.craftbukkit.util.CraftMagicNumbers;
++import org.bukkit.event.block.BlockPhysicsEvent;
+
+ public class BlockPlant extends Block {
+
+@@ -36,6 +38,15 @@
+
+ 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()) {
++ return;
++ }
++ // CraftBukkit end
+ this.b(world, blockposition, iblockdata, 0);
+ world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
+ }