Commit graph

239 commits

Author SHA1 Message Date
Frank van der Heijden
ffa17b001b Apply .trim() before .isEmpty() check to prevent 0-length splits 2021-07-05 02:56:06 -07:00
broccolai
d5259dfbe4 Add explict this checkstyle rule and fix violations 2021-07-05 02:56:06 -07:00
jmp
956700b310 Remove unused imports 2021-07-05 02:56:06 -07:00
jmp
21fa35a9fc Bump version to 1.5.0-SNAPSHOT 2021-07-05 02:56:06 -07:00
jmp
58f49033ce Use Command instead of TabCompleteEvent on Bukkit 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
3454cbe4da 🚀 1.4.0 release 2021-01-16 08:54:07 +01:00
zml
5dd925a8d1 sponge7: Implement basic command manager for SpongeAPI 7 (#212) 2021-01-16 08:54:07 +01:00
Zach Levis
78b081ccc2 core: Allow attaching a default description to arguments 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
zml
a6f8159410 Expand ability to use Adventure Components in exceptions and metadata (#200)
* cloud-minecraft: Support preserving component error messages

Any exception thrown by an argument parser that is a
ComponentMessageThrowable will now have its component message directly
queried.

* minecraft-extras: Add Component-based description handling for help

* Apply review comments
2021-01-16 08:54:07 +01:00
jmp
12f5c71504 Add missing inputQueue.remove() to TextColorArgument 2021-01-16 08:54:07 +01:00
Jason
fcae5b8637 Add Location2DArgument, mapped to NMS Vec2I (#201) 2021-01-16 08:54:07 +01:00
Alexander Söderberg
9276a919d3 Add keyed values to CommandContext and do some cleanup 2021-01-16 08:54:07 +01:00
Jason
c8fdf22f4b Allow for more easily using translatable components with MinecraftHelp (#197)
*  Allow for more easily using translatable components with MinecraftHelp

* Add missing Javadoc
2021-01-16 08:54:07 +01:00
jmp
8913b2495e 🐛 Transition to AFTER_REGISTRATION even when no commands have been registered 2021-01-16 08:54:07 +01:00
jmp
b848070d57 Use an Object with fields instead of a Map for dependency versions 2021-01-16 08:54:07 +01:00
jmp
f1e467038c Rename vers to versions 2021-01-16 08:54:07 +01:00
jmp
2c188eb130 Convert build scripts to Kotlin
Also added some new tasks to only build/install to maven local certain platforms
`buildMinecraft`, `installMinecraft`, `buildDiscord`, `installDiscord`, `buildIRC`, `installIRC`
2021-01-16 08:54:07 +01:00
jmp
d812ea633a 🐛 Fix suggestions in console (Bukkit/Paper) 2021-01-16 08:54:07 +01:00
jmp
23c0ad77f9 ⬆️ Bump version to 1.4.0-SNAPSHOT 2021-01-16 08:54:07 +01:00
jmp
f7765d8fe9 Minor formatting changes to MinecraftHelp 2021-01-16 08:54:07 +01:00
Irmo van den Berge
df52e99a8b Show 'no results for query' in help when multi-help topic is empty
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Irmo van den Berge
cabb7f426c Add predicate command filter option to the cloud help system
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Irmo van den Berge
b29d1ae5d1 Fix suggestions showing twice on spigot+brigadier
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Alexander Söderberg
c281c49edf 🚀 Prepare for release 2020-12-18 19:49:57 +01:00
Alexander Söderberg
c684c6607f Allow for literals to be combined with a variable arg(#181)
Co-authored-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
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
Irmo van den Berge
5224050c99 Support repeating literals or argument names (#168)
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
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
2f077e03f3 Improve injection 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
broccolai
d656c99601 Move all 1.2.0-SNAPSHOT references to 1.2.0 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
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
544c344f18 📚 Update changelog
Also minor codestyle fixes
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
62ba96ebeb 📦 Update minecraft-extras for adventure-api 4.2.0 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
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