Interface EnvironmentProvider

All Known Implementing Classes:
ConstantProvider, LightThresholdSelector, ModifyProvider, PrecipitationTypeSelector, SeasonalEnvironmentProvider, SetPressureFromAltitudeProvider, SetTemperatureFromPressureProvider, ShiftTemperatureProvider, TemperateSeasonSelector, TropicalSeasonSelector, WeatherStateSelector

public interface EnvironmentProvider
Provides the environment parameters (such as temperature and relative humidity) of a position in a world and biome.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<EnvironmentProvider>
     
    static final com.mojang.serialization.Codec<net.minecraft.core.Holder<EnvironmentProvider>>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    Builds the current environment parameter components at a point and biome in a level into a builder.
    com.mojang.serialization.MapCodec<? extends EnvironmentProvider>
     
  • Field Details

    • ELEMENT_CODEC

      static final com.mojang.serialization.Codec<EnvironmentProvider> ELEMENT_CODEC
    • HOLDER_CODEC

      static final com.mojang.serialization.Codec<net.minecraft.core.Holder<EnvironmentProvider>> HOLDER_CODEC
  • Method Details

    • buildCurrentComponents

      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)

      Builds the current environment parameter components at a point and biome in a level into a builder.

      Only component type keys registered in the environment component type registry. A set of default components for temperature, relative humidity, and atmospheric pressure are defined in EnvironmentComponentTypes.

      Parameters:
      level - The 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
    • codec

      com.mojang.serialization.MapCodec<? extends EnvironmentProvider> codec()
      Returns:
      Returns the codec of the provider.