mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Merge branch 'stable'
This commit is contained in:
commit
bda3631c24
@ -29,7 +29,7 @@ namespace pocketmine\world\generator;
|
||||
use pocketmine\utils\Random;
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\world\ChunkManager;
|
||||
use function ctype_digit;
|
||||
use function preg_match;
|
||||
|
||||
abstract class Generator{
|
||||
|
||||
@ -43,7 +43,7 @@ abstract class Generator{
|
||||
public static function convertSeed(string $seed) : ?int{
|
||||
if($seed === ""){ //empty seed should cause a random seed to be selected - can't use 0 here because 0 is a valid seed
|
||||
$convertedSeed = null;
|
||||
}elseif(ctype_digit($seed)){ //this avoids treating seeds like "404.4" as integer seeds
|
||||
}elseif(preg_match('/^-?\d+$/', $seed) === 1){ //this avoids treating seeds like "404.4" as integer seeds
|
||||
$convertedSeed = (int) $seed;
|
||||
}else{
|
||||
$convertedSeed = Utils::javaStringHash($seed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user