Commit graph

99 commits

Author SHA1 Message Date
Zach Levis
78b081ccc2 core: Allow attaching a default description to arguments 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
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
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
2f077e03f3 Improve injection 2020-12-18 19:49:57 +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
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
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
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
118005978f Also expose the Brigadier manager from the VelocityCommandManager 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
e26d01388d Improve the exception message for LocationArgument 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
6ffee9d04f Make changes from PR comments 2020-10-24 19:52:44 +02:00
Alexander Söderberg
d6ccc1d59b 🧹 Clean up the gradle build scripts a little
Changes:
- Move all dependency versions to a shared file
- Order the projects in settings.gradle
2020-10-24 19:52:44 +02:00
Alexander Söderberg
79aefb05b5 Add LocationArgument to cloud-bukkit (#63)
*  Add LocationArgument to cloud-bukkit

* 🎨 Use the Bukkit CommandSender from the command context in LocationArgument

* 🐛 Fixed quoted parsing in StringArgument

* 📚 Fix code style

Co-authored-by: jmp <jasonpenilla2@me.com>
2020-10-24 19:52:44 +02:00
Alexander Söderberg
1249b74e83 📚 Add since annotations to new classes 2020-10-24 19:52:44 +02:00
jmp
fba29041e6 🎨 Add caption for string "No input was provided" 2020-10-24 19:52:44 +02:00
jmp
c67cc35cf6 🎨 Add captions for Bukkit entity selector arguments 2020-10-24 19:52:44 +02:00
Alexander Söderberg
d6cdeca1c3 📚 Improve the Bukkit and PaperCommandManager documentation 2020-10-17 19:03:52 +02:00
Alexander Söderberg
06a34651bf
🐛 Fix brigadier suggestion building
An offset will be added pointing to the last occurrence of a blank space. This fixes incorrect tab completions for greedy strings
2020-10-13 19:53:01 +02:00
jmp
2fbd90dfee 🐛 Register permissions with Bukkit so commands aren't suggested to players without permission when Brigadier is not used 2020-10-12 13:33:07 -07: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
jmp
378d57964f 🐛 Override build in Material and Enchant arguments 2020-10-11 21:19:32 -07:00
jmp
c3d679d5ec Implement EnchantmentArgument, remove inaccurate brig mappings. 2020-10-10 01:37:17 +02:00
Alexander Söderberg
3763eb40d4
Make MaterialArgument's error message less annoying 2020-10-08 13:26:23 +02:00
Jason
882154a6a8
🐛 Fix async completions (#38)
Co-authored-by: Alexander Söderberg <sauilitired@gmail.com>
2020-10-08 13:12:07 +02:00
jmp
2bad5759c6 🐛 Actually fix double namespaced commands 2020-10-07 23:11:37 +02:00
jmp
eabdfe4243 🐛 Fix double namespaced commands on Bukkit without Brigadier 2020-10-07 23:11:37 +02:00
Alexander Söderberg
4777831ee6 🗑️ Get rid of JLine3 and clean up Velocity 2020-10-07 22:47:48 +02:00
Alexander Söderberg
2aac3980d5 ♻️ Reformat + Update .editorconfig 2020-10-07 22:47:48 +02:00
Alexander Söderberg
aaa6386ca3 Add a system for creating task chains
This will make it easier to use the asynchronous coordinator.
2020-10-06 20:55:34 +02:00
jmp
0caaccb7de 🐛 Also register namespaced commands with Commodore 2020-10-06 20:04:34 +02:00
jmp
d5461d104f 🎨 Move Brig mappings to a common class for Paper and Commodore 2020-10-06 20:04:16 +02:00
Josh Taylor
f1d4529276
Cleanup annotations and remove Cloud Brigs Pair (#32) 2020-10-06 12:40:35 +02:00
Alexander Söderberg
c3469706ab
fix-commodore (#27) 2020-10-06 12:39:06 +02:00
Alexander Söderberg
d6a2062069
Fix annotation order 2020-10-05 17:56:12 +02:00
Alexander Söderberg
5a89f98a25
🐛 Fix BukkitCommandManager capability calculations 2020-10-04 21:18:16 +02:00
Alexander Söderberg
22993a46d7
Improve Bukkit conflict management
Conflicting commands will now obey plugin load order. Brigadier aliases will be created for namespaced aliases. No asynchronous completions will be provided for conflicting commands and will only be provided for the namespaced label. Furthermore, error handling the command tree has been improved and the methods now return a pair, rather than an optional. This means that there's no need to catch and unwrap exceptions and they will be forwarded in the correct form.
2020-10-04 18:32:34 +02:00