Allow negative numbers

This commit is contained in:
Noel Németh 2022-07-08 01:48:33 +02:00
parent 24ea5bc9f6
commit 0087004183
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ public class ArgumentNumber<T extends Number> extends Argument<T> {
@Override
public @NotNull T parse(CommandReader reader) throws ArgumentSyntaxException {
final char start = reader.getNextChar();
if (start < '0' || start > '9') throw new ArgumentSyntaxException("Numbers cannot start with", start+"", NOT_NUMBER_ERROR);
if ((start < '0' || start > '9') && start != '-') throw new ArgumentSyntaxException("Numbers cannot start with", start+"", NOT_NUMBER_ERROR);
final String input = reader.getWord();
try {
final T value;