Implement basic Forge suggestions

This commit is contained in:
Kenzie Togami
2019-05-05 22:49:48 -07:00
committed by Kenzie Togami
parent 8a3e6a12b9
commit 067a570df0
3 changed files with 51 additions and 4 deletions

View File

@ -567,8 +567,9 @@ public final class PlatformCommandManager {
event.setSuggestions(suggestions.stream()
.map(suggestion -> {
int noSlashLength = arguments.length() - 1;
Substring original = suggestion.getReplacedArgument() == split.size()
? Substring.from(arguments, arguments.length() - 1)
? Substring.from(arguments, noSlashLength, noSlashLength)
: split.get(suggestion.getReplacedArgument());
// increase original points by 1, for removed `/` in `parseArgs`
return Substring.wrap(