Bukkit/CraftBukkit — pull request #1405 by minecraftshamrock (2014-08-10 16:25:29+00:00)
Title: Let the Bukkit API control creation of obsidian and cobblestone when lava collides with water

### Feature

This makes it possible to control the creation of obsidian and cobblestone when lava and water collide.
When obsidian or cobblestone is about to be created, a BlockPhysicsEvent is called that contains information about the block to be changed and whether the block should be changed to obsidian or cobblestone.

### Affected Files

This feature affects the vanilla class BlockFluids which is used for flowing and stationary water and lava. Before this BlockFluids was completely untouched by CraftBukkit so it was not listed in the repository. I've decompiled BlockFluids.class from the latest CraftBukkit and applied the patches.

The output of the decompiler was a little buggy so I had to add to fix some unreasonable bugs, but they are all commented.

### Affected Issues

This pull request closes [BUKKIT-5731](https://bukkit.atlassian.net/browse/BUKKIT-5731).

### Compatibility

Compiling BlockFluids.java and modifying the latest CraftBukkit jar with it works fine.

### Usage in the Bukkit API

To listen on creation of obsidian or cobblestone one can easily listen on the BlockPhysicsEvent like this:
```java
public class MyListener implements Listener {

@EventHandler
public void onBlockPhysicsEvent(final BlockPhysicsEvent event) {
// the affected block
final Block b = event.getBlock();
// the material the affected block should be turned into
final Material m = event.getChangedType();

if(event.getChangedType() == Material.OBSIDIAN) {
// obsidian should be created because water
// and lava collide at the affected block
}
if(event.getChangedType() == Material.COBBLESTONE) {
// cobblestone should be created because water
// and lava collide at the affected block
}

// canceling this event will forbid cobblestone and obsidian
// creation caused by colliding water and lava
event.setCancelled(true);
}

}
```