Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
This commit is contained in:
@ -415,7 +415,7 @@
|
||||
+ // CraftBukkit start
|
||||
+ iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
||||
+ CraftWorld world = ((ServerLevel) this).getWorld();
|
||||
+ if (world != null) {
|
||||
+ if (world != null && ((ServerLevel)this).hasPhysicsEvent) { // Paper - BlockPhysicsEvent
|
||||
+ BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
||||
+ this.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user