Commit Graph

304 Commits

Author SHA1 Message Date
chickeneer 79c39903e7 Revert "Merge pull request #439 from benwoo1110/fix/tab-complete-spam"
This fix has side-effects where secondary command aliases do not fully
use the commandcompletion - alternative solutions are being investigated

This reverts commit 6c8bb2620c, reversing
changes made to 01d900efd8.
2025-11-20 23:20:25 -06:00
Ben Woo 0d89c8f8ea BaseCommand should only fulfill tab complete of its own scope 2025-10-15 20:03:06 +08:00
chickeneer c9b808ec49 Merge pull request #432 from benwoo1110/feat/consumes-rest
Implement `@ConsumesRest` annotation
2025-04-12 17:27:20 -05:00
chickeneer 85829acc41 Merge pull request #429 from benwoo1110/feat/recursive-annotations
Add support for getting annotation from parent class/method/parameter
2025-04-12 17:27:08 -05:00
chickeneer 5a5a31c483 Rename method to getAnnotationFromParentParameters to match other methods 2025-04-12 17:26:50 -05:00
Ben Woo 3bd89c6902 Make LogLevel enum public to allow overriding of log method in CommandManager (#433) 2025-04-12 10:34:03 -05:00
chickeneer ddb827e5b2 Rework subclass unusable constructor logging #428
Users should only need to know information about unusable constructors
if the subclass subcommand doesn't successfully register.
Theory being that the constructor could exist for other purposes
2025-04-12 10:09:44 -05:00
Ben Woo 94815618d1 Implement @ConsumesRest annotation 2025-04-09 13:36:50 +08:00
Ben Woo e3c16dc16d Add support for getting annotation from parent class/method/parameter 2025-04-06 17:10:17 +08:00
Ben Woo 8cc4aa0115 Fix instantiate subclass if constructor parameter is the command's type 2025-04-06 11:50:00 +08:00
chickeneer 8631777bd1 Don't blindly return input argument as a completion value #417
This is attempting to prevent the input being fed back in
as a completion value when it shouldn't. An empty collection
should be equivalent to completing to the input.
2025-02-22 13:02:44 -06:00
chickeneer 6629dc2f46 Add support for both AND and OR permission checking 2025-02-22 11:12:38 -06:00
Vaan1310 25e692eb50 Feature/pipe or permissions (#418)
* Add pipe OR handling for permissions
2025-02-22 10:28:34 -06:00
Alien0-7 461090c1c8 Italian translation (#398)
* Italian translation

Italian translation

* add italian translation
2023-08-02 11:19:10 -05:00
Christopher Nethercott fa29b4de22 Add deregister ability to completions and contexts (#364)
* feat: add deregister methods to completions and dependencies

* fix: change unregister to deregister

* feat: add javadocs to deregisterCompleition

* fix: add throws to javadocs for dependency methods

* fix: missing negation thanks @JOO200

* fix: change deregister -> unregister

* Fix missed rename of deregister to unregister

---------

Co-authored-by: chickeneer <emcchickeneer@gmail.com>
2023-04-02 16:47:44 -05:00
chickeneer e9ca4fcd65 Change valid name checking to a configurable predicate #382
I see the value in allowing acf users to disable the valid name check.
I think others may want to go a step further and create their own
valid name verification. Those that want to truly accept all names can simply
do `CommandManager#setValidNamePredicate(name -> true)` with the new API.
Another solution I considered was having users override the isValidName method
on their CommandManager, but this functionality seemed more friendly.
2023-04-02 16:41:26 -05:00
AlexProgrammerDE 905d5406ec Add allow illegal name manager option 2023-04-02 06:52:44 -05:00
chickeneer 5afde372a2 leanup lastCommandOperationContext after command has executed #337
This is to deter acf from holding onto references of context
objects which would otherwise be garbage collected post execution
2022-11-13 18:14:52 -06:00
chickeneer 1f14cbc079 Translate CommandCompletion #377
Yes, people should register a completion so it is per-issuer but non-registered
static completions would benefit from the replacements system
2022-11-05 18:31:24 -05:00
chickeneer c35e45477e Strings should only consume rest when they are the last parameter
This fixes a brigadier issue with strings being automatically greedy
2022-07-31 10:08:24 -05:00
chickeneer 348f8fb4c9 Add korean to list of supported languages 2022-07-30 20:08:03 -05:00
chickeneer 4fa0d8ee32 Fix a bug with command completions generations for some subcommands 2022-02-07 18:36:08 -06:00
JOO200 1c1a39ec8f Use every subcommand for command completions 2022-02-02 23:46:10 -06:00
chickeneer 4d3b0192fc Miscellaneous grammar improvements 2021-12-21 20:46:53 -06:00
chickeneer 3295b82df6 Remove redundant inspection suppressions 2021-12-21 20:46:36 -06:00
chickeneer 59de061bea Remove extra imports 2021-12-21 20:38:14 -06:00
chickeneer 1124e8d431 Update various dependencies 2021-12-21 12:27:43 -06:00
Alberto Migliorato 24d97bb3eb Added Velocity 3.0.x support 2021-09-13 16:28:54 +02:00
willies952002 38b45d7651 Handle numbers in Hexadecimal (0x#) and Binary (0b#) Notation (#318) 2021-08-29 18:20:25 -05:00
Gk0Wk 533f3956a3 Add Chinese(Simplified) language support. 2021-08-29 17:55:40 -05:00
Pablo Herrera 907944f481 Autocomplete defaults when no completion is set (#338) 2021-08-29 17:44:32 -05:00
MapleHuang 69f297260b Add Chinese(Traditional) language support. (#333)
* Add Chinese(Simplified) language support.
* Add Chinese(Traditional) language support.

Co-authored-by: Gk0Wk <nmg_wk@yeah.net>
2021-08-29 17:38:47 -05:00
Edson Passos f033dd9541 Adds a new pattern for CommandReplacements: %{<key>} (#313) 2021-02-05 12:19:57 -05:00
Edson Passos 91e720011e Unwraps InvocationTargetException (#315)
This exception is just a wrapper for the one thrown on invoked methods
2021-02-04 17:28:36 -05:00
Stijn Bannink 3dfee40c57 Add Dutch translation (#304)
Co-authored-by: DarkEyeDragon <joshua.tack@student.vives.be>
2021-01-26 13:16:46 -05:00
JOO200 20aee6a59e exception check for CompletionStage instead of CompletableFuture (#309) 2021-01-26 13:15:18 -05:00
JOO200 46f689de94 Add name annotation for parameters (#272)
Co-authored-by: Daniel Ennis <aikar@aikar.co>
2020-09-24 22:19:37 -04:00
William Braeckman a26babd6d8 Fix issue #288 (#289) 2020-09-24 22:00:33 -04:00
MiniDigger 9452873d13 Add initial brigadier support (implements #77) (#153)
Co-authored-by: Aikar <aikar@aikar.co>
2020-08-13 20:40:06 -04:00
JOO200 9a04899978 Fix CommandCompletionContext.getResolvedArg (#266) 2020-08-13 18:36:54 -04:00
JOO200 97cd56cb93 Bugfix @Values: Completion with null value will create a NPE (#282) 2020-08-13 18:35:58 -04:00
ken_kentan 843c2a92f4 Added japanese language (#265) 2020-05-16 23:16:36 -04:00
Aikar 1eddc2cb8b Clean up build scripts and rework shading/relocation
ACF deps such as timings lib and expiring map will now properly
be relocated into ACF.

This will avoid version conflicts with ExpiringMap and TimingsLib

Sadly, because locales is an exposed API, we can not relocate locales...

It will still be on plugins to add the locales relocation themselves.
Will update wiki to document this.

also updated maven plugins to newest versions, minus surefire, as
3.0 doesn't work with current setup. Went to latest 2.x there.

Got rid of a lot of duplicated shade configuration stuff across
submodules too.
2020-04-26 17:43:08 -04:00
JOO200 81dc6e267b Don't allow infinite recursive annotations (#258) 2020-04-18 18:41:22 -04:00
Omer Oreg 0b717ba9c0 Made ShowCommandHelp constructors public
This makes it so you can throw the exception from outside the package.
2020-04-12 13:21:44 -04:00
portlek 3a3734730c turkish language support 2020-04-12 13:19:35 -04:00
Hasan Demirtaş 5953e6a99e toLowerCase method with Locale.ENGLISH parameter.
Fixes #255
2020-04-12 13:19:35 -04:00
Tim Hagemann 2ba6895e0c Specifically ignore annotations in java package for meta-annotations
There's no world in which a java annotation contains one of the
command annotations and may only lead to infinite recursion.
2020-04-06 10:36:31 -04:00
Tim Hagemann 667dfec904 Support simple meta-annotations
This adds basic support for meta-annotations for commands and
parameters and allows users to create their own custom annotations
combining certain existing annotations and values. For example, a user
 can now define their own `CustomAnnotation` which combines a
condition and a flag:

```java
@Conditions("conditionname:confitionconfig")
@Flags("flagconfig=flagvalue")
public @interface CustomAnnotation {}
```
(Necessary `@Retention` and `@Target` ignore for brevity)
And use it just like they would normally.

This works by recursively going through the annotations, instead of
just looking at the root level. The reason most existing annotations
had to be touched is for them to be allowed on other annotations as
most of them were restricted to method or fields.

Currently there's no limit on nesting because if the user wants to
nest it to obscure levels - so be it. We could decide to limit this at
 some point to prevent users from shooting themselves in the foot if
that's necessary.

`@Dependency` and was specifically ignored as I don't think it makes
sense for that to be supported in this use case.

Relates to: #89
2020-04-06 10:36:31 -04:00
JOO200 eb7064f7c4 Exception handling: Handle CompletionException like ExecutionException 2020-04-06 10:34:49 -04:00