mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
Fix long config (#617)
This commit is contained in:
@@ -932,7 +932,7 @@ public final class LeavesConfig {
|
||||
@Override
|
||||
public void verify(Long old, Long value) throws IllegalArgumentException {
|
||||
if (value <= 0) {
|
||||
throw new IllegalArgumentException("Max nbt size can not be <= 0!");
|
||||
throw new IllegalArgumentException("Max nbt size can not be <= 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,14 @@ public abstract class ConfigValidatorImpl<E> implements ConfigValidator<E> {
|
||||
public Long stringConvert(String value) throws IllegalArgumentException {
|
||||
return Long.parseLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long loadConvert(Object value) throws IllegalArgumentException {
|
||||
if (value instanceof Integer) {
|
||||
return Long.valueOf((Integer) value);
|
||||
}
|
||||
return (Long) value;
|
||||
}
|
||||
}
|
||||
|
||||
public static class StringConfigValidator extends ConfigValidatorImpl<String> {
|
||||
|
||||
Reference in New Issue
Block a user