Class WeatherStateSelector
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.v2.provider.WeatherStateSelector
- All Implemented Interfaces:
EnvironmentProvider
An environment provider that delegates to a child provider based on the global weather state of a world (clear, rain,
or thunder).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for weather state providers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<WeatherStateSelector> 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) Delegates to a child provider based on the global weather state.static WeatherStateSelector.Builderbuilder()Creates a new builderOptional<net.minecraft.core.Holder<EnvironmentProvider>> clear()Provider to use when the world is neither raining nor thunderingcom.mojang.serialization.MapCodec<WeatherStateSelector> codec()Optional<net.minecraft.core.Holder<EnvironmentProvider>> rain()Provider to use when the world is raining but not thunderingOptional<net.minecraft.core.Holder<EnvironmentProvider>> thunder()Provider to use when the world is thundering
-
Field Details
-
CODEC
-
-
Method Details
-
builder
Creates a new builder- Returns:
- Returns a new builder instance
-
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) Delegates to a child provider based on the global weather state. If a provider is not defined for the current weather state, then does nothing.- 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 reducible component map builder to append to
-
codec
- Specified by:
codecin interfaceEnvironmentProvider- Returns:
- Returns the codec of the provider.
-
clear
Provider to use when the world is neither raining nor thundering -
rain
Provider to use when the world is raining but not thundering -
thunder
Provider to use when the world is thundering
-