core: Improvements to number arguments (#255)

This commit is contained in:
Jason 2021-04-28 15:18:33 -07:00 committed by Jason
parent 343be0bf67
commit e109e639a1
8 changed files with 579 additions and 289 deletions

View file

@ -71,14 +71,14 @@ public final class LocationCoordinateParser<C> implements ArgumentParser<C, Loca
try {
coordinate = input.isEmpty() ? 0 : Double.parseDouble(input);
} catch (final Exception e) {
return ArgumentParseResult.failure(
new DoubleArgument.DoubleParseException(
input,
Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY,
commandContext
)
);
return ArgumentParseResult.failure(new DoubleArgument.DoubleParseException(
input,
new DoubleArgument.DoubleParser<>(
DoubleArgument.DoubleParser.DEFAULT_MINIMUM,
DoubleArgument.DoubleParser.DEFAULT_MAXIMUM
),
commandContext
));
}
inputQueue.remove();