License headers unchanged. Convert build script banners to // form,
trim config comments to two lines, document commands and permissions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The LOWEST listener cancelled every disallowed creative switch, including
plugin-driven ones flagged internal, contradicting the comments claiming
internal switches skip the cancel. /gmic and the published policy's
changeGameMode now pre-validate against GameModePolicy before switching,
and the listener trusts internal switches so an authority-approved
restore (Spawn-OG /spawnback) can no longer be self-cancelled.
changeGameMode returns whether the switch stuck.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Being inside a creative region was licence enough, so an ordinary player
who reached creative by any other route kept it there. Creative now needs
gamemodeinventories.toggle as well: the permission says who, the region
says where. gamemodeinventories.anywhere still ignores both.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adventure was the one gamemode nothing corrected: the policy never
sanctioned it, but no enforcement point acted on that, so it stuck until
the player's next login. onGameModeChange now cancels it in the worlds
listed under restrict_adventure_worlds. Minigame worlds stay off that list
because BuildBattle-OG, Duels-OG, and Spleef-OG put their players in
adventure deliberately.
config.yml is the only description of what this plugin reads. The defaults
map was a second copy of that list in code, kept in step by hand, so the
bundled config.yml is now the schema the deployed one is checked against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Region and permission rules were duplicated between this plugin's listener
and every consumer that needed the same answer. GameModePolicy now owns
them, the listener delegates, and the policy is registered with the Bukkit
services manager so other plugins enforce the same rule.
Login is deferred to Spawn-OG when it is installed: it normalizes gamemode
inside a safety transaction that also relocates the player, and forcing
survival underneath it raced that transaction.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>