Skip to content

Releases: Traqueur-dev/CommandsAPI

4.2.3

02 Oct 07:54
2497e78

Choose a tag to compare

📦 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.7 to 8.14
  • Enhanced module dependencies: Changed implementation to api for core module in both spigot and velocity subprojects
    • This ensures transitive dependencies are properly exposed to consumers
  • Java compatibility update for Velocity module:
    • Set sourceCompatibility to Java 21
    • Set targetCompatibility to Java 21

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-velocity to spigot/velocity

📝 Migration Notes

  • Non-breaking patch release
  • Projects depending on spigot or velocity modules will now automatically receive core module dependencies
  • Velocity module now requires Java 21 (previously unspecified)

Full Changelog: 4.2.2...4.2.3

4.2.2

26 Aug 11:54
157fae5

Choose a tag to compare

📦 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>> to ArgumentConverter<T>
    • Updated apply() method return type from Enum<T> to T

📝 Migration Notes

  • Non-breaking patch release
  • No API changes or migration required

Full Changelog: 4.2.1...4.2.2

4.2.1

15 Jul 10:38

Choose a tag to compare

📦 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.

🔧 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

08 Jul 09:19

Choose a tag to compare

📦 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

4.1.0

07 Jul 16:18

Choose a tag to compare

📦 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

4.0.0

04 Jul 15:36

Choose a tag to compare

📦 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: 3.0.1...4.0.0

3.0.1

06 Apr 09:32
243b068

Choose a tag to compare

Changelog – Version 3.0.1

Bugs Fixs

  • Fix bug when addition of aliases creating autocompletion failure and miss registeration

3.0.0

27 Feb 15:40

Choose a tag to compare

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.

2.0.0

06 Nov 09:05

Choose a tag to compare

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.

1.6.0

04 Nov 11:14

Choose a tag to compare

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.