Class TemperatureShiftEnvironmentProvider
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.provider.TemperatureShiftEnvironmentProvider
- All Implemented Interfaces:
EnvironmentProvider
public final class TemperatureShiftEnvironmentProvider
extends Object
implements EnvironmentProvider
Intended to be used as a modifier, this provider shifts the existing temperature component in a map by a given value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TemperatureShiftEnvironmentProvider> Fields inherited from interface com.github.thedeathlycow.thermoo.api.environment.provider.EnvironmentProvider
ELEMENT_CODEC, ENTRY_CODEC, HOLDER_CODEC -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildCurrentComponents(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) Adds the shift value of this provider to the existing temperature component in the builder.create(TemperatureRecord shift) Creates a new providergetType()shift()
-
Field Details
-
CODEC
-
-
Method Details
-
create
@Contract("_->new") public static TemperatureShiftEnvironmentProvider create(TemperatureRecord shift) Creates a new provider- Parameters:
shift- Provider temperature shift value- Returns:
- Returns a new temperature shift provider 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) Adds the shift value of this provider to the existing temperature component in the builder. If no temperature component is in the builder, then this will skip and log a warning.- Specified by:
buildCurrentComponentsin interfaceEnvironmentProvider- Parameters:
world- The world/level being queriedpos- The position in the world to querybiome- The biome at the position in the worldbuilder- A reducible component map builder to append to
-
getType
- Specified by:
getTypein interfaceEnvironmentProvider- Returns:
- Returns the type of this provider for dispatch
-
shift
-