Enum Class TemperateSeason

java.lang.Object
java.lang.Enum<TemperateSeason>
com.github.thedeathlycow.thermoo.api.season.v2.TemperateSeason
All Implemented Interfaces:
ThermooSeason, Serializable, Comparable<TemperateSeason>, Constable, net.minecraft.util.StringRepresentable

public enum TemperateSeason extends Enum<TemperateSeason> implements ThermooSeason
Enumeration for the four traditional (temperate) seasons. Note that Thermoo will not provide any seasons mod functionality by itself, that must be provided by an external seasons mod. This is primarily intended to be used for mod-agnostic seasons mod integration.
See Also:
  • Enum Constant Details

  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<TemperateSeason> CODEC
  • Method Details

    • values

      public static TemperateSeason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TemperateSeason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCurrentState

      public static Optional<ThermooSeasonState<TemperateSeason>> getCurrentState(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Shorthand for invoking ThermooSeasonEvents.GET_CURRENT_SEASON.

      Retrieves the current temperate season state at a position in a level, if a season mod is loaded. Thermoo does not add seasons by itself, seasons must be implemented by another mod like Fabric Seasons or Serene Seasons. This event just places season integration into a common source.

      If any listener returns a non-empty season state, then all further processing is cancelled and that state is returned.

      If the queried position does not have seasons, or a seasons mod is not installed, then returns a state based on the current value of the environment attributes.

      See Also:
    • getSerializedName

      public String getSerializedName()
      Specified by:
      getSerializedName in interface net.minecraft.util.StringRepresentable
    • createState

      public ThermooSeasonState<TemperateSeason> createState()
      Description copied from interface: ThermooSeason
      Creates a season state that represents the start of this season.
      Specified by:
      createState in interface ThermooSeason