Skip to content

Surface Builders

gniftygnome edited this page Mar 27, 2024 · 5 revisions

Using Biolith Surface Builders

Biolith's surface builders can only be accessed via the code API, because the purpose of restoring surface builder functionality is to enable the use of custom code to build surfaces when material rules cannot provide the required functionality (or it is too cumbersome). A primary reason to use surface builders is to enable changing the surface height from that dictated by vanilla noise.

in code

Extend com.terraformersmc.biolith.api.surface.BiolithSurfaceBuilder and override either the generate or generateLate method (or both). Register your surface builder class with biolith like this:

  • Methods: addOverworldSurfaceRules, addNetherSurfaceRules, addEndSurfaceRules
// Any needed configuration for the builder can be supplied via the constructor.
SurfaceGeneration.addOverworldSurfaceRules(
        Identifier.of(MyMod.MOD_ID, "surface_rules"),
        new MySurfaceBuilder(Blocks.SAND.getDefaultState()).setBiomeKey(MyBiomeKeys.MY_BIOME))

Examples

There are some good examples of surface builders (and using the biome perimeters system, which gives an estimated distance to the edge of the biome, to smooth out elevation changes) in Terrestria.