Class ConstantEnvironmentProvider
java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.provider.ConstantEnvironmentProvider
- All Implemented Interfaces:
EnvironmentProvider
Provides constant component values
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ConstantEnvironmentProvider> 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 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.net.minecraft.core.component.DataComponentMapGets the component map stored in this provider.static ConstantEnvironmentProvidercreate(net.minecraft.core.component.DataComponentMap.Builder builder) Creates a constant environment provider from a component map builder.getType()
-
Field Details
-
CODEC
-
-
Method Details
-
create
@Contract("_->new") public static ConstantEnvironmentProvider 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
-
getType
- Specified by:
getTypein interfaceEnvironmentProvider- Returns:
- Returns the type of this provider for dispatch
-
components
public net.minecraft.core.component.DataComponentMap components()Gets the component map stored in this provider. This is anenvironment component.
-