Class ConstantEnvironmentProvider

java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.provider.ConstantEnvironmentProvider
All Implemented Interfaces:
EnvironmentProvider

public final class ConstantEnvironmentProvider extends Object implements EnvironmentProvider
Provides constant component values
  • Field Details

  • 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 world, 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's components to 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:
      buildCurrentComponents in interface EnvironmentProvider
      Parameters:
      world - The world/level being queried
      pos - The position in the world to query
      biome - The biome at the position in the world
      builder - A component map builder to append to
    • getType

      public EnvironmentProviderType<?> getType()
      Specified by:
      getType in interface EnvironmentProvider
      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 an environment component.