Beardifier 5.46.0
vanilla's Beardifier: the density added to the terrain's final density around the pieces of structures with a terrain adaptation (beard_thin, beard_box, bury, encapsulate) and around jigsaw junctions, so that the terrain fills the space under the pieces and clears the space inside them, with smooth slopes. Applied by the terrain fillers (PHP and the native core, which must compute exactly the same values: everything is float32 arithmetic like Java 26.3, rounded with f()).
The rigids and junctions are in vanilla's order for one start (pieces in order); starts are in StructureManager::getStartsAffecting() order (Java iterates a hash map, so the order of starts, which only changes the last bit of sums, cannot be reproduced anyway).
Constants
BEARD_BOX
public const BEARD_BOX = 3BEARD_THIN
public const BEARD_THIN = 2BURY
public const BURY = 1ENCAPSULATE
public const ENCAPSULATE = 4JUNCTION_SIZE
public const JUNCTION_SIZE = 3Junction record size: source x, source ground y, source z.
NONE
public const NONE = 0RIGID_SIZE
public const RIGID_SIZE = 8Rigid record size: minX, minY, minZ, maxX, maxY, maxZ, adaptation, ground level delta.
Properties
$affected
public readonly array $affected$junctions
public readonly array $junctions$rigids
public readonly array $rigidsMethods
__construct()
public function __construct(array $rigids, array $junctions, array $affected)adaptation()
public static function adaptation(string $name) : intcolumn()
public function column(int $x, int $z, int $fromY, int $toY) : arrayThe density added at each y of a column (Beardifier.sampleValue(), float32 values), for y from $fromY to $toY (inclusive), or [] if the column is outside the affected area. The values start at $fromY clamped to the affected area: returns [first y, list of values].
encode()
public function encode() : stringWire form for the native core: u16 rigid count, rigids (8 x i32), u16 junction count, junctions (3 x i32), affected area (6 x i32), all little-endian.
f()
public static function f(float $x) : floatRounds to the nearest float32 (Veltkamp splitting, same as the native core's fround()).
fastInvSqrt()
public static function fastInvSqrt(float $x) : floatMth.fastInvSqrt(double)
forStructuresInChunk()
public static function forStructuresInChunk(array $starts, int $chunkX, int $chunkZ) : ?selfBeardifier.forStructuresInChunk(): the rigid pieces (all pieces of code-built structures, rigid jigsaw pieces) within 12 blocks of the chunk and the junctions of jigsaw pieces near it, or null if there are none.
kernel()
public static function kernel() : arrayBEARD_KERNEL: (float) Math.pow(e, -(dx² + (dy + 0.5)² + dz²) / 16), index (z * 24 + x) * 24 + y.
