Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Do not trim the args for string-based command APIs
Dieser Commit ist enthalten in:
Ursprung
9edbef981c
Commit
29bedf0943
@ -57,7 +57,7 @@ public class VelocityCommandManager implements CommandManager {
|
|||||||
int firstSpace = cmdLine.indexOf(' ');
|
int firstSpace = cmdLine.indexOf(' ');
|
||||||
if (firstSpace != -1) {
|
if (firstSpace != -1) {
|
||||||
alias = cmdLine.substring(0, firstSpace);
|
alias = cmdLine.substring(0, firstSpace);
|
||||||
args = cmdLine.substring(firstSpace).trim();
|
args = cmdLine.substring(firstSpace);
|
||||||
}
|
}
|
||||||
RawCommand command = commands.get(alias.toLowerCase(Locale.ENGLISH));
|
RawCommand command = commands.get(alias.toLowerCase(Locale.ENGLISH));
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
@ -107,7 +107,7 @@ public class VelocityCommandManager implements CommandManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String alias = cmdLine.substring(0, firstSpace);
|
String alias = cmdLine.substring(0, firstSpace);
|
||||||
String args = cmdLine.substring(firstSpace).trim();
|
String args = cmdLine.substring(firstSpace);
|
||||||
RawCommand command = commands.get(alias.toLowerCase(Locale.ENGLISH));
|
RawCommand command = commands.get(alias.toLowerCase(Locale.ENGLISH));
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
// No such command, so we can't offer any tab complete suggestions.
|
// No such command, so we can't offer any tab complete suggestions.
|
||||||
@ -167,7 +167,7 @@ public class VelocityCommandManager implements CommandManager {
|
|||||||
if (line.isEmpty()) {
|
if (line.isEmpty()) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
return line.split(" ", -1);
|
return line.trim().split(" ", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren