Fix TileEntities and Blocks getting out of sync. Fixes BUKKIT-3501

Also fixes: BUKKIT-3477 and BUKKIT-3488

Minecraft likes to double check that tile entities get set after they
are placed, however we didn't set tile entities until after our event
was called. This caused the world to have multiple tile entities in a
single block location; to fix this we now set tile entities before
the event.
Direct all BlockPlaceEvents to a singular location. Fixes BUKKIT-3438

By having a single function to process BlockPlacement logic, we make
it so that there is consistent behavior throughout all BlockPlace
events. This should allow for easier troubleshooting and less diffs
in source.

This also fixes BUKKIT-3463 by including the correct coordinates that
were clicked to the event.
Ignore block functions for skulls on BlockPlace. Fixes BUKKIT-3495

Skulls don't normally get block data applied to them, so we shouldn't
apply it either.
Update Fireballs to account for ExplosionPower. Fixes BUKKIT-3460
Adds BUKKIT-3516
Remove erroneous break statement in scheduler. Fixes BUKKIT-3395
Target default world when returning from The End; Fixes BUKKIT-3494

Due to the having to generate new logic to avoid using the customized
PlayerConnection.moveToWorld, entities returning from The End were not
properly calculating their exit target.  This commit corrects that
logic.
Make command blocks only select players on its world. Fixes BUKKIT-3515
When leaving the end, always target the main world. Fixes BUKKIT-3517
Fix contract with Player.getBedSpawnLocation. Fixes BUKKIT-3525

Getting the bed spawn location is supposed to check if the bed is
valid, however, it currently did not do so.
Fix NPE when getting bed spawn location.
Updated version to 1.4.7-R1.0 in pom.xml for RB.
Updated version to 1.4.7-R1.1-SNAPSHOT for development towards next release.
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.
Use entity UUID instead of EntityID for metadata. Fixes BUKKIT-3582

The entity id is a non-unique, non-persistent value, and will cause
entities to lose their respective meta data on chunk unloading, and
teleportation.
Set CraftTravelAgent.DEFAULT to a non-null value. Fixes BUKKIT-3578

Currently, CraftTravelAgent will call s() on the passed-in WorldServer in order to set DEFAULT. However, s() will always return null at this point, because WorldServer.P will still be null, as it is set after the constructor is called. Instead, we set CraftTravelAgent.DEFAULT to the instance that is being constructed.
Check TravelAgent.findOrCreate(Location) for null; Fixes BUKKIT-3590

If a custom TravelAgent is used and returns null for findOrCreate method
a NullPointerException will occur.
Conflicts:
	src/main/java/net/minecraft/server/PlayerList.java
Close inventory on teleport. FIXES BUKKIT-3021.