SpoutDev/Spout — pull request #764 by Hell-Fire (2011-10-20 13:22:21+00:00)
Title: BLOCK_PLACE callEvent implementation

This lets plugins catch custom block placements in the world

An example onBlockPlace for this is:
```java
public void onBlockPlace(BlockPlaceEvent event) {
if (event.isCancelled() || !event.canBuild()) return; // Don't do anything

// This example shows the three levels of block types
if(event.getBlock() instanceof SpoutBlock) {
if (((SpoutBlock)event.getBlock()).isCustomBlock()) {
// If you're using this, you'll probably be wanting this mostly, the "custom blocks"
event.getPlayer().sendMessage("Placed CSB: " + ((SpoutBlock)event.getBlock()).getCustomBlock().getName());
} else {
// This is for blocks that Spout has extended with its own information
event.getPlayer().sendMessage("Placed SB: " + ((SpoutBlock)event.getBlock()).getName());
}
} else {
// And this is for regular old Bukkit type blocks if Spout isn't enabled
event.getPlayer().sendMessage("Placed B: " + event.getBlockPlaced().getType());
}
}
```