2dc348ff1800f1c45410780d145a6146eef17241
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>
GameModeInventories-OG
Allow players to have separate inventories for each game mode (Creative, Survival and Adventure).
This is a TrueOG Network maintained soft fork of eccentricdevotion/GameModeInventories.
Changes from Upstream
- Build system migrated from Maven to Gradle (Kotlin DSL), Gradle 8.14.3, Shadow 8.3.9, Spotless with TrueOG Network's eclipse-based Java Formatting.
config.ymlis read-only at runtime — the plugin no longer mutates or rewrites it. A defaultconfig.ymlis copied into the plugin folder on first run if missing.- Compatible with NoClip-OG (1.3.0+). When
restrict_spectatoris enabled, players holding thenoclip.usepermission are exempt from the restriction so NoClip's creative/spectator toggle works without being cancelled or spamming chat. - Creative is staff only: it needs
gamemodeinventories.toggleand a region increative_regions, orgamemodeinventories.anywhereto ignore both. Spectator needsgamemodeinventories.spectatorornoclip.use. Adventure is refused inrestrict_adventure_worlds. - Gamemode rules live in one place,
api/GameModePolicy, which every enforcement point in the plugin asks. It is published for other plugins so they enforce the same rule instead of reimplementing it: fetch it from the Bukkit services manager, or reflectively viaGameModeInventories#getGameModePolicy().mayUse(player, gameMode, location)answers for any gamemode; survival is always allowed, adventure never is. - Creative is enforced on movement and teleports, judged at the destination, and unsanctioned creative is forced back to survival with one-time fall protection. Gamemode switches pre-validated through the policy (
internalGameModeChange) are trusted rather than policed a second time. - Login is deferred to Spawn-OG when it is installed. It normalizes gamemode inside a safety transaction that also relocates the player, so forcing survival underneath it would race that transaction. Spawn-OG also uses the policy and
internalGameModeChangeto hand creative or spectator back after a rescue or/spawnbackreturn. Without Spawn-OG, GameModeInventories-OG still forces survival on join for creative players outside a creative region. - Dropped LogBlock integration. Block-removal logging now runs exclusively through CoreProtect / CoreProtect-OG.
- Targets Purpur API 1.19.4 (Java 17, GraalVM toolchain).
Commands
| Command | Description | Permission |
|---|---|---|
/gmi [option] (alias /gmic) |
Toggle creative mode, or change config options | gamemodeinventories.toggle / gamemodeinventories.anywhere to toggle; gamemodeinventories.admin for config |
Permissions
gamemodeinventories.use- Separate per-gamemode inventories (default: true)gamemodeinventories.toggle- Toggle creative via/gmicinside acreative_regionsregion (default: op)gamemodeinventories.anywhere- Hold and toggle creative anywhere, exempt from forced survival (default: op)gamemodeinventories.spectator- Hold spectator mode (default: op)gamemodeinventories.death- Keep separate death handling (default: op)gamemodeinventories.bypass- Bypass restrictions enabled underbypassin the config (default: op)gamemodeinventories.admin- Change config options via/gmi(default: op)
Compilation and Build
This project uses Gradle. To build the plugin:
./gradlew build
This produces the plugin jar in the build/libs directory. It is normally built as a submodule of Spawn-OG, which compiles against its API.
License
GPL v3 or later. Inventory serialization derives from work by eccentric_nz, drtshock, and Kristian S. Stangeland (aadnk); the bundled JSON package is JSON.org code under its own license.
Description
Bukkit plugin to allow players to have separate inventories for each game mode (Creative and Survival). TrueOG Network's configuration.
18 MiB
0 Stars
2 Watchers
0 Forks
Languages
Java
100%