Skip to content

Commit

Permalink
Remove BlockPhysics checks to determine if necessary
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bermudalocket committed Jan 24, 2019
1 parent 9a139bc commit 3d89c99
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/nu/nerd/SafeBuckets/SafeBucketsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3d89c99

Please sign in to comment.