Use the result of EntityPortalExitEvent. Fixes BUKKIT-3559.
Always use the set exit location for portal events. Fixes BUKKIT-3555.
Fix players spawning above portals. Fixes BUKKIT-3542.

Vanilla does not check for blocks in which the player could
suffocate when changing dimension, so portals will happily spawn
players in blocks when using a portal under certain
circumstances. However, we currently check for these instances
and move the player up until they will not suffocate. This means
that players can sometimes be taken to above the target portal,
making it seem as if a portal was not created. Instead, we now
disable this suffocation check when moveToWorld is called from
changeDimension, mirroring vanilla behavior more accurately.
Always return a TravelAgent; Fixes BUKKIT-3541

Recent changes caused PlayerPortalEvent to suddenly return null
unexpectedly and could end up in NPEs resulting that did not before.
This commit addresses that situation by always ensuring a TravelAgent
instance is returned.

The TravelAgent for world 0 is returned arbitrarily in an effort to
compensate for plugins that are implementation dependent and expect some
form of a TravelAgent to be accessible in the event at all times.
Spigot
EMC POM changes
MC Version 1.4.6#
Reverts mc version setting to 1.4.6 so 1.4.6 plugins still work
Remove Duplication Vulnerabilities#
Remove CraftBukkit "Feature" of ItemStack's having infinite use if less than 0 stack size.
Mob Spawning Events#
Add 2 events for better control of mob spawning (Natural and Spawners) This allows us a much more powerful control over spawning and improve performance
PlayerUseItem Event#
This lets us control when an item is consumed and change the item.
EMC Anvil Tweaks#
Make Items not have a repair cost increase due to Anvil usage. Renaming is only 5 levels, combines include free renames.
Use 1.4.5 Dig Speed#
1.4.7 Client is still expecting 1.4.5 Dig Speed
Load custom permissions before plugins
Timings improvements
Proper colors in console#
ANSI color codes now reset text attributes. Fixes BUKKIT-3508

The client resets all formatting after a color code is received, but currently the ANSI codes do not, and so the console does not accurately reflect the appearance of the formatted text. Instead, the ANSI color codes are now set to reset all text attributes.
Unload plugins after everything else
Combination of portal fixes#
This is a combination of fixes of pull reqs for Portal changes BUKKIT-3541, BUKKIT-3555, BUKKIT-3559, BUKKIT-3542

Plus my own fix to Eds patch about default PTA
Entity Activation Range#
This feature gives 3 new configurable ranges that if an entity of the matching type is outside of this radius of any player, will tick at 5% of its normal rate.

This will drastically cut down on tick timings for entities that are not in range of a user to actually be "used".
This change can have dramatic impact on gameplay if configured too low. Balance according to your servers desired gameplay.