Releases: Traqueur-dev/CommandsAPI
4.2.3
📦 Changelog – Version 4.2.3
This patch release updates project dependencies and improves module configuration for better API exposure.
🔧 Improvements
Gradle & Build System Updates
- Upgraded Gradle wrapper from
8.7to8.14 - Enhanced module dependencies: Changed
implementationtoapifor core module in bothspigotandvelocitysubprojects- This ensures transitive dependencies are properly exposed to consumers
- Java compatibility update for Velocity module:
- Set
sourceCompatibilityto Java 21 - Set
targetCompatibilityto Java 21
- Set
Documentation Updates
- Updated installation examples to use
[version]placeholder instead of hardcoded version numbers - Fixed Gradle publish command in README: corrected module names from
platform-spigot/platform-velocitytospigot/velocity
📝 Migration Notes
- Non-breaking patch release
- Projects depending on
spigotorvelocitymodules will now automatically receivecoremodule dependencies - Velocity module now requires Java 21 (previously unspecified)
Full Changelog: 4.2.2...4.2.3
4.2.2
📦 Changelog – Version 4.2.2
This patch release fixes generic type declarations in the EnumArgument class for better type safety.
🐛 Bug Fixes
🔧 Fixed Enum Argument Type Safety
- Updated
EnumArgument<T, S>generic types:- Changed
ArgumentConverter<Enum<T>>toArgumentConverter<T> - Updated
apply()method return type fromEnum<T>toT
- Changed
📝 Migration Notes
- Non-breaking patch release
- No API changes or migration required
Full Changelog: 4.2.1...4.2.2
4.2.1
📦 Changelog – Version 4.2.1
This patch release fixes edge cases in tab-completion behavior for hierarchical commands registered via CommandTree.
It ensures suggestions are accurate and context-aware based on cursor position and partially typed input.
🐛 Bug Fixes
🎯 Improved Tab-Completion Suggestions
-
Fixed incorrect suggestions when the cursor is placed immediately after a valid argument without a trailing space (e.g.
/test sub<CURSOR>):-
Suggestions now differentiate between:
- Cursor at end of argument ➜ sibling and matching suggestions.
- Cursor after space ➜ child/subcommand suggestions.
-
-
Handled partial alias paths consistently:
- Suggestions work correctly for commands registered under aliases (e.g.
"parent.child") and their subcommands.
- Suggestions work correctly for commands registered under aliases (e.g.
🔧 Internal Improvements
- Refactored fallback suggestion logic in
CommandInvoker#suggest(...):- Clean separation of "argument-in-progress" vs "ready for next argument" cases.
📝 Migration Notes
This is a non-breaking patch release:
- No API changes.
- No migration required.
Full Changelog: 4.2.0...4.2.1
4.2.0
📦 Changelog – Version 4.2.0
This release adds a hierarchical command tree, improves default usage formatting, and lays the groundwork for more flexible subcommand management. It remains backward-compatible with 4.1.x.
🚨 Major Changes
🌲 Prefix-Tree Command Registry
-
Replaced the flat
Map<String, Command>with a newCommandTree<T, S>data structure.- Commands and subcommands are now stored in a trie, keyed by dot-separated paths (e.g.
"base.sub.subsub"). - Lookup via
findNode(base, rawArgs)returns the most specific matching node plus any leftover arguments. - Removal via
removeCommand(label, prune)can either clear a single node or prune an entire subtree.
- Commands and subcommands are now stored in a trie, keyed by dot-separated paths (e.g.
-
Introduced
CommandNode<T, S>to represent each segment in the tree, with optionalcommandpayload and child-tracking (hadChildren) flags.
🔄 Refactored Default Usage Generation
-
Overhauled
generateDefaultUsage(...)to show only one level of subcommands, then required and optional arguments.-
Usage now prints:
- Full command path (
/parent child …) - First-level subcommand choices (
<sub1|sub2>) - Required args (
<arg>…) and optional args ([opt]…)
- Full command path (
-
-
Backward-compatible: existing explicit
setUsage(...)overrides still apply.
✨ New Features
🔍 Improved Lookup & Autocomplete
- Subcommands are no longer flat—autocomplete and invocation automatically traverse the tree.
- Arguments fallback correctly when a node has no children but still accepts parameters.
🧪 Expanded Test Coverage
-
Added unit tests for
CommandTreeandCommandNodecovering:- Adding and finding nested commands
- Matching with extra args and partial paths
- Removing nodes with both prune and “clear only” semantics
-
Updated existing
CommandInvokertests to work against the new tree-based lookup.
🐛 Bug Fixes & Tweaks
-
Fixed edge cases in
removeCommand:- Pruning a branch now properly removes children and resets parent flags.
- Clearing a command on a leaf node without children now unregisters that node.
-
Cleaned up legacy methods that referenced the old flat map.
🧹 General Improvements
- Simplified the
addCommand(label, command)API to accept full paths directly. - Streamlined tree traversal code with clearer branch and command-presence checks.
- Minor logging enhancements when adding or removing commands from the tree.
⚠️ Migration Guide
-
Update your dependency to 4.2.0:
implementation "com.github.Traqueur-dev:core:4.2.0" implementation "com.github.Traqueur-dev:CommandsAPI-platform-<your-platform>:4.2.0"
-
Review any custom invocation code: switch from
manager.getCommands().get(label)tomanager.getCommands().findNode(base, rawArgs)inCommandInvoker. -
Adjust tests or tooling that assumed a flat map of labels. All lookups now go through
CommandTree. -
Verify your usage messages: autogenerated usage strings now show only one subcommand level; if you relied on deeper nesting, update your custom
setUsage(...)or test expectations.
Full Changelog: 4.1.0...4.2.0
4.1.0
📦 Changelog – Version 4.1.0
This release focuses on refactoring invocation logic, improving testability, and expanding converter functionality. It remains backward-compatible with 4.0.x.
🚨 Major Changes
🔄 Centralized Command Invocation
- Introduced a new
CommandInvoker<T, S>class to encapsulate the shared “execute” and “suggest” flows. - All platform executors (Spigot, Velocity) now delegate to
CommandInvoker, eliminating duplicate code and simplifying maintenance.
🛠️ Updater Testability Enhancements
- Made the GitHub-releases URL and logger instance in
Updaterconfigurable viasetUrlLatestRelease(URL)andsetLogger(Logger)so you can mock HTTP calls and logging in tests. - Refactored
fetchLatestVersion()andgetString()to use the injected URL, streamlining the code and removing hard-coded values.
✨ New Features
🧪 Comprehensive Test Suite
- Added unit tests for core classes:
Arguments,CommandManager, and the newCommandInvoker. - Platform adapters (Spigot & Velocity) now have integration tests covering end-to-end parsing, permission checks, and tab-completion.
- Converter tests for Boolean, Integer, Double, Long, Short, Byte, Character, and the brand-new
EnumArgument.of(...)helper (#34).
🔤 Improved Argument Converters
BooleanArgumentnow explicitly returnsnullon empty/null input, matching the behavior of other numeric converters.- Introduced
EnumArgumentto parse enums by name and supply their constants for tab-completion.
🐛 Bug Fixes
- Suppressed warnings in platform code (e.g. discarded
Bukkit.getServer()results). - Fixed
Updater.getVersion()to consistently load from theVERSION_PROPERTY_FILEconstant. - Handled the edge case where infinite arguments consume all remaining tokens, with added tests to verify behavior.
🧹 General Improvements
- Smoothed out error-handling paths: non-existent types now log a clear message and return false rather than throwing unchecked exceptions.
- Reduced cyclomatic complexity in
invoke(...)andsuggest(...)by factoring out shared steps intoCommandInvoker. - Enhanced log messages for better developer diagnostics when argument parsing or permission checks fail.
⚠️ Migration Guide
This minor bump (4.1.0) is fully backward-compatible. To upgrade:
-
Update your dependency:
implementation "com.github.Traqueur-dev:core:4.1.0" implementation "com.github.Traqueur-dev:CommandsAPI-platform-<your-platform>:4.1.0"
-
If you have custom tests that stub
Updater, switch to the newUpdater.setUrlLatestRelease(...)/Updater.setLogger(...)hooks. -
Take advantage of the new
EnumArgument.of(MyEnum.class)for enum-typed parameters.
Full Diff: v4.0.0...v4.1.0
4.0.0
📦 Changelog – Version 4.0.0
This version introduces a full modular refactor, enabling multi-platform support and significantly improving flexibility, scalability, and maintainability of the API.
🚨 Major Changes
🧱 Modular Platform Architecture
-
The codebase has been restructured into multiple modules:
core: platform-agnostic logic (commands, arguments, permissions, etc.)platform-spigot: implementation for Spigot/Bukkitplatform-velocity: initial implementation for Velocity support
-
The new structure allows platform-specific adapters to be plugged into the same command core engine.
🔁 New CommandPlatform Abstraction
- Introduced
CommandPlatform<T, S>interface to isolate platform-specific behavior (e.g. permissions, sender types). - Makes the core engine reusable for other platforms such as Fabric or BungeeCord.
⚙️ CommandManager is now fully generic
- Signature changed to
CommandManager<T, S>for better type safety and separation between plugin and sender. - Requires platform adapters to inject the plugin and sender types explicitly.
📦 Platform-specific artifacts
-
Each platform has its own artifact:
com.github.Traqueur-dev.CommandsAPI:platform-<platform>:4.0.0e.g.
platform-spigot,platform-velocity
✨ New Features
📖 Usage Message Auto-Generation
- If no usage is explicitly defined, a usage string is generated dynamically based on the command's structure and sender permissions.
🧠 Multi-Platform Ready
- Developers can now implement their own adapters to support new environments.
- Velocity support is scaffolded and can be extended using the core system.
🐛 Bug Fixes
✅ In-Game Only Enforcement
- Improved player-only command handling.
- Commands can now reliably prevent execution from the console using in-game checks.
🧹 General Improvements
- Cleaner separation of concerns: core vs. platform logic
- Improved internal logging via injected
Logger - Better extensibility and type safety
- Codebase modernization (Java 21 features, stricter nullability, etc.)
- Tab-completion and argument parsing have been made more robust and flexible
⚠️ Migration Guide
This update is not backward compatible with v3.x.
You must:
-
Replace your dependency with:
com.github.Traqueur-dev.CommandsAPI:platform-spigot:4.0.0 -
Relocate CommandsAPI when shading to avoid classpath conflicts
-
Replace any platform-bound logic with core + platform adapter model
-
Update
CommandManagerusage to use the new generic format -
Migrate any custom message handling, requirements, or command registration accordingly
🛣️ Next Steps
Update your plugin(s) to the new modular structure to take advantage of:
- Cleaner API boundaries
- Better testability
- Support for multiple platforms in a single codebase
Full Changelog: 3.0.1...4.0.0
3.0.1
Changelog – Version 3.0.1
Bugs Fixs
- Fix bug when addition of aliases creating autocompletion failure and miss registeration
3.0.0
Changelog – Version 3.0.0
This version introduces major changes, improving the flexibility of the API while removing deprecated elements. This update is not backward compatible.
Major Changes
-
Reworked message handling:
- Removed the
Messagesenum in favor of direct handling via the message handler. - Removed unused messages.
- Removed the
-
Improved
CommandManager:CommandManageris now generic:CommandManager<T extends Plugin>.- Allows better flexibility and compatibility with different plugin types.
-
Command system overhaul:
- Removed
SimpleCommand extends Command<JavaPlugin>. - New modular and adaptable approach.
- Removed
New Features
- Automatic usage message generation:
- Added a system that dynamically generates a usage message based on the sender's permissions if no usage message is defined.
Bugs
- Implement
inGameOnlyverification:- Commands can now enforce that they must be executed by a player and not from the console.
General Improvements
- Various optimizations and code enhancements.
Migration: This version is not backward compatible. If you were using SimpleCommand or the old message handling system, you will need to update your code accordingly.
Next Steps: Update your implementation to use the new structure and benefit from a more flexible API.
2.0.0
Changelog for CommandsAPI Version 2.0.0
Note: This release introduces major changes that are not backward compatible with previous versions.
- Renamed
TabConvertertoTabCompleterfor improved clarity and alignment with its function. - Added dynamic runtime casting methods for commands. This enhancement allows type casting at runtime, in addition to the existing type declaration system used when defining commands.
- Major rework of the
Executorclass: TheExecutornow manages both tab completion and command execution (perform) with a more streamlined architecture, resulting in enhanced performance and flexibility.
1.6.0
Changelog - CommandsAPI v1.6.0
New Features
-
Enhanced Contextual Tab Completion: The tab-completion feature now considers previously entered arguments, enabling smarter and more context-aware command suggestions based on prior inputs.
-
Direct Argument Typing: Developers can now add arguments directly with their associated class type, enabling direct typing and easier validation. Previously, arguments could only be specified using the
"arg:type"syntax. This new approach improves code readability and maintainability.
Changes
- Java 8 Compatibility: CommandsAPI has been downgraded to Java 8 to ensure broader support and compatibility with legacy runtime environments.
Fixes & Optimizations
- Minor Optimizations in permission handling and command requirements, ensuring a more reliable behavior when providing context-specific command suggestions for users.