Class CustomBiomeSource

java.lang.Object
dev.wyck.worldgen.biome.custom.CustomBiomeSource
All Implemented Interfaces:
BiomeSource, Wrapper

@NullMarked @AsOf("3.3.0") @Experimental public abstract class CustomBiomeSource extends Object implements BiomeSource
Base class for an authored biome source with its own biome-selection algorithm.

Paper servers may call biome(BiomeSourceContext) concurrently from multiple async chunk loading threads.

Since:
3.3.0
  • Constructor Details

    • CustomBiomeSource

      @AsOf("3.3.0") protected CustomBiomeSource()
      Creates a custom source whose possible biomes are supplied by an override of possibleBiomes().
      Since:
      3.3.0
    • CustomBiomeSource

      @AsOf("3.3.0") protected CustomBiomeSource(Set<? extends Biome> possibleBiomes)
      Creates a custom source capable of returning the supplied biomes.
      Parameters:
      possibleBiomes - every biome this source may return
      Since:
      3.3.0
    • CustomBiomeSource

      @AsOf("3.3.0") protected CustomBiomeSource(Biome... possibleBiomes)
      Creates a custom source capable of returning the supplied biomes.
      Parameters:
      possibleBiomes - every biome this source may return
      Since:
      3.3.0
  • Method Details

    • biome

      @AsOf("3.3.0") public abstract Biome biome(BiomeSourceContext context)
      Selects the biome at the requested position.

      The returned biome must be one of the entries declared through the constructor or possibleBiomes().

      Parameters:
      context - the position and climate sampling surface
      Returns:
      the biome at the requested position
      Since:
      3.3.0
    • possibleBiomes

      @AsOf("3.3.0") public Set<Biome> possibleBiomes()
      Gets every biome this source may return. Minecraft uses this set for structure placement, locating biomes, and other biome-source queries. Implementations using the no-argument constructor must override this method and return a non-empty set.

      The returned set is read and snapshotted when toMinecraft() is called.

      Returns:
      the possible biomes
      Since:
      3.3.0
    • toMinecraft

      @AsOf("3.3.0") public final Object toMinecraft()
      Creates the Minecraft biome source that delegates selection to this object.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      the Minecraft biome source
      Since:
      3.3.0