mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 19:15:13 +00:00
Unified build script (#175)
* Update build script * Update build script to import fix for shadow in dev and sources artifacts * Update fixed build script to shadow csv dependency in dev jar as well * Moved jitpack * Move new files
This commit is contained in:
1 parent
43b71b1de6
commit
a7ca6c8527
188 files changed
+646
-968
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
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;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public OptionIntegerField(String name) {
|
||||
this(name, Integer.MIN_VALUE, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidInput(String s) {
|
||||
if(s.length() == 0)
|
||||
return true;
|
||||
|
||||
try {
|
||||
Integer.parseInt(s);
|
||||
return true;
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
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