aboutsummaryrefslogtreecommitdiff
path: root/common/src/main
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2023-06-17 09:21:03 +0100
committerisXander <xandersmith2008@gmail.com>2023-06-17 09:28:52 +0100
commit57664379caea94e41ce2adeef772d7e3d1007757 (patch)
treee2a2d3fb969cd8e2f4af72da11e2450a277a7aeb /common/src/main
parentd75d72f4e19ab57e745f21aac8e99d5246d04317 (diff)
downloadYetAnotherConfigLib-57664379caea94e41ce2adeef772d7e3d1007757.tar.gz
YetAnotherConfigLib-57664379caea94e41ce2adeef772d7e3d1007757.tar.bz2
YetAnotherConfigLib-57664379caea94e41ce2adeef772d7e3d1007757.zip
Fix IntegerFieldController and LongFieldController not allowing negative numbers.
Diffstat (limited to 'common/src/main')
-rw-r--r--common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/IntegerFieldController.java2
-rw-r--r--common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/LongFieldController.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/IntegerFieldController.java b/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/IntegerFieldController.java
index 5c15a2e..445e984 100644
--- a/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/IntegerFieldController.java
+++ b/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/IntegerFieldController.java
@@ -64,7 +64,7 @@ public class IntegerFieldController extends NumberFieldController<Integer> {
@Override
public boolean isInputValid(String input) {
- return input.matches("\\d+|-|");
+ return input.matches("(?:-?\\d+|)");
}
/**
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/LongFieldController.java b/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/LongFieldController.java
index b36b0f3..fe2ef2c 100644
--- a/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/LongFieldController.java
+++ b/common/src/main/java/dev/isxander/yacl3/gui/controllers/string/number/LongFieldController.java
@@ -64,7 +64,7 @@ public class LongFieldController extends NumberFieldController<Long> {
@Override
public boolean isInputValid(String input) {
- return input.matches("\\d+|-|");
+ return input.matches("(?:-?\\d+|)");
}
/**