Bukkit/CraftBukkit — pull request #1407 by ams2990 (2014-08-11 22:02:06+00:00)
Title: [C] Pre-cancel liquid BlockFromToEvents which won't actually flow. Fixes BUKKIT-4750

##### The Issue:
BlockFromToEvents are fired in all four cardinal directions regardless of whether the liquid can actually flow.

##### Justification for this PR:
This gives plugins the ability to only listen to events which will result in actual liquid movement.

##### PR Breakdown:
This change pre-cancels any liquid flow events which will not flow.

##### Testing Results and Materials:
Code adapted from testing materials in [CB-1241](https://github.com/Bukkit/CraftBukkit/pull/1241).

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEvent(BlockFromToEvent event) {
Block fromBlock = event.getBlock();
Block toBlock = event.getToBlock();

Bukkit.getLogger().info("");
Bukkit.getLogger().info(" From Block: " + fromBlock.getType() + " Data: " + fromBlock.getData() + " Loc: " + fromBlock.getLocation().toString());
Bukkit.getLogger().info(" To Block: " + toBlock.getType() + " Data: " + toBlock.getData() + " Loc: " + toBlock.getLocation().toString());
Bukkit.getLogger().info(" Direction: " + event.getFace());
}

##### Relevant PR:
[CB-1241](https://github.com/Bukkit/CraftBukkit/pull/1241) - Changes are much more complex. At time of writing, also has a bug where liquids flowing DOWN are reported as flowing to SELF.

##### JIRA Ticket:
[BUKKIT-4750](https://bukkit.atlassian.net/browse/BUKKIT-4750) - Incorrect BlockFromToEvents for water