10000 Add the option to retrieve raw arguments by DerEchtePilz · Pull Request #459 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content

Add the option to retrieve raw arguments #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jul 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3c7aa7f
Add the option to retrieve raw arguments
DerEchtePilz Jun 8, 2023
4baa0a4
Fix SuggestionsBranch.java. Change String[]::new to new String[0]
DerEchtePilz Jun 8, 2023
b186494
Fix CommandArgument.java
DerEchtePilz Jun 8, 2023
b50afe8
Merge dev/dev into dev/raw-argument-input
DerEchtePilz Jun 15, 2023
8981a2a
Add tests for retrieving raw arguments
DerEchtePilz Jun 15, 2023
6cf237d
Move raw argument creation into CommandAPIHandler
DerEchtePilz Jun 15, 2023
c24d084
Fix raw argument tests failing when using the ChatComponentArgument o…
JorelAli Jun 15, 2023
46deb77
Add empty documentation page
DerEchtePilz Jun 17, 2023
bafaacf
Add documentation (1)
DerEchtePilz Jun 23, 2023
ff7fcc1
Add documentation (2)
DerEchtePilz Jun 27, 2023
a0cfc2d
Modify CommandArguments to remove deprecations and add getOrDefault m…
DerEchtePilz Jun 28, 2023
eb431b0
Address some code review
DerEchtePilz Jun 30, 2023
9fe5879
Fix markdownlint issues
DerEchtePilz Jun 30, 2023
d0b59d3
Make sure commandarguments.md lists every method
DerEchtePilz Jun 30, 2023
3af41ab
Link CommandArguments references to commandarguments.md
DerEchtePilz Jun 30, 2023
f67a012
Merge branch 'dev/dev' into dev/raw-argument-input
DerEchtePilz Jun 30, 2023
5643f0d
Update intro.md, optional_arguments.md and upgrading.md
DerEchtePilz Jul 1, 2023
6ebf8e1
Remove 'What terms are used' section, refactor 'Access the inner stru…
DerEchtePilz Jul 3, 2023
e2fd959
Improve explanation for unsafe arguments
DerEchtePilz Jul 4, 2023
a3db5ea
Add an explanation of raw arguments to the JavaDocs for methods deali…
DerEchtePilz Jul 4, 2023
c8c1de6
Remove unnecessary sentence from commandarguments.md
DerEchtePilz Jul 4, 2023
7ff5cf6
Convert CommandArguments.java into a record
DerEchtePilz Jul 4, 2023
c5916bb
Replace usage of CommandArguments#getFullInput in CommandAPIExecutor …
DerEchtePilz Jul 4, 2023
b1104a3
Make Java examples use the node name to access arguments
DerEchtePilz Jul 5, 2023
3f096b8
Make Kotlin examples use the node name to access arguments
DerEchtePilz Jul 5, 2023
cae4298
Make Kotlin DSL examples use the node name to access arguments
DerEchtePilz Jul 5, 2023
ec80dc5
Fix Bukkit Core dependencies
DerEchtePilz Jul 5, 2023
d05c9eb
Add documentation examples
DerEchtePilz Jul 5, 2023
0641607
Update global changelog
DerEchtePilz Jul 5, 2023
4753950
Merge branch 'dev/dev' into dev/raw-argument-input
DerEchtePilz Jul 5, 2023
897739d
Add JavaDocs to record parameters
DerEchtePilz Jul 12, 2023
ad1621d
Merge branch 'dev/raw-argument-input' of https://github.com/JorelAli/…
DerEchtePilz Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix raw argument tests failing when using the ChatComponentArgument o…
…r AdventureChatComponentArgument
  • Loading branch information
JorelAli committed Jun 15, 2023
commit c24d0848d822be9aa310b55cf9aa853597641d2c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ public static <CommandSource> String getRawArgumentInput(CommandContext<CommandS
// TODO: Issue #310: Parsing this argument via /execute run <blah> doesn't have the value in
// the arguments for this command context (most likely because it's a redirected command).
// We need to figure out how to handle this case.
if(parsedArgument != null) {
if (parsedArgument != null) {
// Sanity check: See https://github.com/JorelAli/CommandAPI/wiki/Implementation-details#chatcomponentargument-raw-arguments
StringRange range = parsedArgument.getRange();
return cmdCtx.getInput().substring(range.getStart(), range.getEnd());
if (range.getEnd() > cmdCtx.getInput().length()) {
range = StringRange.between(range.getStart(), cmdCtx.getInput().length());
}
return range.get(cmdCtx.getInput());
} else {
return "";
}
Expand Down
0