Commit graph

261 commits

Author SHA1 Message Date
jmp
6ffee9d04f Make changes from PR comments 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
37e0b4e91b 📚 Change false to true in method javadoc 2020-10-24 19:52:44 +02:00
Alexander Söderberg
65b7cb6c69 🔥 Fix super important issues 2020-10-24 19:52:44 +02:00
Alexander Söderberg
bd19e1be56 Make the flag parser smarter
It will now allow multiple presence flag aliases to be joined into a single flag, such that `-a -b -c <=> -abc`.

This fixes #75
2020-10-24 19:52:44 +02:00
Alexander Söderberg
da0d586e52 📚 Add missing @Since annotations 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
ad3ca86f42 Add a lockable command manager
This will be used for Sponge & Fabric, that both require command registration to happen (at latest) in specific events. This way we lock writing after that event has occurred.

As a side effect, we're able to collect & merge all commands before registering them to the platform, which means we don't have to hackily force-inject duplicate commands.
2020-10-24 19:52:44 +02:00
jmp
15c6c8a2a1 🐛 Suggest the right amount of arguments with >1 requestedArgumentCount 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
Alexander Söderberg
366c4f2ce5 Add an adventure text colour parser 2020-10-24 19:52:44 +02:00
dependabot[bot]
fadd9578ec ⬆️ Bump jmh-generator-annprocess from 1.25.2 to 1.26
Bumps jmh-generator-annprocess from 1.25.2 to 1.26.

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-23 22:44:16 +02:00
Jason
c051ff20df 🐛 Fix wrong suggestions following an invalid literal (#72)
*  Add a test for suggestions after an invalid literal

* 🐛 Fix wrong suggestions following an invalid literal

* 📚 Document literal suggestion fix in CHANGELOG

Co-authored-by: Alexander Söderberg <sauilitired@gmail.com>
2020-10-19 10:03:56 +02:00
Alexander Söderberg
27d228cb4c Implement PR comments 2020-10-19 10:03:56 +02:00
Alexander Söderberg
720019b508 🐛 Fixed quoted parsing in StringArgument 2020-10-19 10:03:56 +02:00
jmp
9bfb0f17d6 Use the correct failure reason for quoted StringArguments 2020-10-19 10:03:56 +02:00
Alexander Söderberg
6c63b47e5e
🐛 Fix multiple chained optionals not working correctly (#73)
* 🐛 Fix multiple chained optionals not working correctly

There is a problem where the child arguments never forwarded their commands correctly. This will now fix itself when necessary.

* 📚 Add CHANGELOG entry for change
2020-10-18 21:36:58 +02:00
Alexander Söderberg
de0666aa73 📚 Improve the CommandManager documentation 2020-10-17 19:03:52 +02:00
Alexander Söderberg
fd0658d320
🐛 Fix number suggestions. Again. 2020-10-14 01:07:56 +02:00
jmp
15526c95ed 🐛 Make number argument suggestions respect minimum 2020-10-13 13:38:12 -07:00
jmp
78796255a2 Only suggest each flag one time 2020-10-13 20:26:39 +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
5f466fcbc0 Fix parsing of flag arguments that start with '-', i.e. a negative integer, add captions for flag argument 2020-10-13 15:07:40 +02:00
Alexander Söderberg
1bc2af8eed
🐛 Fix duplicate caption key names 2020-10-12 18:42:27 +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
0af788fa1d
🐛 Fix issue with permissions
Essentially, when there's an intermediary command and a child command with a variable leading argument, only the permission for the leading argument would be checked. In this case, that permission should only be considered if there's no more input. This fixes #46.
2020-10-12 01:43:50 +02:00
jmp
454ceb318a 🐛 Only print flags once in command syntax 2020-10-11 17:46:28 +02:00
Alexander Söderberg
1f3c3f2bd9
Add command argument preprocessors 2020-10-10 01:24:16 +02:00
Alexander Söderberg
fcd269b6e7
Add String[] args 2020-10-09 20:44:17 +02:00
Alexander Söderberg
16623969ad
🧹 Clean up CommandManager 2020-10-09 20:02:28 +02:00
Alexander Söderberg
423b29ee3c
Clean up StandardCommandSyntaxFormatter and make it easier to extend 2020-10-09 14:26:43 +02:00
Josh Taylor
fdb80b304c
Rename methods (#41) 2020-10-09 13:30:08 +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
Alexander Söderberg
aa572e3533
🐛 Remove rogue print statement 2020-10-08 11:57:13 +02:00
Alexander Söderberg
c4abf4eca3
🐛 Fix float/double arguments 2020-10-07 23:40:48 +02:00
Alexander Söderberg
63dce244aa
🐛 Fix argument flags 2020-10-07 23:28:56 +02:00
jmp
1fa0eead69 Pass manager instance to command builders 2020-10-07 23:11:37 +02:00
jmp
50dd6f0e85 Register the Greedy string annotation mapper 2020-10-07 23:11:37 +02:00
Alexander Söderberg
2aac3980d5 ♻️ Reformat + Update .editorconfig 2020-10-07 22:47:48 +02:00
broccolai
c2b1ec8a11 Make compound argumnets constructor public and fix code style issue 2020-10-06 20:55:48 +02:00
broccolai
caf1cc5b39 Add sender to compound argument mappers 2020-10-06 20:55: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
Alexander Söderberg
c3469706ab
fix-commodore (#27) 2020-10-06 12:39:06 +02:00
jmp
b37706fd97 Respect permissions in help queries 2020-10-05 22:44:37 +01:00
Alexander Söderberg
ec233fcc20
Get rid of some annoying warnings 2020-10-05 16:27:26 +02:00
Alexander Söderberg
a4544a8550
Prevent command arguments from being used in multiple commands
Also get rid of some random annoying warnings.
2020-10-05 16:17:18 +02:00
Alexander Söderberg
b564ecf60d
Allow command context to be retrieved using argument instances 2020-10-05 16:06:15 +02:00
Alexander Söderberg
2067eac600
Show command argument name in flag syntax hint 2020-10-05 15:43:06 +02:00