Class ModifiableBiomeInfo

java.lang.Object
net.neoforged.neoforge.common.world.ModifiableBiomeInfo

public class ModifiableBiomeInfo extends Object
Holds lazy-evaluable modified biome info. Memoizers are not used because it's important to return null without evaluating the biome info if it's accessed outside of a server context.
  • Field Details

  • Constructor Details

    • ModifiableBiomeInfo

      public ModifiableBiomeInfo(ModifiableBiomeInfo.BiomeInfo originalBiomeInfo)
      Parameters:
      originalBiomeInfo - BiomeInfo representing the original state of a biome when the biome was constructed.
  • Method Details

    • get

      Returns The modified biome info if modified biome info has been generated, otherwise gets original biome info.
      Returns:
      The modified biome info if modified biome info has been generated, otherwise gets original biome info
    • getOriginalBiomeInfo

      public ModifiableBiomeInfo.BiomeInfo getOriginalBiomeInfo()
      Returns The original biome info that the associated biome was created with.
      Returns:
      The original biome info that the associated biome was created with
    • getModifiedBiomeInfo

      @Nullable public @Nullable ModifiableBiomeInfo.BiomeInfo getModifiedBiomeInfo()
      Returns Modified biome info; null if it hasn't been set yet.
      Returns:
      Modified biome info; null if it hasn't been set yet
    • applyBiomeModifiers

      @Internal public void applyBiomeModifiers(Holder<Biome> biome, List<BiomeModifier> biomeModifiers)
      Internal forge method; the game will crash if mods invoke this. Creates and caches the modified biome info.
      Parameters:
      biome - named biome with original data.
      biomeModifiers - biome modifiers to apply.
      Throws:
      IllegalStateException - if invoked more than once.