From 712e7f8ba0a62f0194d5f0f3c0282c9c8bce0bc3 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Sat, 26 Sep 2026 22:23:02 -0700 Subject: [PATCH] Update Paper plugin descriptor --- TODO.md | 2 +- build.gradle | 10 ++++ .../metropolis/MetropolisPlugin.java | 2 + src/main/resources/plugin.yml | 48 +++++++++++++++++-- 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 133c0a4..5768390 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,7 @@ | MET-001 | Done | Initialize Gradle in the project root, add the Gradle wrapper, and create the project build file. | | MET-002 | Done | Set Gradle project metadata and configure a Java toolchain compatible with the target modern Paper version. | | MET-003 | Done | Configure repositories and compatible PaperMC, WorldEdit, WorldGuard, and other required or optional dependencies; add build plugins such as Shadow only if needed. | -| MET-004 | Ready | Move or verify plugin.yml under src/main/resources, configure Gradle resource processing, and update its Paper api-version, dependencies, commands, permissions, and required fields. | +| MET-004 | Done | Move or verify plugin.yml under src/main/resources, configure Gradle resource processing, and update its Paper api-version, dependencies, commands, permissions, and required fields. | | MET-005 | Ready | Add JUnit 5 test infrastructure and keep the default Gradle `test` task server-free. Use an in-memory Paper harness such as MockBukkit for Bukkit/Paper behavior and mocks or test doubles for WorldEdit, WorldGuard, and narrow API boundaries where appropriate. | | MET-006 | Ready | Build the initial Gradle project and run its tests; resolve build setup issues before removing the existing Maven build. | | MET-007 | Ready | Update .gitignore for Gradle and remove obsolete Maven and Eclipse project files after the Gradle build succeeds. | diff --git a/build.gradle b/build.gradle index bb0a084..62f324e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ plugins { group = 'com.majinnaibu.bukkitplugins' description = 'Metropolis' +version = '0.5-SNAPSHOT' repositories { mavenCentral() @@ -33,6 +34,15 @@ tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } +def pluginVersion = project.version.toString() + +tasks.named('processResources') { + inputs.property('version', pluginVersion) + filesMatching('plugin.yml') { + expand(version: pluginVersion) + } +} + tasks.named('wrapper') { gradleVersion = '9.8.0' distributionType = Wrapper.DistributionType.BIN diff --git a/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java b/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java index 74ae5c2..8528528 100644 --- a/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java +++ b/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java @@ -31,6 +31,7 @@ import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisCommand; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisDebugGenerateTestHomesCommand; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisFlagResetCommand; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisHomeEvictCommand; +import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisHomeAcquire; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisHomeGenerateCommand; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisHomeGoCommand; import com.majinnaibu.bukkitplugins.metropolis.commands.MetropolisHomeListCommand; @@ -288,6 +289,7 @@ public class MetropolisPlugin extends JavaPlugin { RegisterCommandHandler("metropolis-flag-reset", new MetropolisFlagResetCommand(this)); RegisterCommandHandler("metropolis-home-evict", new MetropolisHomeEvictCommand(this)); + RegisterCommandHandler("metropolis-home-acquire", new MetropolisHomeAcquire(this)); RegisterCommandHandler("metropolis-home-generate", new MetropolisHomeGenerateCommand(this)); RegisterCommandHandler("metropolis-home-go", new MetropolisHomeGoCommand(this)); RegisterCommandHandler("metropolis-home-list", new MetropolisHomeListCommand(this)); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8de8ab6..646ece5 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,10 +1,50 @@ name: Metropolis main: com.majinnaibu.bukkitplugins.metropolis.MetropolisPlugin -depend: [WorldGuard] -softdepend: [WorldEdit,CommandBook] -version: 0.5 +api-version: '26.2' +depend: [WorldGuard, WorldEdit] +softdepend: [CommandBook] +version: '${version}' database: false commands: metropolis: description: This command displays the current metropolis version. - usage: /metropolis metropolis-home-generate: description: This command generates a home for a user as if they'd just logged in. permission: metropolis.home.generate usage: /metropolis-home-generate metropolis-home-list: description: This lists the regions managed by Metropolis permission: metropolis.home.list usage: /metropolis-home-list metropolis-home-evict: description: This unassigns a player's current home. permission: metropolis.home.evict usage: /metropolis-home-evict metropolis-home-move: description: This command swaps a player's current home with a reserved plot. permission: metropolis.home.move usage: /metropolis-home-move [player] metropolis-home-go: description: Teleports the user or another player to his home. permission: metropolis.home.go usage: /metropolis-home-go metropolis-flag-reset: description: This command resets the WorldGuard flags for all managed regions (city and h_*). permission: metropolis.flag.reset usage: /metropolis-flag-reset metropolis-plot-reserve: description: This command reserves a plot so it won't be assigned as a home. permission: metropolis.plot.reserve usage: /metropolis-plot-reserve metropolis-plot-go: description: This command teleports the user or another player to a plot. permission: metropolis.plot.go usage: /metropolis-plot-go [playerName] metropolis-debug-generatetesthomes: description: This command is ignored on non-debug builds. permission: metropolis.debug usage: /metropolis-debug-gentesthomes \ No newline at end of file + usage: /metropolis + metropolis-home-generate: + description: This command generates a home for a user as if they'd just logged in. + permission: metropolis.home.generate + usage: /metropolis-home-generate + metropolis-home-list: + description: This lists the regions managed by Metropolis + permission: metropolis.home.list + usage: /metropolis-home-list + metropolis-home-evict: + description: This unassigns a player's current home. + permission: metropolis.home.evict + usage: /metropolis-home-evict + metropolis-home-move: + description: This command swaps a player's current home with a reserved plot. + permission: metropolis.home.move + usage: /metropolis-home-move [player] + metropolis-home-go: + description: Teleports the user or another player to his home. + permission: metropolis.home.go + usage: /metropolis-home-go + metropolis-home-acquire: + description: Acquires an available home plot. + usage: /metropolis-home-acquire + metropolis-flag-reset: + description: This command resets the WorldGuard flags for all managed regions (city and h_*). + permission: metropolis.flag.reset + usage: /metropolis-flag-reset + metropolis-plot-reserve: + description: This command reserves a plot so it won't be assigned as a home. + permission: metropolis.plot.reserve + usage: /metropolis-plot-reserve + metropolis-plot-go: + description: This command teleports the user or another player to a plot. + permission: metropolis.plot.go + usage: /metropolis-plot-go [playerName] + metropolis-debug-generatetesthomes: + description: This command is ignored on non-debug builds. + permission: metropolis.debug + usage: /metropolis-debug-gentesthomes \ No newline at end of file