Skip to content

StructureRandom 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\StructureRandom · source

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) : int

Mth.randomBetweenInclusive / RandomSource.nextIntBetweenInclusive

largeFeature() ​

php
public static function largeFeature(int $levelSeed, int $chunkX, int $chunkZ) : \pocketmine\world\generator\vanilla\random\LegacyRandom

WorldgenRandom.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\LegacyRandom

WorldgenRandom.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) : int

Mth.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) : void

Util.shuffle(list, random)

shuffled() ​

php
public static function shuffled(array $list, \pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random) : array

Util.shuffledCopy(list, random)

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.