Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-13 22:50:06 +01:00
Fixed exception thrown by commands with multiple spaces between arguments.
Dieser Commit ist enthalten in:
Ursprung
3f2afa9581
Commit
3c92fbe910
@ -20,6 +20,7 @@ package com.sk89q.minecraft.util.commands;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class CommandContext {
|
public class CommandContext {
|
||||||
protected String[] args;
|
protected String[] args;
|
||||||
@ -30,8 +31,15 @@ public class CommandContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CommandContext(String[] args) {
|
public CommandContext(String[] args) {
|
||||||
int i = 1;
|
ArrayList<String> splitArgs = new ArrayList<String>();
|
||||||
|
for (String arg : args) {
|
||||||
|
if (!arg.equals(null) && !arg.equals("")) {
|
||||||
|
splitArgs.add(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args = splitArgs.toArray(new String[0]);
|
||||||
|
|
||||||
|
int i = 1;
|
||||||
for (; i < args.length; i++) {
|
for (; i < args.length; i++) {
|
||||||
if (args[i].charAt(0) == '-' && args[i].matches("^-[a-zA-Z]+$")) {
|
if (args[i].charAt(0) == '-' && args[i].matches("^-[a-zA-Z]+$")) {
|
||||||
for (int k = 1; k < args[i].length(); k++) {
|
for (int k = 1; k < args[i].length(); k++) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren