SpongeAPI icon indicating copy to clipboard operation
SpongeAPI copied to clipboard

Add Keys#PREVIOUS_GAME_MODE

Open Lignium opened this issue 2 years ago • 5 comments

[SpongeAPI | Sponge]

Lignium avatar Sep 02 '22 19:09 Lignium

@Lignium

I wonder if we should allow this key to be set? I only bring this up because setting it effectively feels like breaking the contract of what it is?

Zidane avatar Sep 02 '22 22:09 Zidane

@Zidane My authorization plugin manipulates game mode, adventure is set for the duration of authorization. And there was a problem, the key combination F3 + N broke, the previous game mode turned out to be the mode that temporarily set the authorization plugin, not at all what was expected. Instead of switching back and forth between creative and spectator, I get thrown into adventure mode and falling from a height.

Lignium avatar Sep 02 '22 23:09 Lignium

My point is I'd expect setting of GAME_MODE via key would change PREVIOUS_GAME_MODE but no one can rely on PREVIOUS_GAME_MODE actually being truthful if anyone can simply go set it via API contract.

Zidane avatar Sep 02 '22 23:09 Zidane

One option is to make it read-only, and with two Keys#GAME_MODE set in a row, I can set both values.

Lignium avatar Sep 02 '22 23:09 Lignium

The way I see it is that while game modes can change, we easily provide the DataTransaction including the Keys.PREVIOUS_GAME_MODE, since it can very well be changing.

gabizou avatar Oct 05 '22 16:10 gabizou