Two-line kts and config comments, refresh README
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>
This commit is contained in:
1 parent
3f6d7bbca2
commit
2dc348ff18
3 files changed
+37
-32
No files matched your search
@@ -11,30 +11,37 @@ This is a [TrueOG Network](https://trueog.net) maintained soft fork of [eccentri
|
||||
- Compatible with [NoClip-OG](https://github.com/true-og/NoClip-OG) (1.3.0+). When `restrict_spectator` is enabled, players holding the `noclip.use` permission 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.toggle` *and* a region in `creative_regions`, or `gamemodeinventories.anywhere` to ignore both. Spectator needs `gamemodeinventories.spectator` or `noclip.use`. Adventure is refused in `restrict_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 via `GameModeInventories#getGameModePolicy()`. `mayUse(player, gameMode, location)` answers for any gamemode; survival is always allowed, adventure never is.
|
||||
- Login is deferred to [Spawn-OG](https://github.com/true-og/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. Without Spawn-OG, GameModeInventories-OG still forces survival on join for creative players outside a creative region.
|
||||
- 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](https://github.com/true-og/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 `internalGameModeChange` to hand creative or spectator back after a rescue or `/spawnback` return. 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).
|
||||
|
||||
This plugin (and the GMIDatabaseConverter plugin) are available for download as a single ZIP file from the [GameModeInventories page on BukkitDev](http://dev.bukkit.org/bukkit-plugins/gamemodeinventories).
|
||||
### Commands
|
||||
|
||||
### Warning
|
||||
| Command | Description | Permission |
|
||||
| --- | --- | --- |
|
||||
| `/gmi [option]` (alias `/gmic`) | Toggle creative mode, or change config options | `gamemodeinventories.toggle` / `gamemodeinventories.anywhere` to toggle; `gamemodeinventories.admin` for config |
|
||||
|
||||
This version of GameModeInventories uses a different storage format when saving inventories from the legacy one. Before installing this version, you should first run the [GMIDatabaseConverter](https://github.com/eccentricdevotion/GMIDatabaseConverter/blob/master/README.md) plugin on your CraftBukkit 1.6.4 server to update your GameModeInventories database.
|
||||
### Permissions
|
||||
|
||||
### How do I update my GMI database?
|
||||
- `gamemodeinventories.use` - Separate per-gamemode inventories (default: true)
|
||||
- `gamemodeinventories.toggle` - Toggle creative via `/gmic` inside a `creative_regions` region (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 under `bypass` in the config (default: op)
|
||||
- `gamemodeinventories.admin` - Change config options via `/gmi` (default: op)
|
||||
|
||||
**_Before_** upgrading your server to CraftBukkit 1.7.x and installing GameModeInventories version 2.x, you should run GMIDatabaseConverter on your **1.6.4** server.
|
||||
### Compilation and Build
|
||||
|
||||
1. Install GMIDatabaseConverter.jar to the server's plugins folder
|
||||
2. Start the server
|
||||
* The plugin will attempt to find and backup your old GameModeInventories database file
|
||||
* It will then read the existing inventory data
|
||||
* The existing data will be converted to the new format
|
||||
* The new data will be written back to the database
|
||||
3. Once conversion is complete, you can update your GameModeInventories plugin to version 2.x and restart the server
|
||||
4. If you are satisfied that GameModeInventories version 2.x is functioning correctly, you can safely remove GMIDatabaseConverter
|
||||
This project uses Gradle. To build the plugin:
|
||||
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
### Why did you change the storage format?
|
||||
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.
|
||||
|
||||
The format change is a result of code changes removing the reliance on using net.minecraft.server and org.craftbukkit code directly within the plugin (instead of using only the Bukkit API). This led to the plugin breaking with every Minecraft/CraftBukkit update. These code changes mean the plugin should no longer break between versions.
|
||||
### 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.
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
/* ------------------------------ Plugins ------------------------------ */
|
||||
// ------------------------------ Plugins ------------------------------
|
||||
plugins {
|
||||
id("java") // Import Java plugin.
|
||||
id("java-library") // Import Java Library plugin.
|
||||
@@ -8,7 +8,7 @@ plugins {
|
||||
eclipse // Import Eclipse plugin.
|
||||
}
|
||||
|
||||
/* --------------------------- JDK / Kotlin ---------------------------- */
|
||||
// --------------------------- JDK / Kotlin ----------------------------
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17 // Compile with JDK 17 compatibility.
|
||||
toolchain { // Select Java toolchain.
|
||||
@@ -17,14 +17,14 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------- Metadata ------------------------------ */
|
||||
// ----------------------------- Metadata ------------------------------
|
||||
group = "me.eccentric_nz.gamemodeinventories" // Declare bundle identifier.
|
||||
|
||||
version = "3.5.1" // Declare plugin version (will be in .jar).
|
||||
|
||||
val apiVersion = "1.19" // Declare minecraft server target version.
|
||||
|
||||
/* ----------------------------- Resources ----------------------------- */
|
||||
// ----------------------------- Resources -----------------------------
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
val props = mapOf("version" to project.version, "apiVersion" to apiVersion)
|
||||
inputs.properties(props) // Indicates to rerun if version changes.
|
||||
@@ -32,7 +32,7 @@ tasks.named<ProcessResources>("processResources") {
|
||||
from("LICENSE") { into("/") } // Bundle licenses into jarfiles.
|
||||
}
|
||||
|
||||
/* ---------------------------- Repos ---------------------------------- */
|
||||
// ---------------------------- Repos ----------------------------------
|
||||
repositories {
|
||||
mavenCentral() // Import the Maven Central Maven Repository.
|
||||
gradlePluginPortal() // Import the Gradle Plugin Portal Maven Repository.
|
||||
@@ -42,7 +42,7 @@ repositories {
|
||||
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||
}
|
||||
|
||||
/* ---------------------- Java project deps ---------------------------- */
|
||||
// ---------------------- Java project deps ----------------------------
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare Purpur API version to be packaged.
|
||||
compileOnly("net.coreprotect:coreprotect:22.4") // Import the CoreProtect API.
|
||||
@@ -52,13 +52,13 @@ dependencies {
|
||||
implementation("org.slf4j:slf4j-nop:2.0.17") // Provide a relocated no-op SLF4J backend to avoid provider warnings.
|
||||
}
|
||||
|
||||
/* ---------------------- Reproducible jars ---------------------------- */
|
||||
// ---------------------- Reproducible jars ----------------------------
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
/* ----------------------------- Shadow -------------------------------- */
|
||||
// ----------------------------- Shadow --------------------------------
|
||||
tasks.shadowJar {
|
||||
archiveClassifier.set("") // Use empty string instead of null.
|
||||
exclude("io.github.miniplaceholders.*") // Exclude the MiniPlaceholders package from being shadowed.
|
||||
@@ -77,7 +77,7 @@ tasks.jar { archiveClassifier.set("part") } // Applies to root jarfile only.
|
||||
|
||||
tasks.build { dependsOn(tasks.spotlessApply, tasks.shadowJar) } // Build depends on spotless and shadow.
|
||||
|
||||
/* --------------------------- Javac opts ------------------------------- */
|
||||
// --------------------------- Javac opts -------------------------------
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-parameters") // Enable reflection for java code.
|
||||
options.isFork = true // Run javac in its own process.
|
||||
@@ -85,7 +85,7 @@ tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8" // Use UTF-8 file encoding.
|
||||
}
|
||||
|
||||
/* ----------------------------- Auto Formatting ------------------------ */
|
||||
// ----------------------------- Auto Formatting ------------------------
|
||||
spotless {
|
||||
java {
|
||||
eclipse().configFile("config/formatter/eclipse-java-formatter.xml") // Eclipse java formatting.
|
||||
|
||||
@@ -12,14 +12,12 @@ no_wither_spawn: true
|
||||
no_golem_spawn: true
|
||||
remove_potions: false
|
||||
restrict_creative: true
|
||||
# Where creative is allowed, for players who also hold gamemodeinventories.toggle.
|
||||
# Both are required, so an ordinary player standing here cannot hold creative.
|
||||
# gamemodeinventories.anywhere ignores this list.
|
||||
# Where creative is allowed for holders of gamemodeinventories.toggle; both are
|
||||
# required, so an ordinary player standing here cannot hold creative. gamemodeinventories.anywhere ignores this list.
|
||||
creative_regions:
|
||||
- spawn
|
||||
# Worlds where adventure is refused, so it cannot stick where survival rules
|
||||
# apply. Leave minigame worlds off this list: their plugins put players in
|
||||
# adventure legitimately and those changes must not be cancelled.
|
||||
# Worlds where adventure is refused, so it cannot stick where survival rules apply.
|
||||
# Leave minigame worlds off: their plugins put players in adventure legitimately and those changes must not be cancelled.
|
||||
restrict_adventure_worlds:
|
||||
- world
|
||||
- world_nether
|
||||
|
||||
Reference in new issue
Block a user