Skip to content

Commit

Permalink
Ignore empty lines in SunDamage Config
Browse files Browse the repository at this point in the history
  • Loading branch information
maxanier committed May 13, 2017
1 parent ec66e8d commit 8a886bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/de/teamlapen/vampirism/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ private static void loadConfiguration(boolean saveIfChanged) {
((SundamageRegistry) VampirismAPI.sundamageRegistry()).resetConfiguredSundamgeDims();
String[] sundamageDims = main_config.getStringList("sundamage_dims", CATEGORY_GENERAL, new String[0], "Specify if individual dimensions should have sundamage. Use e.g. '5:1' to enable sundamage for dimension 5 or '5:0' to disable it");
for (String s : sundamageDims) {
if (s.isEmpty()) continue;
String[] t = s.split(":");
if (t.length != 2) {
VampirismMod.log.w(TAG, "Cannot understand sundamage dimension line '%s'. Missing separator", s);
Expand All @@ -112,7 +113,7 @@ private static void loadConfiguration(boolean saveIfChanged) {
boolean type = Integer.valueOf(t[1]) != 0;
((SundamageRegistry) VampirismAPI.sundamageRegistry()).specifyConfiguredSundamageForDim(dim, type);
} catch (NumberFormatException e) {
VampirismMod.log.w(TAG, "Cannot understand sundamge dimension line '%s'. Failed to convert numbers", s);
VampirismMod.log.w(TAG, "Cannot understand sundamage dimension line '%s'. Failed to convert numbers", s);
continue;
}
}
Expand Down

0 comments on commit 8a886bc

Please sign in to comment.