Bukkit/Bukkit — pull request #859 by ams2990 (2013-04-16 02:36:30+00:00)
Title: [B+C] Define EntitySpawnEvent and SpawnerSpawnEvent. Adds BUKKIT-267 and BUKKIT-1559

**The Issue:**
When a spawner creates an entity, it is difficult to determine the location of the spawner. With the addition of this commit, it is even more difficult to listen to all entity creation events (there are now three).

**Justification for this PR:**
My primary motivation in submitting this is to allow plugins to easily locate the spawner which spawned a given entity. Doing a brute force search on every CreatureSpawnEvent whose reason is SPAWNER is extremely impractical, especially on a large server. Additionally, if there are two identical spawners next to each other, a search will not necessarily return the correct spawner. However, I took the opportunity (at the request of @EdGruberman) to refactor entity-spawning events.

**PR Breakdown:**
Creates EntitySpawnEvent. Refactors ItemSpawnEvent and CreatureSpawnEvent such that they inherit from EntitySpawnEvent. Creates SpawnerSpawnEvent, also inherits from EntitySpawnEvent.

**Testing Results and Materials:**
CreatureSpawnEvent and ItemSpawnEvent continue to work as normal, without any changes. SpawnerSpawnEvent works on both living and non-living entities.
Testing plugin: http://www.multiupload.nl/VIVPRINPEU
Source: http://www.multiupload.nl/IUD28UP8O8
Helpful schematics for testing spawners: http://www.mediafire.com/?6h6pj89ph1rdb5r

**Relevant PRs:**
CB-XXXX -
B-783 - https://github.com/Bukkit/Bukkit/pull/783 - Does not include any common entity spawn event class.
CB-1046 - https://github.com/Bukkit/CraftBukkit/pull/1046 - Builds against 1.4.x code.

**JIRA Tickets:**
BUKKIT-267 - https://bukkit.atlassian.net/browse/BUKKIT-267
BUKKIT-1559 - https://bukkit.atlassian.net/browse/BUKKIT-1559