mojira.dev
MC-88095

Nights don't get skipped when the last player is set to specator mode

When almost all players on a server/OpenToLan-world are asleep and the last player is set to spectator mode the all-players-sleeping flag is not updated, causing it to stay night.

What I expected to happen was...:
When all players that are not spectators are asleep, the night should get skipped.

What actually happened was...:
It stayed night after the last player was set to spectator mode.

Steps to Reproduce:
1. Get on a server with one other player.
2. /gamemode 1 @a
3. /time set night
4. Player 1 lies down in a bed.
5. Player 2 sets his gamemode to spectator mode. (/gamemode 3)
6. The night won't get skipped.

Video: https://youtu.be/ZkI3uU7hoBA?t=39s

Linked issues

Comments 8

Related, yes. Dupe, no. Let me explain:

MC-47080: One player in survival mode, one player in spectator mode. Survival player enters bed, but night doesn't skip because not all players are in bed. This is fixed, but the fix is incomplete. This is what MC-88095 is about: The scenario I just described works fine now, but this one still doesn't: Both players are in survival, one enters a bed. Then the other switches to spectator mode. All relevant players are in bed, but the night doesn't skip because the trigger for skipping the night is only done when a player enters a bed.

Ah, I see. "the trigger for skipping the Night is only done when a player enters a bed." isn't true though. If one player is in a bed and the other logs out, then it will skip.

Also, this is fixed now, right?

It should be. I haven't tested, but I imagine ProfMobius did.

I actually only fixed the bug when a player switches to spectator while all the players are in bed.

I will test the case when the last player is disconnecting while all the other players are in bed.

KingSupernova said that was fixed a while ago/never a bug in the first place. And I just tested, it's not an issue.

Logging out to skip with one person in a bed has worked for a long time. It often used on servers when people don't have beds on hand.

@unknown Fair enough. Was wondering about a regression.

So, this problem is completly solved and I will look at other bugs on monday.

Have a nice weekend !

Panda4994

migrated

Unconfirmed

Minecraft 1.8.8, Minecraft 15w36b, Minecraft 15w36c, Minecraft 15w36d

Minecraft 15w37a

Retrieved