mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-22 11:45:47 +01:00
Fix removing negative number
This commit is contained in:
parent
58ac82f0d7
commit
dec421ff61
@ -29,12 +29,16 @@ import java.util.function.Predicate;
|
||||
public class IntegerFormatFilter implements Predicate<String> {
|
||||
@Override
|
||||
public boolean test(String s) {
|
||||
if (s.isEmpty()) return true;
|
||||
try {
|
||||
Integer.parseInt(s);
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
try {
|
||||
Integer.parseInt(s + '0');
|
||||
return true;
|
||||
} catch (NumberFormatException e2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user