Class BiomePrecipitationTypeEnvironmentProvider

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

public final class BiomePrecipitationTypeEnvironmentProvider extends Object implements EnvironmentProvider
A provider that delegates to a child provider based on the precipitation-type of a biome. At least one precipitation type provider must be given.
  • Field Details

  • Method Details

    • 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 local precipitation type.

      IMPORTANT: This is not based on current weather state. For example, snowy biomes will ALWAYS return the provider mapped to Biome.Precipitation.SNOW, even when it is not snowing.

      If no provider is mapped to the local precipitation type, then nothing is built.

      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 component map builder to append to
    • getType

      Specified by:
      getType in interface EnvironmentProvider
      Returns:
      Returns the type of this provider for dispatch
    • precipitationType

      public Map<net.minecraft.world.level.biome.Biome.Precipitation,net.minecraft.core.Holder<EnvironmentProvider>> precipitationType()
      Maps that is used to choose the child provider to delegate to based on local precipitation
      Returns:
      Returns an unmodifiable enum map