Class WeatherStateEnvironmentProvider

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

public final class WeatherStateEnvironmentProvider 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 WeatherStateEnvironmentProvider.Builder builder()
      Creates a new builder
      Returns:
      Returns a new builder instance
    • buildCurrentComponents

      public void buildCurrentComponents(net.minecraft.world.level.Level world, 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:
      world - 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
    • getType

      Specified by:
      getType in interface EnvironmentProvider
      Returns:
      Returns the type of this provider for dispatch
    • 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