MinecraftForge/MinecraftForge — pull request #623 by bloodmc (2013-06-28 18:25:20+00:00)
Title: Added BlockBreakEvent which is fired when a player breaks a block.

This new event will be fired in ItemWorldManager.breakBlock. Any mod that does
not use breakBlock *should* always fire this event for protection reasons. If
the event is cancelled, the mod is responsible for preventing the block from
breaking. If there is no player available, the FakePlayer class can be used.
To grab a fake entityplayer, you will need to call
FakePlayer.get(world, "playername"). It is expected to pass a real player name
in this method so protection mods can handle the event correctly.

Included with the BlockBreakEvent is the BlockExpEvent which is
responsible for handling experience gained by breaking blocks. If you want
your block to grant a player with experience, you will need to override
the Block.getExpDrop method and return the experience you want. By
default, any block that does not override this method will grant no
experience to the player.

This implementation was based off the following commits by CraftBukkit :
https://github.com/Bukkit/CraftBukkit/commit/0c14373471d47bebd6053cafdbfb561d99fab4f6
https://github.com/Bukkit/CraftBukkit/commit/f47bc22ac868691f0e8cf9eb362a23198275d501
https://github.com/Bukkit/CraftBukkit/commit/c542c644878543f9ad881d3b1823fe1b3cc40836
https://github.com/Bukkit/CraftBukkit/commit/d05957d3ffc5349db4ab1e204aea67d5f1225a33
https://github.com/Bukkit/CraftBukkit/commit/69d634a022f9432578d48a189b0027cc2be25f8f
https://github.com/Bukkit/CraftBukkit/commit/ea5efcf1d548392de7c26ad493a6ba53a2a60d73
https://github.com/Bukkit/CraftBukkit/commit/ad697c0cd43cb9310b52ab3f2e2995b2502d518a