mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
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.
This commit is contained in:
parent
acbba8badd
commit
822ff72934
1 changed files with 1 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue