Enum Class ThermooSeason

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

public enum ThermooSeason extends Enum<ThermooSeason> implements net.minecraft.util.StringRepresentable
Mod-agnostic Seasons enum. Thermoo does not any provide seasons-like functionality itself, but this can be used to better integrate with any mods that do provide season functionality.
  • Enum Constant Details

  • Field Details

    • CODEC

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

    • values

      public static ThermooSeason[] 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 ThermooSeason 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
    • getCurrentSeason

      public static Optional<ThermooSeason> getCurrentSeason(net.minecraft.world.level.Level world)
      Shorthand for invoking ThermooSeasonEvents.GET_CURRENT_SEASON.

      Retrieves the current season, 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.

      This event should only ever return the temperate seasons, that is SPRING, SUMMER, AUTUMN, or WINTER, and never the tropical seasons. For tropical seasons, use getCurrentTropicalSeason(Level, BlockPos)

      Parameters:
      world - The current world / level to get the season from.
      Returns:
      Returns the current season if a Seasons mod is installed, or empty if no seasons mod is installed.
      See Also:
    • getCurrentTropicalSeason

      public static Optional<ThermooSeason> getCurrentTropicalSeason(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Shorthand for invoking ThermooSeasonEvents.GET_CURRENT_TROPICAL_SEASON.

      Retrieves the current tropical season at a position in the world. If the position queried is not in a tropical biome, or a seasons mod is not loaded, then empty should be returned.

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

      Returns empty by default.

      Parameters:
      world - The world to query
      pos - The position in the world to query
      Returns:
      If the queried pos is a tropical area and a seasons mod is loaded, returns one of TROPICAL_DRY or TROPICAL_WET
      See Also:
    • isTropical

      public boolean isTropical()
      Returns:
      Returns true if this season is TROPICAL_DRY or TROPICAL_WET
    • getSerializedName

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