mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
generator: fixup issues reported by PHPStan 2.0
This commit is contained in:
parent
28d31c97f8
commit
7b1b35ab1f
@ -75,8 +75,7 @@ final class FlatGeneratorOptions{
|
||||
$y = 0;
|
||||
$itemParser = LegacyStringToItemParser::getInstance();
|
||||
foreach($split as $line){
|
||||
preg_match('#^(?:(\d+)[x|*])?(.+)$#', $line, $matches);
|
||||
if(count($matches) !== 3){
|
||||
if(preg_match('#^(?:(\d+)[x|*])?(.+)$#', $line, $matches) !== 1){
|
||||
throw new InvalidGeneratorOptionsException("Invalid preset layer \"$line\"");
|
||||
}
|
||||
|
||||
|
@ -126,10 +126,10 @@ class Normal extends Generator{
|
||||
$hash = (int) $hash;
|
||||
$xNoise = $hash >> 20 & 3;
|
||||
$zNoise = $hash >> 22 & 3;
|
||||
if($xNoise == 3){
|
||||
if($xNoise === 3){
|
||||
$xNoise = 1;
|
||||
}
|
||||
if($zNoise == 3){
|
||||
if($zNoise === 3){
|
||||
$zNoise = 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user