Class WeatherStateEnvironmentProvider
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.provider.WeatherStateEnvironmentProvider
- 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<WeatherStateEnvironmentProvider> 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 global weather state.builder()Creates a new builderOptional<net.minecraft.core.Holder<EnvironmentProvider>> clear()Provider to use when the world is neither raining nor thunderinggetType()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 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 global weather state. If a provider is not defined for the current weather state, then does nothing.- 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
-
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
-