mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 11:29:35 +00:00
Update buildscript & apply automatic formatting rules
This commit is contained in:
1 parent
a7683b885d
commit
f7a900e910
173 files changed
+4581
-5321
No files matched your search
@@ -1,9 +1,9 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
public class OptionIntegerField extends OptionTextField
|
||||
{
|
||||
public class OptionIntegerField extends OptionTextField {
|
||||
public final int min;
|
||||
public final int max;
|
||||
|
||||
public OptionIntegerField(String name, int min, int max) {
|
||||
super(name);
|
||||
this.min = min;
|
||||
@@ -16,22 +16,19 @@ public class OptionIntegerField extends OptionTextField
|
||||
|
||||
@Override
|
||||
public boolean isValidInput(String s) {
|
||||
if(s.length() == 0)
|
||||
return true;
|
||||
if (s.length() == 0) return true;
|
||||
|
||||
try {
|
||||
Integer.parseInt(s);
|
||||
return true;
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
} catch (NumberFormatException nfe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if(s.length() == 0 || !isValidInput(s))
|
||||
return false;
|
||||
if (s.length() == 0 || !isValidInput(s)) return false;
|
||||
|
||||
int i = Integer.parseInt(s);
|
||||
return i >= min && i <= max;
|
||||
|
||||
Reference in new issue
Block a user