Skip to content

Commit

Permalink
Bring back old spring behaviour. Add option to reverse fall and sprin…
Browse files Browse the repository at this point in the history
…g temperatures. Bump to 2.4.1-BETA
  • Loading branch information
lucaargolo committed Sep 29, 2024
1 parent 1199b5e commit 5ea8657
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ modrinth_version=2.8.7
github_api_version=1.314

# Mod Properties
mod_version=2.4-BETA+1.20
mod_version=2.4.1-BETA+1.20
maven_group=io.github.lucaargolo

# Fabric Properties
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,42 +370,42 @@ public static Pair<Boolean, Float> getSeasonWeather(Season season, Identifier bi
}else if(temp <= -0.51) {
//Permanently Frozen Biomes
return switch (season) {
case SPRING -> new Pair<>(hasPrecipitation, temp - 0.3f);
case SPRING -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp - 0.3f) : new Pair<>(hasPrecipitation, temp);
case SUMMER -> new Pair<>(hasPrecipitation, temp + 0.84f);
case WINTER -> new Pair<>(hasPrecipitation, temp - 0.7f);
default -> new Pair<>(hasPrecipitation, temp);
case FALL -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp) : new Pair<>(hasPrecipitation, temp - 0.3f);
};
}else if(temp <= 0.15) {
//Usually Frozen Biomes
return switch (season) {
case SPRING -> new Pair<>(hasPrecipitation, temp - 0.25f);
case SPRING -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp - 0.25f) : new Pair<>(hasPrecipitation, temp);
case SUMMER -> new Pair<>(hasPrecipitation, temp + (CONFIG.shouldSnowyBiomesMeltInSummer() ? 0.66f : 0f));
case WINTER -> new Pair<>(hasPrecipitation, temp - 0.75f);
default -> new Pair<>(hasPrecipitation, temp);
case FALL -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp) : new Pair<>(hasPrecipitation, temp - 0.25f);
};
}else if(temp <= 0.49) {
//Temparate Biomes
return switch (season) {
case SPRING -> new Pair<>(hasPrecipitation, temp - 0.16f);
case SPRING -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp - 0.16f) : new Pair<>(hasPrecipitation, temp);
case SUMMER -> new Pair<>(hasPrecipitation, temp + 0.66f);
case WINTER -> new Pair<>(hasPrecipitation, temp - 0.8f);
default -> new Pair<>(hasPrecipitation, temp);
case FALL -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp) : new Pair<>(hasPrecipitation, temp - 0.16f);
};
}else if(temp <= 0.79) {
//Usually Ice Free Biomes
return switch (season) {
case SPRING -> new Pair<>(hasPrecipitation, temp - 0.34f);
case SPRING -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp - 0.34f) : new Pair<>(hasPrecipitation, temp);
case SUMMER -> new Pair<>(hasPrecipitation, temp + 0.46f);
case WINTER -> new Pair<>(hasPrecipitation, temp - 0.56f);
default -> new Pair<>(hasPrecipitation, temp);
case FALL -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp) : new Pair<>(hasPrecipitation, temp - 0.34f);
};
}else{
// Ice Free Biomes
return switch (season) {
case SPRING -> new Pair<>(hasPrecipitation, temp - 0.34f);
case SPRING -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp - 0.34f) : new Pair<>(hasPrecipitation, temp);
case SUMMER -> new Pair<>(hasPrecipitation, temp + 0.4f);
case WINTER -> new Pair<>(true, temp - 0.64f);
default -> new Pair<>(hasPrecipitation, temp);
case FALL -> CONFIG.isFallAndSpringReversed() ? new Pair<>(hasPrecipitation, temp) : new Pair<>(hasPrecipitation, temp - 0.34f);
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ private static class SeasonLength {
);

private boolean isSeasonTiedWithSystemTime = false;

private boolean isInNorthHemisphere = true;
private boolean isFallAndSpringReversed = false;

private boolean isSeasonMessingCrops = true;
private boolean isSeasonMessingBonemeal = false;
Expand Down Expand Up @@ -163,6 +163,10 @@ public boolean isInNorthHemisphere() {
return isInNorthHemisphere;
}

public boolean isFallAndSpringReversed() {
return isFallAndSpringReversed;
}

public boolean isDebugCommandEnabled() { return debugCommandEnabled; }

}

0 comments on commit 5ea8657

Please sign in to comment.