FabricStructureBuilder

public final class FabricStructureBuilder<FC extends FeatureConfig, S extends StructureFeature<FC>>

A builder for registering custom structures.

Example usage:

{@code * StructureFeature structure = new MyStructure(DefaultFeatureConfig.CODEC); * ConfiguredStructureFeature> configuredStructure
 *     = structure.configure(new DefaultFeatureConfig());
 * FabricStructureBuilder.create(new Identifier("mymod:mystructure"), structure)
 *     .step(GenerationStep.Feature.SURFACE_STRUCTURES) // required
 *     .defaultConfig(32, 8, 12345) // required
 *     .superflatFeature(configuredStructure)
 *     .register();}
 

This class does not add structures to biomes for you, you have to do that yourself. You may also need to register custom structure pieces yourself.

Functions

adjustsSurface
Link copied to clipboard
FabricStructureBuilder<FC, SadjustsSurface()
Causes structure pieces of this structure to adjust the surface of the world to fit them, so that they don'tstick out of or into the ground.
create
Link copied to clipboard
static FabricStructureBuilder<FC, Screate<FC extends FeatureConfig, S extends StructureFeature<FC>>(Identifier id, S structure)
Creates a new {@code FabricStructureBuilder} for registering a structure.
defaultConfig
Link copied to clipboard
FabricStructureBuilder<FC, SdefaultConfig(StructureConfig config)
Sets the default StructureConfig for this structure.
FabricStructureBuilder<FC, SdefaultConfig(int spacing, int separation, int salt)
Sets the default StructureConfig for this structure.
register
Link copied to clipboard
S register()
Registers this structure and applies the other changes from the FabricStructureBuilder.
step
Link copied to clipboard
FabricStructureBuilder<FC, Sstep(GenerationStep.Feature step)
Sets the generation step of this structure.
superflatFeature
Link copied to clipboard
FabricStructureBuilder<FC, SsuperflatFeature(FC config)
Sets the structure configuration which spawns in superflat worlds.
FabricStructureBuilder<FC, SsuperflatFeature(ConfiguredStructureFeature<FC, ? extends StructureFeature<FC>> superflatFeature)
Sets the structure configuration which spawns in superflat worlds.

Sources

jvm source
Link copied to clipboard