22declare(strict_types=1);
32use
function preg_match;
41 $convertedSeed =
null;
42 }elseif(preg_match(
'/^-?\d+$/', $seed) === 1){
43 $convertedSeed = (int) $seed;
45 $convertedSeed = Utils::javaStringHash($seed);
48 return $convertedSeed;
51 protected Random $random;
53 public function __construct(
55 protected string $preset
57 $this->random =
new Random($seed);
60 abstract public function generateChunk(ChunkManager $world,
int $chunkX,
int $chunkZ) : void;
62 abstract public function populateChunk(ChunkManager $world,
int $chunkX,
int $chunkZ) : void;
static convertSeed(string $seed)