Class SetPressureFromAltitudeProvider
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.v2.provider.SetPressureFromAltitudeProvider
- All Implemented Interfaces:
EnvironmentProvider
An environment provider that sets the pressure component based on altitude above or below
sea level.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SetPressureFromAltitudeProvider> Fields inherited from interface EnvironmentProvider
ELEMENT_CODEC, HOLDER_CODEC -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildCurrentComponents(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 queriedposaltitude above sea level.com.mojang.serialization.MapCodec<SetPressureFromAltitudeProvider> codec()create()create(double pressureChangeMbarPerMeter) doubleA finite value that sets how much to adjust pressure by, expressed in millibars per block above sea level.
-
Field Details
-
CODEC
-
-
Method Details
-
create
-
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 queriedposaltitude 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:
buildCurrentComponentsin interfaceEnvironmentProvider- Parameters:
level- The world/level being queriedpos- The position in the world to querybiome- The biome at the position in the worldbuilder- A component map builder to append to
-
codec
- Specified by:
codecin interfaceEnvironmentProvider- 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.
-