parent
b7260d318c
commit
b9781f19f0
1 changed files with 13 additions and 1 deletions
|
@ -94,7 +94,7 @@ public abstract class Command2<TC extends ICommand2, TP extends Command2Sender>
|
||||||
helpText[0] = "§6---- Subcommands ----"; //TODO: There may be more to the help text
|
helpText[0] = "§6---- Subcommands ----"; //TODO: There may be more to the help text
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (Iterator<String> iterator = ht.iterator();
|
for (Iterator<String> iterator = ht.iterator();
|
||||||
iterator.hasNext() && i < helpText.length; i++) {
|
iterator.hasNext() && i < helpText.length; i++) {
|
||||||
String e = iterator.next();
|
String e = iterator.next();
|
||||||
helpText[i] = e;
|
helpText[i] = e;
|
||||||
}
|
}
|
||||||
|
@ -221,6 +221,18 @@ public abstract class Command2<TC extends ICommand2, TP extends Command2Sender>
|
||||||
continue;
|
continue;
|
||||||
} else if (Number.class.isAssignableFrom(cl) || cl.isPrimitive()) {
|
} else if (Number.class.isAssignableFrom(cl) || cl.isPrimitive()) {
|
||||||
try {
|
try {
|
||||||
|
if (cl == boolean.class) {
|
||||||
|
params.add(Boolean.parseBoolean(param));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (cl == char.class) {
|
||||||
|
if (param.length() != 1) {
|
||||||
|
sender.sendMessage("§c'" + param + "' is not a character.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.add(param.charAt(0));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
Number n = ChromaUtils.convertNumber(NumberFormat.getInstance().parse(param), (Class<? extends Number>) cl);
|
Number n = ChromaUtils.convertNumber(NumberFormat.getInstance().parse(param), (Class<? extends Number>) cl);
|
||||||
params.add(n);
|
params.add(n);
|
||||||
|
|
Loading…
Reference in a new issue