StructureRandom 5.46.0
Random helpers of the structure code: vanilla's WorldgenRandom seeding methods over a legacy (java.util.Random) source, and the Util/Mth helpers that structures use with any random source.
Methods
between()
php
public static function between(\pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $min, int $max) : intMth.randomBetweenInclusive / RandomSource.nextIntBetweenInclusive
largeFeature()
php
public static function largeFeature(int $levelSeed, int $chunkX, int $chunkZ) : \pocketmine\world\generator\vanilla\random\LegacyRandomWorldgenRandom.setLargeFeatureSeed(levelSeed, chunkX, chunkZ) on a new legacy random.
largeFeatureWithSalt()
php
public static function largeFeatureWithSalt(int $levelSeed, int $regionX, int $regionZ, int $salt) : \pocketmine\world\generator\vanilla\random\LegacyRandomWorldgenRandom.setLargeFeatureWithSalt(levelSeed, regionX, regionZ, salt) on a new legacy random.
mthNextInt()
php
public static function mthNextInt(\pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $min, int $max) : intMth.nextInt(random, min, max): min if min >= max
shuffle()
php
public static function shuffle(array &$list, \pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random) : voidUtil.shuffle(list, random)
shuffled()
php
public static function shuffled(array $list, \pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random) : arrayUtil.shuffledCopy(list, random)
