fix config crash with older versions of forge
This commit is contained in:
@@ -41,21 +41,21 @@ public class ConfigBase {
|
|||||||
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
||||||
try {
|
try {
|
||||||
Property prop = config.get(annot.category(), annot.key(), field.getBoolean(this));
|
Property prop = config.get(annot.category(), annot.key(), field.getBoolean(this));
|
||||||
field.setBoolean(this, prop.getBoolean());
|
field.setBoolean(this, prop.getBoolean(field.getBoolean(this)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
} else if (field.getType().equals(OptionInteger.class)) {
|
} else if (field.getType().equals(OptionInteger.class)) {
|
||||||
try {
|
try {
|
||||||
OptionInteger option = (OptionInteger) field.get(this);
|
OptionInteger option = (OptionInteger) field.get(this);
|
||||||
Property prop = config.get(annot.category(), annot.key(), option.value);
|
Property prop = config.get(annot.category(), annot.key(), option.value);
|
||||||
option.value = prop.getInt();
|
option.value = prop.getInt(option.value);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
} else if (field.getType().equals(OptionDouble.class)) {
|
} else if (field.getType().equals(OptionDouble.class)) {
|
||||||
try {
|
try {
|
||||||
OptionDouble option = (OptionDouble) field.get(this);
|
OptionDouble option = (OptionDouble) field.get(this);
|
||||||
Property prop = config.get(annot.category(), annot.key(), option.value);
|
Property prop = config.get(annot.category(), annot.key(), option.value);
|
||||||
option.value = prop.getDouble();
|
option.value = prop.getDouble(option.value);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user