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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for local precipitation environment providers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BiomePrecipitationTypeEnvironmentProvider> 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) Delegates to a child provider based on the local precipitation type.getType()Map<net.minecraft.world.level.biome.Biome.Precipitation, net.minecraft.core.Holder<EnvironmentProvider>> Maps that is used to choose the child provider to delegate to based on local precipitation
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<BiomePrecipitationTypeEnvironmentProvider> CODEC
-
-
Method Details
-
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) 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:
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 component map builder to append to
-
getType
- Specified by:
getTypein interfaceEnvironmentProvider- 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
-