Class ConstantProvider
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.v2.provider.ConstantProvider
- All Implemented Interfaces:
EnvironmentProvider
Provides constant component values
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ConstantProvider> 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) Adds the component map stored in this provider'scomponentsto the builder.com.mojang.serialization.MapCodec<ConstantProvider> codec()net.minecraft.core.component.DataComponentMapGets the component map stored in this provider.static ConstantProvidercreate(net.minecraft.core.component.DataComponentMap.Builder builder) Creates a constant environment provider from a component map builder.
-
Field Details
-
CODEC
-
-
Method Details
-
create
@Contract("_->new") public static ConstantProvider create(net.minecraft.core.component.DataComponentMap.Builder builder) Creates a constant environment provider from a component map builder. The builder is built into a new component map with this method, so modifying the builder after creating the provider will not affect the returned provider.- Parameters:
builder- The builder to create the provider from- Returns:
- Returns a new replacement environment provider
-
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) Adds the component map stored in this provider'scomponentsto the builder. The components supplied by this provider are immutable and never change. If a component type is mapped to a value in the builder and NOT mapped to a value in this provider, then it will be unaffected.- 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.
-
components
public net.minecraft.core.component.DataComponentMap components()Gets the component map stored in this provider. This is an [EnvironmentComponentTypes environment component].
-