-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add linear interpolation for season colors
Season progress is now accurately represented in the world by linearly interpolating season colors to the next season.
- Loading branch information
1 parent
a00d8b9
commit 1fde9b7
Showing
16 changed files
with
210 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...n/java/io/github/steveplays28/simpleseasons/client/util/season/color/SeasonColorUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.github.steveplays28.simpleseasons.client.util.season.color; | ||
|
||
import io.github.steveplays28.simpleseasons.state.SeasonTracker; | ||
import io.github.steveplays28.simpleseasons.util.Color; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Map; | ||
|
||
public class SeasonColorUtil { | ||
// Per-season color additions | ||
public static final Color SPRING_COLOR_ADDITION = new Color(255 / 3, 255 / 3, 0); | ||
public static final Color SUMMER_COLOR_ADDITION = new Color(0, 0, 0); | ||
public static final Color FALL_COLOR_ADDITION = new Color(255 / 3, 0, 0); | ||
public static final Color WINTER_COLOR_ADDITION = new Color(255 / 2, 255 / 2, 255 / 2); | ||
// Dry biomes | ||
public static final Color HOT_DRY_BIOMES_COLOR_ADDITION = new Color(120, 0, 0); | ||
public static final Color WET_DRY_BIOMES_COLOR_ADDITION = new Color(50, 50, 0); | ||
// Seasons color map | ||
public static final Map<Integer, Color> SEASONS_COLOR_ADDITIONS_MAP = Map.of( | ||
SeasonTracker.Seasons.SPRING.ordinal(), | ||
SPRING_COLOR_ADDITION, SeasonTracker.Seasons.SUMMER.ordinal(), SUMMER_COLOR_ADDITION, SeasonTracker.Seasons.FALL.ordinal(), | ||
FALL_COLOR_ADDITION, SeasonTracker.Seasons.WINTER.ordinal(), WINTER_COLOR_ADDITION | ||
); | ||
// Dry biomes | ||
public static final Map<Integer, Color> SEASONS_DRY_BIOMES_COLOR_ADDITIONS_MAP = Map.of(SeasonTracker.Seasons.SPRING.ordinal(), | ||
HOT_DRY_BIOMES_COLOR_ADDITION, SeasonTracker.Seasons.SUMMER.ordinal(), HOT_DRY_BIOMES_COLOR_ADDITION, | ||
SeasonTracker.Seasons.FALL.ordinal(), WET_DRY_BIOMES_COLOR_ADDITION, SeasonTracker.Seasons.WINTER.ordinal(), | ||
WET_DRY_BIOMES_COLOR_ADDITION | ||
); | ||
|
||
public static Color getSeasonColorAddition(SeasonTracker.@NotNull Seasons season, float seasonProgress) { | ||
return SEASONS_COLOR_ADDITIONS_MAP.get(season.getId()).lerp(SEASONS_COLOR_ADDITIONS_MAP.get(season.getNext().getId()), seasonProgress); | ||
} | ||
|
||
public static Color getSeasonColorAddition(SeasonTracker.@NotNull Seasons season, float seasonProgress, boolean isDryBiome) { | ||
if (isDryBiome) { | ||
return SEASONS_DRY_BIOMES_COLOR_ADDITIONS_MAP.get(season.getId()).lerp(SEASONS_COLOR_ADDITIONS_MAP.get(season.getNext().getId()), seasonProgress); | ||
} | ||
|
||
return getSeasonColorAddition(season, seasonProgress); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
src/main/java/io/github/steveplays28/simpleseasons/mixin/client/BiomeMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.