Never remove players when unloading chunks. Fixes BUKKIT-3129

When unloading chunks we have a check to ensure we do not remove players
from the world due to the issues this would cause. However, our check
to see if the player is in this chunk is reversed and is in fact entirely
wrong. Even if the player isn't currently in this chunk we do not want
to remove them as that will still cause the same issues.
Don't update physics until after the place event. Fixes BUKKIT-3316

If you cancel a BlockPlaceEvent for a sign the world is updated as if
the block was placed and then destroyed. To avoid this we set the block
without updating physics then apply the update after the event.
Add BlockDiode from mc-dev for diff visibility.
Fire BlockRedstoneEvent for repeaters. Fixes BUKKIT-1157
Fix discrepancies in NBT and ItemMeta. Fixes BUKKIT-3279

An ItemStack gains the tag name "tag" when the stack is serialized
to NBT, however items don't have a tag *until* they are serialized at
least once. So to solve this, we remove the tag name when loading the
NBT data.

Another problem with NBT are TagLists, when transferring tag lists
between the server and the client the names are lost, and so we
simply don't add a name to the tag.
Fix removing enchantments causing the enchantment tag to remain.
Update maxhealth for entities that have variable max health. Fixes BUKKIT-3308

Slimes and wolves have health that can change based on certain
conditions. So we check if their max health should be updated, and if
it has been customized in any way.

We also scale the wolf's health for their tail
Fix persistence on tamed pets. Fixes BUKKIT-3300

With the persistence api introduced, pets did not have their
persistence flag updated to reflect their persistence. This caused
tame ocelots to not persist under specific conditions.
[Bleeding] Implement periodic chunk garbage collector

This adds two settings to bukkit.yml, allowing activation and control of
two chunk garbage collection triggering conditions:
chunk-gc/period-in-ticks controls a periodic GC, run once every N ticks
(default is 600); chunk-gc/load-threshold causes the GC to run once
after every N calls to loadChunk() on a given world (this call is an API
call used by plugins, and is distinct from the path taken for routine
player movement-based loading).  In both cases, setting to zero will
disable the given GC scheduling strategy.

In either case, the act of doing the GC is simply one of scanning the
loaded chunks, seeing which are NOT being used by one or more players
(due to view-distance) and which are not already queued for unload, and
queueing them for a normal unload.  Ultimately, the unload is then
processed the same as if the chunk were unloaded due to leaving the
view-distance range of all players, so the impact on plugins should be
no different (and strategies such as handling the ChunkUnloadEvent in
order to prevent unload will still work).

The initial interval for the periodic GC is randomized on a per-world
basis, in order to avoid all world being GCed at the same time -
minimizing potential lag spikes.
Don't teleport entities that are considered dead. Addresses BUKKIT-1331

Teleportation should never be processed on dead entities. If you wish
to teleport an entity, do it on a living entity. If you wish to
teleport a player, set their respawn location in PlayerRespawnEvent.
/dev/null does not accept EnchantmentThorns
Return the level, not ID. Fixes BUKKIT-3326

CraftItemStack was erroneously using the enchantment ID instead of level
for the return value of remove enchantment.
Updated version to 1.4.6-R0.2 in pom.xml for Beta.
Updated version to 1.4.6-R0.3-SNAPSHOT for development towards next release.
Merge branch 'master' into sakura146

Conflicts:
	pom.xml
	src/main/java/net/minecraft/server/Chunk.java
	src/main/java/net/minecraft/server/Entity.java
	src/main/java/net/minecraft/server/EntityArrow.java
	src/main/java/net/minecraft/server/EntitySlime.java
	src/main/java/net/minecraft/server/EntityWolf.java
	src/main/java/net/minecraft/server/ItemStack.java
	src/main/java/net/minecraft/server/WorldServer.java
	src/main/java/org/bukkit/craftbukkit/CraftServer.java
	src/main/java/org/bukkit/craftbukkit/CraftWorld.java
	src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
	src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
	src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
	src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
	src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
	src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
	src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java