Commit graph

57 commits

Author SHA1 Message Date
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
Irmo van den Berge
1c7ebe0957 Fix junit test error when named suggestion provider runs before method construction
Parsing should occur in the @BeforeAll or this test fails sporadically

Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
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
Alexander Söderberg
7f013124b2
🎨 @Annotation final -> final @Annotation 2020-10-03 21:40:07 +02:00
Alexander Söderberg
c67619e5da
Add flag support to the annotation system. 2020-10-02 21:08:32 +02:00
Alexander Söderberg
9d47a7c82d
🎨 Change (improve) command context semantics 2020-10-01 13:24:15 +02:00
Alexander Söderberg
26f11e3a7e 🚚 More removal of javax annotations 2020-09-30 10:40:44 +02:00
Alexander Söderberg
e914d04450 Fix dependency graph and replace Guava 2020-09-30 10:40:44 +02:00
Alexander Söderberg
e033ee88db
Update LICENSE text 2020-09-27 23:30:13 +02:00
Alexander Söderberg
c74cda3a0f
🚚 Switch namespace 2020-09-27 23:04:15 +02:00
Alexander Söderberg
64fa3430a9
Add the ability to "hide" commands.
This does not yet change how commands are treated, but allows for this to be implemented in the future.
2020-09-25 02:31:20 +02:00
Alexander Söderberg
c980adac3b
Add command proxies 2020-09-25 02:20:04 +02:00
Alexander Söderberg
3b2ccdca14
Clean up descriptions 2020-09-23 20:55:17 +02:00
Alexander Söderberg
3f59a81836
Add a confirmation system. 2020-09-22 23:03:11 +02:00
Alexander Söderberg
56623160e1
Clean up annotation parsing. 2020-09-22 13:13:01 +02:00
Alexander Söderberg
e72a876037
Allow argument descriptions to be set using the @Argument annotation 2020-09-21 19:51:17 +02:00
Alexander Söderberg
c336a2d7e8
Add named parsers 2020-09-20 21:36:44 +02:00