Commit graph

71 commits

Author SHA1 Message Date
zml
ed7b7569a8 build: switch to spotless (#355)
* build: switch to spotless

add in some other basic formatting steps that allow for easy
auto-correction

* build: lint text files as well

* chore: remove license headers from package-info files

spotless can't verify these
2022-06-18 22:52:58 -07:00
Jason Penilla
708d11854e Fix import order 2021-12-02 02:04:43 -08:00
Pasqual Koschmieder
526ef2af61 Allow parser parameter annotations for flags as well (#315) 2021-12-02 02:04:43 -08:00
Jason Penilla
4eb3df1f57 Fix error message for unknown parameters in KotlinAnnotatedMethods 2021-12-02 02:04:43 -08:00
Alexander Söderberg
ad80933a20 Feature: Allow argument names to be inferred from parameter names 2021-12-02 02:04:43 -08:00
Jason
3df3560d91 annotations: Also apply builder modifiers from class (#303) 2021-12-02 02:04:43 -08:00
Frank van der Heijden
7a5efbd6da Use AnnotationAccessor 2021-12-02 02:04:43 -08:00
Frank van der Heijden
730e78e212 Make CommandMethod applicable to class 2021-12-02 02:04:43 -08:00
Frank van der Heijden
3e28cc3191 Add @since and CHANGELOG.md entry for flag permissions 2021-12-02 02:04:43 -08:00
Frank van der Heijden
1b7fb2f34c Implement flag permissions 2021-12-02 02:04:43 -08:00
Alexander Söderberg
6871341291 I hate the fact that we started using Checkstyle.
Whose decision was that anyway..?
2021-12-02 02:04:43 -08:00
Alexander Söderberg
5934c2fd3b Add changelog 2021-12-02 02:04:43 -08:00
Alexander Söderberg
7bb5e63dc7 Add support for suspending functions
This also changes CommandExecutionHandler to return futures instead. The old method is still supported, and the new future-returning method will delegate to the old non-returning method.
2021-12-02 02:04:43 -08:00
zml
f7e756e901 annotations: Correct improper TypeToken toString use 2021-07-05 02:56:06 -07:00
Jason
c9ac39ed26 Update build scripts for Gradle 7 (#247)
* fabric: Update Loom to 0.7-SNAPSHOT

* Update to Gradle 7

Switch to CadixDev/licenser
The plugin we were using before does not support Gradle 7, and hasn't been updated in over a year.

* Remove `jcenter()` references

* Move to new JDA repo and bump version

* Use setup-java v2 and Adopt JDK 16 in gh actions

* build: Temporarily add Incendo repo for plugin resolution

Allows building until licenser has a new release

* Import indra plugin classes instead of string applies

* remove space

Co-authored-by: broccolai <me@broccol.ai>
2021-07-05 02:56:06 -07:00
Alexander Söderberg
1600ef16c3
:clock: 2021 let's go!!! 2021-01-16 09:58:46 +01:00
Alexander Söderberg
9550dce5e6 Add access to parameter annotations in the parameter injector 2021-01-16 08:54:07 +01:00
Alexander Söderberg
2cf743c805 Add injection services (#211)
*  Add injection services

* Change dependency scope for Guice
2021-01-16 08:54:07 +01:00
Zach Levis
b38c725dc5 core: Use the ArgumentDescription interface for descriptions
This allows minecraft-extras to provide an implementation that
uses Adventure chat components to represent the description.
2021-01-16 08:54:07 +01:00
Jason
7347ced0db Expose Command/Context from exceptions where possible (#204)
* Expose Command/Context from exceptions where possible

* Update changelog
2021-01-16 08:54:07 +01:00
Alexander Söderberg
94b960a992 🐛 Fix suppression in AnnotationParser 2020-12-18 19:49:57 +01:00
Alexander Söderberg
9ed40a698a Allow interception of command builders based on annotations in AnnotationParser
Fixes #179
2020-12-18 19:49:57 +01:00
Alexander Söderberg
52433a4c3a 🐛 Checkstyle is dumb. 2020-12-18 19:49:57 +01:00
Alexander Söderberg
6cc3a21619 Allow default suggestion providers in @Parser 2020-12-18 19:49:57 +01:00
Alexander Söderberg
e5a35afb8a Add @Parser annotated methods
Fixes #166. Also fixes #180.
2020-12-18 19:49:57 +01:00
zml
1e91273e0e Work towards making CommandMeta typesafe (#173)
Co-authored-by: Alexander Söderberg <sauilitired@gmail.com>
2020-12-18 19:49:57 +01:00
Alexander Söderberg
ab366be24d :sparkes: Add @Suggestions annotated methods 2020-12-18 19:49:57 +01:00
Irmo van den Berge
e0216dec9f Add support for dashes and underscores in annotations parser syntax
Also added a test for the parser, as it was missing

Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2020-12-18 19:49:57 +01:00
jmp
f2f187f58d 🐛 Fix build 2020-12-18 19:49:57 +01:00
Alexander Söderberg
2f077e03f3 Improve injection 2020-12-18 19:49:57 +01:00
jmp
e241420ee9 Throw an exception when trying to parse a static method with the @CommandMethod annotation 2020-12-18 19:49:57 +01:00
Josh Taylor
bd2034db77 Update cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java
Co-authored-by: Alexander Söderberg <Sauilitired@users.noreply.github.com>
2020-12-07 20:05:45 +01:00
Josh Taylor
6c0f47c0bd Update cloud-annotations/src/main/java/cloud/commandframework/annotations/injection/RawArgs.java
Co-authored-by: Alexander Söderberg <Sauilitired@users.noreply.github.com>
2020-12-07 20:05:45 +01:00
Josh Taylor
014715c9e7 Update cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java
Co-authored-by: Alexander Söderberg <Sauilitired@users.noreply.github.com>
2020-12-07 20:05:45 +01:00
broccolai
237eda75ef Reformat project 2020-12-07 20:05:45 +01:00
Irmo van den Berge
9e48a41eab 🐛 Annotations API fix
Annotations API fix failure when a literal name matches an argument name (#143)
2020-12-07 20:05:45 +01:00
jmp
7df6917fe4 Added CommandExecutionException which wraps any exception thrown during the execution of command handlers. Should be handled using CommandManager#registerExceptionHandler, similar to NoSuchCommandException, ArgumentParseException, etc. 2020-12-07 20:05:45 +01:00
jmp
fc1a613463 Allow for use of named suggestion providers in @Flag annotated command method parameters, add methods to FlagContext to work with flag values as optionals 2020-12-07 20:05:45 +01:00
jmp
e6af4e6caa Add a method to get the failure reason of SelectorParseExceptions 2020-12-07 20:05:45 +01:00
jmp
9c9e13e8b8 Allow for use of @Completions annotation with argument types other than String 2020-12-07 20:05:45 +01:00
Alexander Söderberg
c2065aabd1 Add parameter injectors (#104) 2020-12-07 20:05:45 +01:00
Alexander Söderberg
a68bc0bea7 Allow for recursive annotations (#97)
Co-authored-by: Mariell <proximyst@proximyst.com>
2020-10-24 19:52:44 +02:00
Alexander Söderberg
cfac2639ad Add errorprone and fix warnings/errors
The compiler will also treat all warnings as errors from now on.
2020-10-24 19:52:44 +02:00
jmp
c9d4f39612 Allow for class annotations as a default for when an annotation is not present on a method 2020-10-24 19:52:44 +02:00
Alexander Söderberg
3c7bd63f07 Add named suggestion providers
This allows for pre-registration of command suggestion providers, that can then be used in annotated command methods.
2020-10-24 19:52:44 +02:00
Alexander Söderberg
6ab1c8a2e0
Merge pull request #43
*  Add a new caption system to allow for the configuration of…

*  Add caption support to all numerical types

* Add more standard pasres to the registry

* Add default messages for captions

*  Improve captions in core

* Add captions for Bukkit

*  Add FactoryDelegatingCaptionRegistry.java
2020-10-12 18:13:23 +02:00
Alexander Söderberg
1f3c3f2bd9
Add command argument preprocessors 2020-10-10 01:24:16 +02:00
Josh Taylor
fdb80b304c
Rename methods (#41) 2020-10-09 13:30:08 +02:00
Alexander Söderberg
2aac3980d5 ♻️ Reformat + Update .editorconfig 2020-10-07 22:47:48 +02:00
Alexander Söderberg
0fefd40812
🎨 Create separate annotation for command permissions
This allows for compound annotation creation. Though this will need additional changes made to the annotation parser to actually take effect.
2020-10-04 13:52:13 +02:00