Commit graph

526 commits

Author SHA1 Message Date
Alexander Söderberg
77b569d30a
Fix building failure due to license violations.
The HEADER file had not been updated to match the content of LICENSE.
2021-01-16 23:19:28 +01:00
Alexander Söderberg
d3642e3c7d
📚 Fix license and push tag 2021-01-16 10:06:08 +01:00
Alexander Söderberg
d9122d47d0
📚 Update CHANGELOG.md 2021-01-16 09:59:38 +01: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
Zach Levis
7d46e64ed3 Add logical operators to permissions
These operators allow some basic combination of permissions to occur,
which expands what can be easily done with permissions definitions.
2021-01-16 08:54:07 +01:00
p5nbTgip0r
09f8dbd956 🐛 JDA: Fix webhook messages throwing NPE (#214)
* Fix NPE with webhook messages.

Webhook messages would be constructed as `JDAGuildSender`, which calls `Objects.requireNonNull(event.getMember())` however the JDA documentation states that the `getMember()` method will `be null in case of Message being received in a PrivateChannel or isWebhookMessage() returning true.` If the message is a webhook message, a generic `JDACommandSender` instance will be constructed instead of a `JDAGuildSender`

* Add webhook fix to changelog
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
Alexander Söderberg
9550dce5e6 Add access to parameter annotations in the parameter injector 2021-01-16 08:54:07 +01:00
Alexander Söderberg
92f8661b59 📚 Make CHANGELOG less messy and add missing changes 2021-01-16 08:54:07 +01:00
Alexander Söderberg
14baf5b876 📚 Improve CommandSyntaxFormatter documentation 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
Alexander Söderberg
0b6a554946 Implement predicate permissions (#210)
Co-authored-by: Josh Taylor <me@broccol.ai>
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
jmp
fa16fc8ef2 Fix license plugin 2021-01-16 08:54:07 +01:00
Zach Levis
ef85fa9ee9 core: Add CommandFlag-accepting getters to FlagContext
This allows for type-safe access to the collection of available flags.
2021-01-16 08:54:07 +01:00
jmp
2068b5a43c update changelog 2021-01-16 08:54:07 +01:00
jmp
39b94a3df0 Add helper method for flags to MutableCommandBuilder 2021-01-16 08:54:07 +01:00
jmp
47d602fde1 Update Gradle to 6.8 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
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
p5nbTgip0r
fe153f19c1 Adjust JDA example to provide MessageReceivedEvent in commandSender mappers.
This is necessary for the `ChannelArgument` parser to work.
2021-01-16 08:54:07 +01:00
p5nbTgip0r
2723ec13f9 JDA channel argument parsing improvements.
- Ensure that the parsing modes list cannot be empty when constructing `MessageParser`
- Don't proceed if the command context does not have the message event stored
- Don't proceed if the message was not sent in a guild
- Remove `|| modes.size() == 1` check in channel mention parsing
2021-01-16 08:54:07 +01:00
p5nbTgip0r
3a047c1ce0 Add more context keys to JDA preprocessor 2021-01-16 08:54:07 +01:00
p5nbTgip0r
a2796bee04 Fix JDA mentioned user argument parsing if a mention is not given.
If only `ParserMode.MENTION` was set as a parsing mode, the initial check for `input.endsWith(">")` would be bypassed and the input would begin to be parsed like a mention. If the input was less than three characters long then the `substring` calls would give a very ambiguous error along the lines of `begin 2, end X-1, length X`.

This commit fixes this issue by adding a check to make sure the input is an actual user mention. If the input isn't a mention then an exception will be set stating that the sender's input was not a user mention.

In addition, this commit also removes the `modes.size() == 1` check in the mention parser. I'm not sure why this was there to begin with, but I don't think that the input parsing check should be bypassed because only one parsing mode is specified. I settled on a check in the `UserParser` constructor to make sure that the parsing modes list isn't empty in order to ensure that at least one parser mode handles the input.
2021-01-16 08:54:07 +01:00
Alexander Söderberg
bb9bc4e579 Add keyed values to CommandContext and do some cleanup 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
p5nbTgip0r
591f2750c5 Register ChannelArgument and UserArgument as parsers for JDA 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
7eddcd237a typo 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
40e85caf1b build.gradle.kts buildscript{} -> buildSrc/build.gradle.kts 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
Irmo van den Berge
a978adc79f Add support for compound arguments for flags
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
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
4556f12b6d Fix command argument not accepting characters _ and -
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
f09e0ce8f7
📚 Document compound arguments 2021-01-14 11:28:48 +01:00
Alexander Söderberg
788969b24d
📚 Document the parameter injection system 2021-01-14 10:38:41 +01:00
Alexander Söderberg
42812509c5
📚 Document the confirmation system 2021-01-14 09:17:08 +01:00
Alexander Söderberg
e73c9a3baf
📚 Update the project list 2021-01-09 10:35:03 +01:00