diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a04695..b24e1700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added access to the CloudBrigadierManager from Brigadier-enabled command managers - Added parameter injectors - Store currently parsing command argument in the command context + +### Fixed + - Use the correct default range for Double and Float parsers in the StandardParserRegistry ## [1.1.0] - 2020-10-24 diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java index 75765a3f..917e3f69 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java @@ -113,13 +113,13 @@ public final class StandardParserRegistry implements ParserRegistry { )); this.registerParserSupplier(TypeToken.get(Float.class), options -> new FloatArgument.FloatParser<>( - (float) options.get(StandardParameters.RANGE_MIN, Float.MIN_VALUE), - (float) options.get(StandardParameters.RANGE_MAX, Float.MAX_VALUE) + (float) options.get(StandardParameters.RANGE_MIN, Float.NEGATIVE_INFINITY), + (float) options.get(StandardParameters.RANGE_MAX, Float.POSITIVE_INFINITY) )); this.registerParserSupplier(TypeToken.get(Double.class), options -> new DoubleArgument.DoubleParser<>( - (double) options.get(StandardParameters.RANGE_MIN, Double.MIN_VALUE), - (double) options.get(StandardParameters.RANGE_MAX, Double.MAX_VALUE) + (double) options.get(StandardParameters.RANGE_MIN, Double.NEGATIVE_INFINITY), + (double) options.get(StandardParameters.RANGE_MAX, Double.POSITIVE_INFINITY) )); this.registerParserSupplier(TypeToken.get(Character.class), options -> new CharArgument.CharacterParser<>()); this.registerParserSupplier(TypeToken.get(String[].class), options -> new StringArrayArgument.StringArrayParser<>());