FeatureRandom 5.46.0
Vanilla's WorldgenRandom over a Xoroshiro128++ source, as used for biome decoration (ChunkGenerator .applyBiomeDecoration): every value comes from next(bits) = (int) (xoroshiro.nextLong() >>> (64 - bits)), and the int/float/double/long/gaussian helpers are the java.util.Random style ones of BitRandomSource / LegacyRandomSource.
Note: the gaussian cache is NOT reset by setSeed() (WorldgenRandom overrides setSeed and only reseeds the source), so it carries over between features of the same chunk, like in vanilla.
Methods
__construct()
public function __construct(int $seed = 0)consumeCount()
public function consumeCount(int $count) : voidfork()
public function fork() : \pocketmine\world\generator\vanilla\random\XoroshiroRandomWorldgenRandom.fork(): a plain Xoroshiro source (with its own nextInt(bound) semantics).
getGaussianState()
public function getGaussianState() : arrayPending second value of nextGaussian() (the native decoration continues the same sequence).
mthNextInt()
public function mthNextInt(int $min, int $max) : intMth.nextInt(random, min, max): min if min >= max
next()
public function next(int $bits) : int(int) (nextLong() >>> (64 - bits)), for 1 <= bits <= 32.
nextBoolean()
public function nextBoolean() : boolnextBoundedInt()
public function nextBoundedInt(int $bound) : intUniform int in [0, bound) (java.util.Random algorithm).
nextDouble()
public function nextDouble() : floatnextFloat()
public function nextFloat() : floatfloat32 in [0, 1)
nextGaussian()
public function nextGaussian() : floatnextInt()
public function nextInt() : intnextIntBetweenInclusive()
public function nextIntBetweenInclusive(int $min, int $max) : intRandomSource.nextIntBetweenInclusive / Mth.randomBetweenInclusive
nextIntRange()
public function nextIntRange(int $origin, int $bound) : intRandomSource.nextInt(origin, bound)
nextLong()
public function nextLong() : intrawLong()
public function rawLong() : intRaw Xoroshiro128++ output.
setDecorationSeed()
public function setDecorationSeed(int $levelSeed, int $x, int $z) : intWorldgenRandom.setDecorationSeed(levelSeed, minBlockX, minBlockZ): returns the decoration seed.
setFeatureSeed()
public function setFeatureSeed(int $decorationSeed, int $index, int $step) : voidWorldgenRandom.setFeatureSeed(decorationSeed, index, step).
setGaussianState()
public function setGaussianState(bool $have, float $value) : voidsetSeed()
public function setSeed(int $seed) : voidtriangle()
public function triangle(float $mean, float $spread) : floatRandomSource.triangle(mean, spread) for doubles
