CommandsAPI - Enhanced Commands Creation icon

CommandsAPI - Enhanced Commands Creation -----

CommandsAPI is a framework designed to enhance and simplify command management on Spigot servers.




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 new CommandTree<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.
  • Introduced CommandNode<T, S> to represent each segment in the tree, with optional command payload 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:
      1. Full command path (/parent child …)
      2. First-level subcommand choices (<sub1|sub2>)
      3. Required args (<arg>…) and optional args ([opt]…)
  • 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 CommandTree and CommandNode covering:
    • Adding and finding nested commands
    • Matching with extra args and partial paths
    • Removing nodes with both prune and “clear only” semantics
  • Updated existing CommandInvoker tests 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
  1. 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"
  2. Review any custom invocation code: switch from manager.getCommands().get(label) to manager.getCommands().findNode(base, rawArgs) in CommandInvoker.

  3. Adjust tests or tooling that assumed a flat map of labels. All lookups now go through CommandTree.

  4. 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
----------, Today at 9:21 AM

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 Updater configurable via setUrlLatestRelease(URL) and setLogger(Logger) so you can mock HTTP calls and logging in tests.
  • Refactored fetchLatestVersion() and getString() 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 new CommandInvoker.
  • 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
  • BooleanArgument now explicitly returns null on empty/null input, matching the behavior of other numeric converters.
  • Introduced EnumArgument to 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 the VERSION_PROPERTY_FILE constant.
  • 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(...) and suggest(...) by factoring out shared steps into CommandInvoker.
  • 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:

  1. Update your dependency:

    implementation "com.github.Traqueur-dev:core:4.1.0"
    implementation "com.github.Traqueur-dev:CommandsAPI-platform-<your-platform>:4.1.0"
  2. If you have custom tests that stub Updater, switch to the new Updater.setUrlLatestRelease(...) / Updater.setLogger(...) hooks.

  3. Take advantage of the new EnumArgument.of(MyEnum.class) for enum-typed parameters.
Full Diff: v4.0.0...v4.1.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.
⚠️ This update is NOT backward compatible.

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/Bukkit
    • platform-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.0

    e.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 CommandManager usage 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: https://github.com/Traqueur-dev/CommandsAPI/compare/3.0.1...4.0.0
----------, Jul 4, 2025

Changelog – Version 3.0.1
Bugs Fixs
  • Fix bug when addition of aliases creating autocompletion failure and miss registeration
----------, Apr 6, 2025

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 Messages enum in favor of direct handling via the message handler.
    • Removed unused messages.
  • Improved CommandManager:
    • CommandManager is 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.
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 inGameOnly verification:
    • 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.
----------, Feb 27, 2025

Changelog for CommandsAPI Version 2.0.0

Note: This release introduces major changes that are not backward compatible with previous versions.

  • Renamed TabConverter to TabCompleter for 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 Executor class: The Executor now manages both tab completion and command execution (perform) with a more streamlined architecture, resulting in enhanced performance and flexibility.
----------, Nov 6, 2024

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.
----------, Nov 4, 2024

Changelog for CommandAPI Version 1.5.1
Release Date: September 17, 2024

New Features
  • Command Completion with /plugin-name:command Format:
    • Added support for command completion when prefixed with the plugin name (e.g., /plugin-name:command). This improves compatibility in environments where multiple plugins might use similar commands.
  • Command Execution with /plugin-name:command Format:
    • Commands can now be executed using the full /plugin-name:command format, ensuring the correct command is used even when multiple plugins share identical command names.
  • New setDebug() Method:
    • Introduced the setDebug() method, allowing developers to control the display of debug information in the console. This provides better control over the verbosity of debug logs, making it easier to troubleshoot during development without cluttering production logs.
Improvements
  • Enhanced Compatibility with Multi-Command Environments:
    • This version improves the handling of commands shared between multiple plugins, allowing users to explicitly specify the plugin during both command completion and execution.
Upgrade Notes
  • No major changes are expected for existing projects, but users are encouraged to test the new prefixed command syntax for better command handling in multi-plugin environments.
  • The setDebug() method is optional but can be useful for adjusting the level of debug information displayed in the console.
This update focuses on functional improvements and developer flexibility, making CommandAPI more adaptable to complex environments and easier to customize for debugging and troubleshooting.
----------, Sep 17, 2024

### Changelog for CommandAPI Version 1.5.0

**Release Date:** August 27, 2024

#### New Features
- **Customizable Logging System:**
- Added the ability to change the logging system used by CommandAPI. Users can now customize how and where log messages are recorded, enhancing flexibility and integration with different logging frameworks.

#### Improvements
- **Package Rework:**
- The internal package structure of CommandAPI has been reorganized to improve code readability and maintainability. This change may affect imports in existing implementations; ensure that your project is updated accordingly.

- **Command Executor Extraction:**
- The Command Executor logic has been extracted from the `CommandManager` class and placed into its own dedicated class. This separation of concerns improves the modularity of the codebase, making it easier to manage and extend.

#### Miscellaneous
- **Documentation Updates:**
- Updated the documentation to reflect the new package structure and provide guidance on how to utilize the customizable logging system and new command executor structure.

#### Upgrade Notes
- **Breaking Changes:**
- If your project depends on specific package structures or internal implementations of the `CommandManager` class, ensure that you update your imports and references to align with the new package layout.
- Review the updated documentation to understand the changes to the Command Executor and how to adapt your current implementation.

#### Bug Fixes
- **General Stability Improvements:**
- Minor bug fixes and performance enhancements have been applied throughout the codebase.

This version is a significant update that enhances customization, improves the architecture, and lays the groundwork for future features.
----------, Aug 27, 2024

New Features:
  • Conditional Command Requirements:
    • Added the ability to include conditional requirements for commands. This feature allows commands to be executed only if certain conditions outside the command execution environment are met.
    • Example Conditions:
      • Player in Overworld: Commands can now check if the player is in the Overworld before executing.
      • Player Health: Commands can verify if the player has full health before proceeding.
    These new conditional requirements enhance gameplay by allowing more complex and context-sensitive commands, providing greater control and flexibility for players and administrators.
Improvements:
  • Command System Overhaul:
    • Enhanced the command system to support the integration of conditional checks without affecting performance.
    • Improved error messages to provide clearer feedback when conditions for command execution are not met.
Documentation:
  • Updated the user guide to include detailed instructions on how to implement and use the new conditional command requirements.
  • Added examples and best practices for utilizing conditional checks effectively.
We hope these new features improve your developement experience by offering more dynamic and responsive command execution!
----------, Aug 2, 2024

Resource Information
Author:
----------
Total Downloads: 270
First Release: Jul 29, 2024
Last Update: Today at 9:21 AM
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings