mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
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.
This commit is contained in:
parent
83f8fa22d2
commit
357d34835f
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue