Skip to content

Commit

Permalink
Fixed config crashing. Closes #451, #450
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Feb 1, 2024
1 parent 8d22fab commit 409f248
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions common/src/main/java/sereneseasons/config/SeasonsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class SeasonsConfig extends glitchcore.config.Config
// Snow melting settings
private List<Config> seasonProperties;

private Supplier<ImmutableMap<Season.SubSeason, SeasonProperties>> seasonPropertiesMapper;
private Supplier<Map<Season.SubSeason, SeasonProperties>> seasonPropertiesMapper;


public SeasonsConfig()
Expand Down Expand Up @@ -127,10 +127,9 @@ public void load()
max_thunder_time is the maximum time interval between thunder events in ticks. Set to -1 to disable thunder.""", SEASON_PROPERTIES_VALIDATOR);

seasonPropertiesMapper = Suppliers.memoize(() -> {
var builder = ImmutableMap.<Season.SubSeason, SeasonProperties>builder();
builder.putAll(DEFAULT_SEASON_PROPERTIES);
seasonProperties.stream().map(SeasonProperties::decode).forEach(o -> o.ifPresent(v -> builder.put(v.subSeason(), v)));
return builder.build();
var map = new HashMap<>(DEFAULT_SEASON_PROPERTIES);
seasonProperties.stream().map(SeasonProperties::decode).forEach(o -> o.ifPresent(v -> map.put(v.subSeason(), v)));
return map;
});
}

Expand Down

0 comments on commit 409f248

Please sign in to comment.