Register /yamipa command and resync Brigadier (Purpur 1.19.4) #3

Merged
NotAlexNoyle merged 1 commits from codex/change-/images-command-to-/yamipa-and-fix-registration into main 2026-03-21 13:12:50 -04:00
NotAlexNoyle commented 2026-03-18 13:42:49 -04:00 (Migrated from github.com)

Motivation

  • Commands were only injected into Brigadier and lacked a corresponding Bukkit plugin.yml entry, causing registration/permission issues on Purpur 1.19.4.
  • The public command surface needed to be based on /yamipa (with /image compatibility) instead of /images to match documentation and expected usage.

Description

  • Changed the Brigadier base command to COMMAND_NAME = "yamipa" and removed the "images" alias while keeping "image" as a compatibility alias in ImageCommandBridge.
  • Added an explicit yamipa command declaration to src/main/resources/plugin.yml so Bukkit/Purpur will register the command and alias at startup.
  • Added Internals.syncCommands() which invokes the server's syncCommands method via reflection to resynchronize Bukkit commands into Brigadier.
  • Updated ImageCommandBridge.register to call Internals.syncCommands() (wrapped in a safe try/catch), and to clear the default command permissions after registering the Brigadier nodes.

Testing

  • Ran git diff --check which produced no index issues.
  • Attempted ./gradlew compileJava, but the build fails in this environment before project compilation because the Gradle/Kotlin toolchain code cannot parse the installed Java version string 25.0.1, so compilation could not be validated here.

Codex Task

### Motivation - Commands were only injected into Brigadier and lacked a corresponding Bukkit `plugin.yml` entry, causing registration/permission issues on Purpur 1.19.4. - The public command surface needed to be based on `/yamipa` (with `/image` compatibility) instead of `/images` to match documentation and expected usage. ### Description - Changed the Brigadier base command to `COMMAND_NAME = "yamipa"` and removed the `"images"` alias while keeping `"image"` as a compatibility alias in `ImageCommandBridge`. - Added an explicit `yamipa` command declaration to `src/main/resources/plugin.yml` so Bukkit/Purpur will register the command and alias at startup. - Added `Internals.syncCommands()` which invokes the server's `syncCommands` method via reflection to resynchronize Bukkit commands into Brigadier. - Updated `ImageCommandBridge.register` to call `Internals.syncCommands()` (wrapped in a safe `try/catch`), and to clear the default command permissions after registering the Brigadier nodes. ### Testing - Ran `git diff --check` which produced no index issues. - Attempted `./gradlew compileJava`, but the build fails in this environment before project compilation because the Gradle/Kotlin toolchain code cannot parse the installed Java version string `25.0.1`, so compilation could not be validated here. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69bae2eeabbc832fbfb1483502b4c419)
Sign in to join this conversation.