Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2019-07-05 19:21:49 +01:00
commit bda3631c24

View File

@ -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);