Skip to content

Commit

Permalink
Fixed broken validation logic for season properties config. Closes #449
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Jan 27, 2024
1 parent 18ec284 commit fde227f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/src/main/java/sereneseasons/config/SeasonsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ public static Optional<SeasonProperties> decode(Config config)
int minThunderTime = config.getInt("min_thunder_time");
int maxThunderTime = config.getInt("max_thunder_time");

Preconditions.checkArgument(meltChance < 0.0F || meltChance > 100.0F);
Preconditions.checkArgument(meltChance >= 0.0F && meltChance <= 100.0F);
Preconditions.checkArgument(rolls >= 0);
Preconditions.checkArgument(biomeTempAdjustment >= -10.0 && biomeTempAdjustment <= 10.0);
Preconditions.checkArgument(minRainTime >= maxRainTime);
Preconditions.checkArgument(minThunderTime >= maxThunderTime);
Preconditions.checkArgument(minRainTime <= maxRainTime);
Preconditions.checkArgument(minThunderTime <= maxThunderTime);

return Optional.of(new SeasonProperties(subSeason, meltChance, rolls, biomeTempAdjustment, minRainTime, maxRainTime, minThunderTime, maxThunderTime));
}
Expand Down

0 comments on commit fde227f

Please sign in to comment.