Bukkit/CraftBukkit — pull request #1042 by YLivay (2013-02-26 18:08:18+00:00)
Title: Fix Sleeping\Waking up for Faux Sleepers.

Faux sleeping makes the server ignore the state of a player regarding sleep. He is excluded from checks if everyone is sleeping to change time to day, and does not trigger any sleep checks, making him "invisible" in this matter.

Problem is that faux sleepers can also sleep normally like other players do, so they should be able to wake up normally too, but the condition prevents it, causing the server to think the player is asleep when client sided, the player has already left his bed.

This causes glitches when teleporting to beds, trying to sleep again and in some cases even fry the server (When all players are sleeping and the time does not change to day the server runs update ticks without the interval delay).

__Leaky__: https://bukkit.atlassian.net/browse/BUKKIT-3667