From 7821d40f70a84ac36c98b5109a47ceb5f2c5dc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sat, 6 Jan 2024 09:03:47 +0100 Subject: [PATCH] feat: update changelog & references to processors --- .wordlist.txt | 7 +++++++ docs/cloud-v2.md | 39 +++++++++++++++++++++++++++++++++++++-- docs/core/index.md | 15 ++++++--------- mkdocs.yml | 11 +++++++---- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/.wordlist.txt b/.wordlist.txt index 27b9d9f..84c2b6d 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -78,3 +78,10 @@ CommandContext CommandMeta iterables CommandContainer +cooldown +ArgumentParser +isContextFree +CommandInput +whitespace +CommandManager +Incendo diff --git a/docs/cloud-v2.md b/docs/cloud-v2.md index 0ea9a26..0ec1590 100644 --- a/docs/cloud-v2.md +++ b/docs/cloud-v2.md @@ -83,10 +83,29 @@ Suggestion providers now return iterables rather than lists. **Permission refactoring ([#578](https://github.com/Incendo/cloud/pull/578))** `CommandPermission` was renamed to `Permission` and the old permission implementation is no longer exposed as API. The static factory methods were moved and renamed: `AndPermission.of` -> `Permission.allOf`, `OrPermission.of` -> `Permission.anyOf`. +**Remove ArgumentParser#isContextFree ([#578](https://github.com/Incendo/cloud/pull/578))** +No longer used. + +**Refactor injection services ([#580](https://github.com/Incendo/cloud/pull/580))** +Use an immutable interface as context rather than a generic triplet. Allow for injections using type tokens. This +also adds support for qualified Guice injection. + +**Extract command execution from CommandManager ([#581](https://github.com/Incendo/cloud/pull/581))** +Command execution is now handled by a `CommandExecutor` which can be retrieved from the command manager. + +**Make suggestion providers accept CommandInput ([#594](https://github.com/Incendo/cloud/pull/594))** +This allows suggestion providers to consume more than a single token at a time, and also gives them access to whitespace +information. This allows for better multi-token suggestions. + +**Move confirmation system to external repository ([#620](https://github.com/Incendo/cloud/pull/620))** +The confirmation system now lives in [cloud-processors](https://github.com/Incendo/cloud-processors). + ### Annotations -**Lenient `@Suggestions` methods ([#496](https://github.com/Incendo/cloud/pull/496))** -Methods producing suggestions can now return iterable/stream rather than just a list of suggestions. The methods can either return suggestion objects, or strings that will be mapped to simple suggestions. +**Lenient `@Suggestions` methods ([#496](https://github.com/Incendo/cloud/pull/496), [#617](https://github.com/Incendo/cloud/pull/617))** +Methods producing suggestions can now return iterable/stream rather than just a list of suggestions. +The methods can either return suggestion objects, or strings that will be mapped to simple suggestions. +The suggestion methods may also accept injected parameters and omit both the sender and command input. **More flexible annotation parser ([#509](https://github.com/Incendo/cloud/pull/509)) - Proposal: [#510](https://github.com/Incendo/cloud/pull/510)** The annotation parser now allows you to swap out the components that make up the annotation parsing process. This means that we're no longer bound to the cloud annotations, and that users can swap out how command methods are detected, arguments are bound, flags are assembled, etc. @@ -112,6 +131,9 @@ Decorators are like builder modifiers, but they're applied to _all_ builders con **CommandContainer priorities ([#583](https://github.com/Incendo/cloud/pull/583))** `@CommandContainer` may not have a priority specified which determines the order in which the containers are initialized. +**Allow for a different class loader when parsing command containers** +This fixes issues with platforms that use custom class loaders for plugins. + ### Kotlin **Support default values ([#511](https://github.com/Incendo/cloud/pull/511))** @@ -133,6 +155,16 @@ Tooltips are now supported in cloud-brigadier and the platforms that support Bri **Refactoring ([#525](https://github.com/Incendo/cloud/pull/525))** `cloud-brigadier` has been refactored to make it easier to maintain. The exposed API was updated (and documented) in the process. +**Allow disabling forced executors ([#601](https://github.com/Incendo/cloud/pull/601))** +Adds settings to the Brigadier manager. You may now disable forced executors. + +**Use cloud number suggestions by default ([#602](https://github.com/Incendo/cloud/pull/602))** +Brigadier doesn't display suggestions for numbers. + +**Better inner node construction ([#610](https://github.com/Incendo/cloud/pull/610))** +Issues with inner nodes in aggregate components have been resolved and these nodes are now constructed in the +same way as other nodes. + #### Bukkit **Description resolution ([#530](https://github.com/Incendo/cloud/pull/530))** @@ -142,3 +174,6 @@ This also changes how Bukkit attempts to resolve descriptions for root commands. 1. Check for the presence of a new `BUKKIT_DESCRIPTION` command meta key. 2. Attempt to resolve the command description. 3. Use the argument description of the root command node (the description you supply when you do `CommandManager.commandBuilder(...)`). + +**Parse selectors in correct thread context ([#590](https://github.com/Incendo/cloud/pull/590))** +Selectors can only be parsed on the main server thread. The parser will now switch to the correct thread when parsing. diff --git a/docs/core/index.md b/docs/core/index.md index 0257a62..bd73723 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -313,6 +313,12 @@ When a command is entered by a command sender, it goes through the following sta The pre- and post-processors can be registered to the command manager using `CommandManager#registerCommandPreProcessor` and `CommandManager#registerCommandPostProcessor`. +Incendo maintains some processors that you may depend on in your projects: + +- [cloud-processors-confirmation](https://github.com/Incendo/cloud-processors/tree/master/cloud-processors-confirmation) +- [cloud-processors-cooldown](https://github.com/Incendo/cloud-processors/tree/master/cloud-processors-cooldown) +- [cloud-requirements](https://github.com/incendo/cloud-requirements) + #### Exception handling Cloud v2 introduced a new exception handling system. @@ -625,15 +631,6 @@ method, as it'll return `this` by default. ## Extra -### Confirmations - -Cloud has a [preprocessor](#pre---postprocessing) that allows you to create commands that require -an extra confirmation. - -You can find examples of how make use of this system on GitHub, for either -[Builders](https://github.com/Incendo/cloud/blob/2.0.0-dev/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/builder/feature/ConfirmationExample.java) or -[Annotations](https://github.com/Incendo/cloud/blob/2.0.0-dev/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/annotations/feature/ConfirmationExample.java). - ### Help generation Cloud has a system that assists in querying for command information. diff --git a/mkdocs.yml b/mkdocs.yml index 74d5be4..e03891e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,9 +14,9 @@ nav: - cloud-annotations: annotations/index.md - cloud-kotlin: - cloud-kotlin: kotlin/index.md - - Annotations: kotlin/annotations.md - - Coroutines: kotlin/coroutines.md - - Extensions: kotlin/extensions.md + - annotations: kotlin/annotations.md + - coroutines: kotlin/coroutines.md + - extensions: kotlin/extensions.md - cloud-discord: - cloud-discord: discord/index.md - cloud-javacord: discord/javacord.md @@ -35,9 +35,12 @@ nav: - cloud-neoforge: minecraft/neoforge.md - cloud-spring: - cloud-spring: https://github.com/incendo/cloud-spring + - cloud-processors: + - confirmation: https://github.com/Incendo/cloud-processors/tree/master/cloud-processors-confirmation + - cooldown: https://github.com/Incendo/cloud-processors/tree/master/cloud-processors-cooldown + - requirements: https://github.com/incendo/cloud-requirements - Other: - cloud-irc: other/irc.md - - cloud-requirements: https://github.com/incendo/cloud-requirements theme: name: material features: