Interface ThermooSeasonState<S extends ThermooSeason>
- Type Parameters:
S- The season type, either temperate or tropical.
- All Known Implementing Classes:
SeasonStateImpl
Contains the state of the season at some particular time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends ThermooSeason>
com.mojang.serialization.Codec<ThermooSeasonState<S>> codec(com.mojang.serialization.Codec<S> seasonCodec) Creates a codec for a season state of a particular season type.static <S extends ThermooSeason>
ThermooSeasonState<S> of(S season) Creates a season state that represents the beginning of the season.static <S extends ThermooSeason>
ThermooSeasonState<S> of(S season, float progress) Creates a season state for some progress in a season.floatprogress()How far this season has progressed.season()
-
Method Details
-
season
S season()- Returns:
- The season of this state.
-
progress
float progress()How far this season has progressed. Note that some season mods may not implement this functionality, in which case the progress will always be 0.- Returns:
- A float from 0-1 representing the percentage of the season that has already elapsed.
-
of
Creates a season state that represents the beginning of the season. -
of
Creates a season state for some progress in a season. The progress is clamped to the range [0, 1]. -
codec
static <S extends ThermooSeason> com.mojang.serialization.Codec<ThermooSeasonState<S>> codec(com.mojang.serialization.Codec<S> seasonCodec) Creates a codec for a season state of a particular season type.- Type Parameters:
S- The season type.- Parameters:
seasonCodec- The base codec of the season type.- Returns:
- A new codec for the season state.
-