Interface ThermooSeasonState<S extends ThermooSeason>

Type Parameters:
S - The season type, either temperate or tropical.
All Known Implementing Classes:
SeasonStateImpl

@NonExtendable public interface ThermooSeasonState<S extends ThermooSeason>
Contains the state of the season at some particular time.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    float
    How far this season has progressed.
     
  • 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

      static <S extends ThermooSeason> ThermooSeasonState<S> of(S season)
      Creates a season state that represents the beginning of the season.
    • of

      static <S extends ThermooSeason> ThermooSeasonState<S> of(S season, float progress)
      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.