Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2025-01-11 15:41:14 +01:00
Fix up console tab-completion again.
Dieser Commit ist enthalten in:
Ursprung
6c27ac9576
Commit
a98fcc28fe
@ -52,10 +52,15 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Comm
|
|||||||
.appName("Velocity")
|
.appName("Velocity")
|
||||||
.completer((reader, parsedLine, list) -> {
|
.completer((reader, parsedLine, list) -> {
|
||||||
try {
|
try {
|
||||||
|
boolean isCommand = parsedLine.line().indexOf(' ') == -1;
|
||||||
Optional<List<String>> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line());
|
Optional<List<String>> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line());
|
||||||
o.ifPresent(offers -> {
|
o.ifPresent(offers -> {
|
||||||
for (String offer : offers) {
|
for (String offer : offers) {
|
||||||
list.add(new Candidate(offer.substring(1)));
|
if (isCommand) {
|
||||||
|
list.add(new Candidate(offer.substring(1)));
|
||||||
|
} else {
|
||||||
|
list.add(new Candidate(offer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren