13
0
geforkt von Mirrors/Paper

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.
Dieser Commit ist enthalten in:
bloodshot 2019-02-24 22:50:05 -05:00 committet von md_5
Ursprung acbba8badd
Commit 822ff72934

Datei anzeigen

@ -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()) {