MinecraftForge/MinecraftForge — pull request #459 by ChildWalrus (2013-03-15 22:12:20+00:00)
Title: Made some sleep-related fields public to allow fixing of sleeping bug in new dimensions

(I submitted a PR for this a while back which was accepted, but it somehow got undone in the 1.5 update, so here's the new one.)

Fields: EntityPlayer.sleepTimer and WorldServer.allPlayersSleeping

In new dimensions which allow player respawning, sleeping in beds doesn't fast forward time to day; it just sets the spawn point and kicks the player out of bed. This is to do with the way 'setting time' is handled in non-Overworld worlds.

The only way to get around this problem is to use reflection to access private fields, which is very costly being run every world tick. So what I've done here is made these fields public with the Forge access transformer.