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 Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a custom source whose possible biomes are supplied by an override ofpossibleBiomes().protectedCustomBiomeSource(Biome... possibleBiomes) Creates a custom source capable of returning the supplied biomes.protectedCustomBiomeSource(Set<? extends Biome> possibleBiomes) Creates a custom source capable of returning the supplied biomes. -
Method Summary
Modifier and TypeMethodDescriptionabstract Biomebiome(BiomeSourceContext context) Selects the biome at the requested position.Gets every biome this source may return.final ObjectCreates the Minecraft biome source that delegates selection to this object.
-
Constructor Details
-
CustomBiomeSource
Creates a custom source whose possible biomes are supplied by an override ofpossibleBiomes().- Since:
- 3.3.0
-
CustomBiomeSource
-
CustomBiomeSource
-
-
Method Details
-
biome
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
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
Creates the Minecraft biome source that delegates selection to this object.- Specified by:
toMinecraftin interfaceWrapper- Returns:
- the Minecraft biome source
- Since:
- 3.3.0
-