Commit graph

442 commits

Author SHA1 Message Date
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
jmp
f8235a4ed1 ⬆️ Bump version to 1.3.0-SNAPSHOT 2020-12-18 19:49:57 +01:00
broccolai
2bdfc2777a Bump version to 1.3.0-dev 2020-12-18 19:49:57 +01:00
Alexander Söderberg
eb588997f9 🎆 Release 1.2.0 2020-12-07 20:05:45 +01:00
broccolai
d656c99601 Move all 1.2.0-SNAPSHOT references to 1.2.0 2020-12-07 20:05:45 +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
jmp
01d36aecd8 🐛 Fix Commodore registration on Bukkit 2020-12-07 20:05:45 +01:00
Alexander Söderberg
ce8060d276 ⬆️ Bump adventure-api to 4.3.0 2020-12-07 20:05:45 +01:00
jmp
77225274ce Improve Bukkit command registration logic
When a new command is registered, if a command with that name already exists, Bukkit will not register the new command, ie the existing command gets priority.
However, if the already existing command is an alias, it will replaced by the new command.

These changes update cloud to be aware whether or not an existing command is an alias, and that if so, that Bukkit will allow us to have priority for this command.
2020-12-07 20:05:45 +01:00
Alexander Söderberg
070a719165 Try to preserve command sender when getting Brigadier suggestions 2020-12-07 20:05:45 +01:00
jmp
ded94567c6 Add a ManagerSetting to override existing commands 2020-12-07 20:05:45 +01:00
jmp
1ff5a2c4ce 📚 Update changelog
Add back an entry which was accidentally removed, move an entry to the correct location, add missing entries
2020-12-07 20:05:45 +01:00
Jason
9bc2da18a9 🐛 Fix number suggestions when there are following arguments (#122) 2020-12-07 20:05:45 +01:00
jmp
544c344f18 📚 Update changelog
Also minor codestyle fixes
2020-12-07 20:05:45 +01:00
Irmo van den Berge
5b610df013 Fix partial command suggestions when using a suggestion provider
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2020-12-07 20:05:45 +01:00
Irmo van den Berge
8c46471952 Rename CommandContext getOrDefault to getorSupplyDefault
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
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
zml
013d2d61f4 Give CommandManager a registration state (#148)
* Make CommandManager track its availability for registration

This prevents situations where changes to the manager
would result in undefined state in other places.

* Add unsafe registration capability

* Very minor formatting + `@since` tags

* Add changes to changelog

Co-authored-by: Alexander Söderberg <sauilitired@gmail.com>
2020-12-07 20:05:45 +01:00
jmp
65684d0036 🎨 Add stacktrace click and hover events to the default minecraft-extras CommandExecutionException handler 2020-12-07 20:05:45 +01:00
jmp
2cfbdc8415 📦 Use the correct Sponge repo 2020-12-07 20:05:45 +01:00
jmp
62ba96ebeb 📦 Update minecraft-extras for adventure-api 4.2.0 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
Alexander Söderberg
d8f0b1a47e Allow passing a supplier to command context
This fixes #116
2020-12-07 20:05:45 +01:00
jmp
e9134efad6 Add more tests for ambiguous command registration
Also clean up after leaving the Command Tree in an invalid state during tests
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
2f0ded5be6 🐛 Fix registration of command aliases on Bukkit when using Brigadier 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
6d0301d9dd Specify UTF-8 for Javadocs too 2020-12-07 20:05:45 +01:00
jmp
d9735212a8 Specify UTF-8 encoding in build.gradle 2020-12-07 20:05:45 +01:00
jmp
dbdafed273 🐛 Fix Bukkit alias command suggestions without Brigadier 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
a04e3f92cb Allow for use of a BiFunction<C, E, Component> instead of just a Function<E, Component> in MinecraftExceptionHandler 2020-12-07 20:05:45 +01:00
jmp
1193135b8e 📚 Update changelog 2020-12-07 20:05:45 +01:00
jmp
f1cc2689a0 Add a test for ambiguous command registration 2020-12-07 20:05:45 +01:00
jmp
5e27148d82 Throw AmbiguousNodeException for more ambiguous cases 2020-12-07 20:05:45 +01:00
jmp
829c310872 Add a method to CloudBrigadierManager to enable/disable native suggestions for argument types 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
jmp
9a5c674f0d 🐛 Use the correct default values for Double and Float ranges in the StandardParserRegistry 2020-12-07 20:05:45 +01:00
jmp
118005978f Also expose the Brigadier manager from the VelocityCommandManager 2020-12-07 20:05:45 +01:00
Alexander Söderberg
d484b99fc4 Store the currently parsing argument in the command context
This fixes #101
2020-12-07 20:05:45 +01:00
Alexander Söderberg
c2065aabd1 Add parameter injectors (#104) 2020-12-07 20:05:45 +01:00
jmp
e4efffe577 📚 Update changelog 2020-12-07 20:05:45 +01:00
jmp
d0209dc762 Expose the Brigadier manager from Brigadier-enabled command managers 2020-12-07 20:05:45 +01:00
jmp
81e53ed454 🚀 Version bump 2020-12-07 20:05:45 +01:00
jmp
a264605cf0 Use a cropped png for the readme 2020-11-20 03:48:10 +00:00
Julian Staudt
c781d51282 It's a svg file 2020-11-20 03:48:10 +00:00