Allows 0 for positive integers and doubles
It wasn't possible to set extra enchantment chance to 0. This fixes that problem.
This commit is contained in:
parent
10bfd29468
commit
012d1df099
@ -98,7 +98,7 @@ public final class TypeValidationHelper {
|
|||||||
*/
|
*/
|
||||||
private static boolean isPositiveDouble(Object value, CommandSender sender) {
|
private static boolean isPositiveDouble(Object value, CommandSender sender) {
|
||||||
try {
|
try {
|
||||||
return ConfigHelper.asDouble(value) > 0.0;
|
return ConfigHelper.asDouble(value) >= 0.0;
|
||||||
} catch (NumberFormatException | NullPointerException exception) {
|
} catch (NumberFormatException | NullPointerException exception) {
|
||||||
if (sender != null) {
|
if (sender != null) {
|
||||||
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_DOUBLE_REQUIRED);
|
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_DOUBLE_REQUIRED);
|
||||||
@ -116,7 +116,7 @@ public final class TypeValidationHelper {
|
|||||||
*/
|
*/
|
||||||
private static boolean isPositiveInteger(Object value, CommandSender sender) {
|
private static boolean isPositiveInteger(Object value, CommandSender sender) {
|
||||||
try {
|
try {
|
||||||
return ConfigHelper.asInt(value) > 0;
|
return ConfigHelper.asInt(value) >= 0;
|
||||||
} catch (NumberFormatException | NullPointerException exception) {
|
} catch (NumberFormatException | NullPointerException exception) {
|
||||||
if (sender != null) {
|
if (sender != null) {
|
||||||
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_INTEGER_REQUIRED);
|
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_INTEGER_REQUIRED);
|
||||||
|
Loading…
Reference in New Issue
Block a user