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:
Kristian Knarvik 2022-11-04 21:31:56 +01:00
parent 10bfd29468
commit 012d1df099

View File

@ -98,7 +98,7 @@ public final class TypeValidationHelper {
*/
private static boolean isPositiveDouble(Object value, CommandSender sender) {
try {
return ConfigHelper.asDouble(value) > 0.0;
return ConfigHelper.asDouble(value) >= 0.0;
} catch (NumberFormatException | NullPointerException exception) {
if (sender != null) {
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_DOUBLE_REQUIRED);
@ -116,7 +116,7 @@ public final class TypeValidationHelper {
*/
private static boolean isPositiveInteger(Object value, CommandSender sender) {
try {
return ConfigHelper.asInt(value) > 0;
return ConfigHelper.asInt(value) >= 0;
} catch (NumberFormatException | NullPointerException exception) {
if (sender != null) {
displayErrorMessage(sender, TranslatableMessage.INPUT_POSITIVE_INTEGER_REQUIRED);