Class WeatherStateSelector

java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.v2.provider.WeatherStateSelector
All Implemented Interfaces:
EnvironmentProvider

public final class WeatherStateSelector extends Object implements EnvironmentProvider
An environment provider that delegates to a child provider based on the global weather state of a world (clear, rain, or thunder).
  • Field Details

  • Method Details

    • builder

      @Contract("->new") public static WeatherStateSelector.Builder builder()
      Creates a new builder
      Returns:
      Returns a new builder instance
    • buildCurrentComponents

      public void buildCurrentComponents(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, net.minecraft.core.component.DataComponentMap.Builder builder)
      Delegates to a child provider based on the global weather state. If a provider is not defined for the current weather state, then does nothing.
      Specified by:
      buildCurrentComponents in interface EnvironmentProvider
      Parameters:
      level - The world/level being queried
      pos - The position in the world to query
      biome - The biome at the position in the world
      builder - A reducible component map builder to append to
    • codec

      public com.mojang.serialization.MapCodec<WeatherStateSelector> codec()
      Specified by:
      codec in interface EnvironmentProvider
      Returns:
      Returns the codec of the provider.
    • clear

      public Optional<net.minecraft.core.Holder<EnvironmentProvider>> clear()
      Provider to use when the world is neither raining nor thundering
    • rain

      public Optional<net.minecraft.core.Holder<EnvironmentProvider>> rain()
      Provider to use when the world is raining but not thundering
    • thunder

      public Optional<net.minecraft.core.Holder<EnvironmentProvider>> thunder()
      Provider to use when the world is thundering