From 822ff729345c8d33f6e897e774b7b64c0c5ffa4f Mon Sep 17 00:00:00 2001 From: bloodshot Date: Sun, 24 Feb 2019 22:50:05 -0500 Subject: [PATCH] SPIGOT-4637: Add source block to BlockPhysicsEvent. Allows a plugin to lookup the source block of event. For example, a protection plugin may want to determine what caused the physics event to be triggered. --- nms-patches/World.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nms-patches/World.patch b/nms-patches/World.patch index 80eb15b9f0..b5aca0a6b7 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -257,7 +257,7 @@ + // CraftBukkit start + CraftWorld world = ((WorldServer) this).getWorld(); + if (world != null) { -+ BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); ++ BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata), world.getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ())); + this.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) {