Repository navigation
Improve /mimic commands UX via Paper Brigadier API - #62
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 88 |
| Duplication | -4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Replace CommandAPI with Paper's Brigadier command API registered via LifecycleEvents.COMMANDS, so the CommandAPI plugin is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Operators have every permission implicitly, so they had all classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
196fbb1 to
1d375d5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues risk losing original blocks when replacement fails and corrupting player XP with non-finite amounts, while also breaking empty-value resets for preferred providers.
3 open issues
What changed in this PR
Migrates /mimic commands to Paper’s native Brigadier API, removing the CommandAPI plugin requirement while updating command syntax and feedback.
Changes:
- Registers commands through Paper lifecycle events and removes CommandAPI dependencies and fallback handling.
- Reworks command arguments, suggestions, validation, and interactive output.
- Requires explicitly set class permissions and adds a regression test for operator defaults.
| File | Description |
|---|---|
mimic-bukkit/src/test/kotlin/impl/mimic/PermissionsClassSystemTest.kt |
Tests explicit class permissions and operator defaults. |
mimic-bukkit/src/main/kotlin/MimicPlugin.kt |
Uses native command registration. |
mimic-bukkit/src/main/kotlin/impl/mimic/PermissionsClassSystem.kt |
Requires explicitly set class permissions. |
mimic-bukkit/src/main/kotlin/command/textUserInterface.kt |
Adds headers, verdicts, copyable IDs, and command hints. |
mimic-bukkit/src/main/kotlin/command/MimicCommands.kt |
Removes the CommandAPI registration wrapper. |
mimic-bukkit/src/main/kotlin/command/MainCommand.kt |
Registers the Brigadier tree through Paper lifecycle events. |
mimic-bukkit/src/main/kotlin/command/LevelSystemSubcommand.kt |
Introduces signed XP values with unit suffixes. |
mimic-bukkit/src/main/kotlin/command/ItemsSubcommand.kt |
Reorders give arguments and separates item payloads. |
mimic-bukkit/src/main/kotlin/command/InventorySubcommand.kt |
Migrates inventory commands and adds default info output. |
mimic-bukkit/src/main/kotlin/command/FallbackCommand.kt |
Removes the CommandAPI installation prompt. |
mimic-bukkit/src/main/kotlin/command/ConfigMessage.kt |
Uses the shared header helper. |
mimic-bukkit/src/main/kotlin/command/ConfigCommand.kt |
Migrates configuration commands and validates values. |
mimic-bukkit/src/main/kotlin/command/ClassSystemSubcommand.kt |
Migrates class commands and sends results to the sender. |
mimic-bukkit/src/main/kotlin/command/brigadier.kt |
Adds command builders, resolvers, parsers, and suggestions. |
mimic-bukkit/src/main/kotlin/command/BlocksSubcommand.kt |
Adds replacement behavior and targeted-block defaults. |
mimic-bukkit/build.gradle.kts |
Removes CommandAPI dependencies and development-server setup. |
mimic-bukkit/api/mimic-bukkit.api |
Updates the API snapshot after removing onDisable. |
gradle/libs.versions.toml |
Removes CommandAPI catalog entries. |
CHANGELOG.md |
Documents migration, syntax changes, and permission behavior. |
Review effort: Balanced
| blockRegistry.breakBlock(target, tool = null, DropsConsumer.disappear()) && | ||
| blockRegistry.setBlock(target, block, payload) |
There was a problem hiding this comment.
Updated in 3b2eeb5: the error now says the original block was removed when the new one could not be set. Reverting is not possible for custom registries, because BlockRegistry has no snapshot API.
1d375d5 to
3b2eeb5
Compare
| target.inventory.addItem(itemStack) | ||
| sender.sendMessage(successText { | ||
| append("Gave ${itemStack.amount} ") | ||
| appendId(item) | ||
| append(" to ${target.name}.") | ||
| }) | ||
| if (itemStack.amount < amount) { | ||
| sender.sendMessage(warningText("Requested $amount, but only ${itemStack.amount} can be given at once.")) |
There was a problem hiding this comment.
Fixed in c469d08: the amount is now captured before addItem and used for both the success message and the warning.
- Show group info by default, with headers and clickable command hints - Colour verdicts, report failures as command errors, copy IDs on click - Key-type item and block arguments with a separate payload, namespace-aware substring suggestions with tooltips and hints for empty input - `items give` in vanilla order with optional amount, warn about clamped amount - `blocks set` replaces an occupied block, `blocks break` and `blocks compare` default to the targeted block and the held item - New `xp` value syntax `[+|-]<amount>[L|P|T]`, remove `xp has` - Validate `/mimic config` values - Remove `experience` and `inv` aliases, `items id` and `blocks id` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3b2eeb5 to
c469d08
Compare


Replaces CommandAPI with Paper's Brigadier API (
Commands,ArgumentTypes,LifecycleEvents.COMMANDS), so the CommandAPI plugin is no longer needed.FallbackCommand, thesoftDepend, and the catalog entries are removed.Three commits, reviewable separately:
permissionsclass system counts only explicitly setmimic.class.*permissions. Previously, operators had all classes.infois the default for each group, with headers and clickable command hints.items giveuses vanilla order:<target> <item> [amount] [payload].blocks setreplaces an occupied block;blocks breakandblocks comparedefault to the targeted block and the held item.xptakes a single value:[+|-]<amount>[L|P|T]./mimic configvalues are validated.xp has,items id,blocks id, and theexperienceandinvaliases.The UX commit changes command syntax; see the CHANGELOG for the full list.
Testing
updateKotlinAbiandcheck -PwarningsAsErrors=truepass on the rebased branch (144 tests).BlockRegistryreview fixes fromdevelop; it was not re-run on a server afterwards.🤖 Generated with Claude Code