13
0
geforkt von Mirrors/Paper

fix empty array elements in command arguments

Adjacent spaces caused empty array elements due to how String#split works.
This change removes those empty array elements without modifying anything else.
Adjacent spaces sent by players are removed in PlayerConnection, so this change doesn't affect players.
But it does affect the console, command blocks, Bukkit.dispatchCommand, etc.
Dieser Commit ist enthalten in:
Trigary 2021-06-05 10:29:39 +02:00
Ursprung 83f8fa22d2
Commit 357d34835f

Datei anzeigen

@ -131,7 +131,7 @@ public class SimpleCommandMap implements CommandMap {
*/
@Override
public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException {
String[] args = commandLine.split(" ");
String[] args = org.apache.commons.lang3.StringUtils.split(commandLine, ' '); // Paper - fix adjacent spaces (from console/plugins) causing empty array elements
if (args.length == 0) {
return false;