Class ShiftTemperatureProvider

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

public final class ShiftTemperatureProvider extends Object implements EnvironmentProvider
Intended to be used as a modifier, this provider shifts the existing temperature component in a map by a given value.
  • Field Details

  • Method Details

    • create

      @Contract("_->new") public static ShiftTemperatureProvider create(TemperatureRecord shift)
      Creates a new provider
      Parameters:
      shift - Provider temperature shift value
      Returns:
      Returns a new temperature shift provider 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)
      Adds the shift value of this provider to the existing temperature component in the builder. If no temperature component is in the builder, then this will skip and log a warning.
      Specified by:
      buildCurrentComponents in interface EnvironmentProvider
      Parameters:
      level - The world/level being queried
      pos - The position in the world to query
      biome - The biome at the position in the world
      builder - A reducible component map builder to append to
    • codec

      public com.mojang.serialization.MapCodec<ShiftTemperatureProvider> codec()
      Specified by:
      codec in interface EnvironmentProvider
      Returns:
      Returns the codec of the provider.
    • shift

      public TemperatureRecord shift()