Fixed values being able to go over number limit
This commit is contained in:
@@ -52,7 +52,12 @@ public class ConfigBase
|
||||
*/
|
||||
public static final List<Class<?>> acceptableInputs = new ArrayList<Class<?>>() {{
|
||||
add(Boolean.class);
|
||||
add(Number.class); // Contains: Byte, Short, Int, Long, Double, Float0
|
||||
add(Byte.class);
|
||||
add(Integer.class);
|
||||
add(Double.class);
|
||||
add(Short.class);
|
||||
add(Long.class);
|
||||
add(Float.class);
|
||||
add(String.class);
|
||||
|
||||
// TODO[CONFIG]: Check the type of these is valid
|
||||
|
||||
@@ -207,7 +207,7 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
if (this.configBase.disableMinMax)
|
||||
return 0;
|
||||
|
||||
if (value.getClass() != this.value.getClass()) // If the 2 variables aren't the same type then it will be invalid
|
||||
if (value == null || this.value == null || value.getClass() != this.value.getClass()) // If the 2 variables aren't the same type then it will be invalid
|
||||
return 2;
|
||||
if (Number.class.isAssignableFrom(value.getClass())) { // Only check min max if it is a number
|
||||
if (max != null && NumberUtil.greaterThan((Number) value, (Number) max))
|
||||
|
||||
Reference in New Issue
Block a user