mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Fixed exception thrown by commands with multiple spaces between arguments.
This commit is contained in:
parent
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) {
|
||||||
|
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;
|
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++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user