Commit graph

514 commits

Author SHA1 Message Date
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
Alexander Söderberg
81a452041b
📚 Add more documentation 2021-01-01 22:30:22 +01:00
Alexander Söderberg
550855ece3
📚 Add glossary and document literals. 2021-01-01 04:59:52 +01:00
Alexander Söderberg
00c63b7c0c
📚 Add some information about the command manager 2021-01-01 04:35:03 +01:00
Alexander Söderberg
dd3ad50dda
📚 Fix TOC placement 2021-01-01 04:00:01 +01:00
dependabot[bot]
939b6d26d7 ⬆️ Bump org.jetbrains.kotlin.jvm from 1.4.21 to 1.4.21-2
Bumps org.jetbrains.kotlin.jvm from 1.4.21 to 1.4.21-2.

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-01 00:38:44 +01:00
Alexander Söderberg
2b2bba9d2d
📚 index -> README 2020-12-30 23:13:04 +01:00
Alexander Söderberg
56ae3b8270
Update docs.yml 2020-12-30 23:02:23 +01:00
Alexander Söderberg
6c6bcb13b0
Create docs.yml 2020-12-30 23:00:41 +01:00
Alexander Söderberg
c8158894e0 Set theme jekyll-theme-minimal 2020-12-30 22:52:49 +01:00
Alexander Söderberg
7efe7466a1
📚 Add documentation structure. 2020-12-30 22:50:32 +01:00
Alexander Söderberg
83edf839e3 :docs: Add missing stuff to changelog 2020-12-18 19:49:57 +01:00
Alexander Söderberg
c281c49edf 🚀 Prepare for release 2020-12-18 19:49:57 +01:00