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. By: bloodshot <jdroque@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
5c6e6853e3
Commit
0deb5e7d0a
@ -257,7 +257,7 @@
|
|||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ CraftWorld world = ((WorldServer) this).getWorld();
|
+ CraftWorld world = ((WorldServer) this).getWorld();
|
||||||
+ if (world != null) {
|
+ 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);
|
+ this.getServer().getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren