Fix cave finder in flat worlds
Fix Bukkit Bug `ArrayIndexOutOfBoundsException: 2` when closing Anvil inventory

@see https://bukkit.atlassian.net/browse/BUKKIT-2788
@see https://github.com/Bukkit/CraftBukkit/pull/1130