Skip to content

Commit

Permalink
fix: Fix Balm not accepting integers for float config properties Twel…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Mar 18, 2024
1 parent 2516eae commit 23ae134
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ private <T> void readConfigValues(String parentPath, T instance, ModConfig confi
field.set(instance, doubleValue.floatValue());
} else if (value instanceof Float floatValue) {
field.set(instance, floatValue);
} else if (value instanceof Integer integerValue) {
field.set(instance, integerValue.floatValue());
} else {
logger.error("Invalid config value for " + path + ", expected " + type.getName() + " but got " + value.getClass());
}
Expand All @@ -123,6 +125,8 @@ private <T> void readConfigValues(String parentPath, T instance, ModConfig confi
field.set(instance, doubleValue);
} else if (value instanceof Float floatValue) {
field.set(instance, floatValue.doubleValue());
} else if (value instanceof Integer integerValue) {
field.set(instance, integerValue.doubleValue());
} else {
logger.error("Invalid config value for " + path + ", expected " + type.getName() + " but got " + value.getClass());
}
Expand Down

0 comments on commit 23ae134

Please sign in to comment.