From 3d89c994ebbf35a16ccef802e8a06af79dad501e Mon Sep 17 00:00:00 2001 From: bermudalocket Date: Wed, 23 Jan 2019 22:27:01 -0500 Subject: [PATCH] Remove BlockPhysics checks to determine if necessary The costs outweigh the benefits here, I think. This is an attempt to see if the current logic, minus the BlockPhysicsEvent check, will suffice. This will eliminate the relatively expensive 6-way search for concrete powder every time a fluid block updates. --- .../nerd/SafeBuckets/SafeBucketsListener.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/nu/nerd/SafeBuckets/SafeBucketsListener.java b/src/nu/nerd/SafeBuckets/SafeBucketsListener.java index 7619ecf..de6f184 100755 --- a/src/nu/nerd/SafeBuckets/SafeBucketsListener.java +++ b/src/nu/nerd/SafeBuckets/SafeBucketsListener.java @@ -98,26 +98,6 @@ public void onBlockFromTo(BlockFromToEvent event) { } } - // ------------------------------------------------------------------------ - /** - * More flowing liquid protection. - */ - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onBlockPhysics(BlockPhysicsEvent event) { - Block block = event.getBlock(); - if (block == null) { - return; - } - if (block.getType() == Material.WATER || block.getType() == Material.LAVA) { - if (SafeBuckets.isSafe(block)) { - event.setCancelled(true); - if (block.getType() == Material.WATER) { - Util.findConcretePowder(block); // see javadoc for this method - } - } - } - } - // ------------------------------------------------------------------------ /** * Prevents WorldEdited liquids from flowing.