Class SetPressureFromAltitudeProvider

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

public final class SetPressureFromAltitudeProvider extends Object implements EnvironmentProvider
An environment provider that sets the pressure component based on altitude above or below sea level.
  • Field Details

  • Method Details

    • create

      public static SetPressureFromAltitudeProvider create(double pressureChangeMbarPerMeter)
    • create

      public static SetPressureFromAltitudeProvider create()
    • 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)
      Sets the atmospheric pressure based on the queried pos altitude above sea level.

      The position is clamped to the minimum and maximum bounds of the world, and the final pressure will not be less than 0.

      Any pressure values currently in the map are treated as the pressure at sea level.

      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
    • codec

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

      public double pressureChangePerBlock()
      A finite value that sets how much to adjust pressure by, expressed in millibars per block above sea level.