Noise Routers
The NoiseRouter bundles the
various DensityFunctions
that create a given dimension’s terrain. Where a single density function describes one piece of the
generator’s behavior.
The fifteen slots fall into four groups:
- Aquifers and fluids:
barrier,fluidLevelFloodedness,fluidLevelSpread, andlavacontrol where and how fluids pool underground. - Climate parameters:
temperature,vegetation,continents,erosion,depth, andridgesdescribe the noise fields that bend terrain and feed biome placement. - Terrain shape:
preliminarySurfaceLevelgives an early surface-height estimate, andfinalDensitydecides whether a given block ends up solid. - Ore veins:
veinToggle,veinRidged, andveinGapgovern the placement of large ore veins.
Example Usage
Section titled “Example Usage”import dev.wyck.wrapper.level.noise.NoiseRouter;
import dev.wyck.wrapper.level.noise.function.DensityFunction;
import dev.wyck.wrapper.level.noise.function.DensityFunctions;
import org.bukkit.plugin.java.JavaPlugin;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
DensityFunction temperature = DensityFunctions.ZERO;
DensityFunction vegetation = DensityFunctions.ZERO;
DensityFunction continents = DensityFunctions.CONTINENTS;
DensityFunction erosion = DensityFunctions.EROSION;
DensityFunction depth = DensityFunctions.DEPTH_AMPLIFIED;
DensityFunction ridges = DensityFunctions.RIDGES;
// Actual terrain shape
DensityFunction finalDensity = DensityFunctions.SLOPED_CHEESE;
NoiseRouter router = NoiseRouter.builder()
// Aquifers and fluids
.barrier(DensityFunction.constant(0.0))
.fluidLevelFloodedness(DensityFunction.constant(0.0))
.fluidLevelSpread(DensityFunction.constant(0.0))
.lava(DensityFunction.constant(0.0))
// Climate parameters
.temperature(temperature)
.vegetation(vegetation)
.continents(continents)
.erosion(erosion)
.depth(depth)
.ridges(ridges)
// Terrain shape
.preliminarySurfaceLevel(DensityFunction.constant(0.0))
.finalDensity(finalDensity)
// Ore veins (disabled)
.veinToggle(DensityFunction.constant(-1.0))
.veinRidged(DensityFunction.constant(0.0))
.veinGap(DensityFunction.constant(0.0))
// All done!
.build();
}
}