mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +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;
|
$y = 0;
|
||||||
$itemParser = LegacyStringToItemParser::getInstance();
|
$itemParser = LegacyStringToItemParser::getInstance();
|
||||||
foreach($split as $line){
|
foreach($split as $line){
|
||||||
preg_match('#^(?:(\d+)[x|*])?(.+)$#', $line, $matches);
|
if(preg_match('#^(?:(\d+)[x|*])?(.+)$#', $line, $matches) !== 1){
|
||||||
if(count($matches) !== 3){
|
|
||||||
throw new InvalidGeneratorOptionsException("Invalid preset layer \"$line\"");
|
throw new InvalidGeneratorOptionsException("Invalid preset layer \"$line\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,10 +126,10 @@ class Normal extends Generator{
|
|||||||
$hash = (int) $hash;
|
$hash = (int) $hash;
|
||||||
$xNoise = $hash >> 20 & 3;
|
$xNoise = $hash >> 20 & 3;
|
||||||
$zNoise = $hash >> 22 & 3;
|
$zNoise = $hash >> 22 & 3;
|
||||||
if($xNoise == 3){
|
if($xNoise === 3){
|
||||||
$xNoise = 1;
|
$xNoise = 1;
|
||||||
}
|
}
|
||||||
if($zNoise == 3){
|
if($zNoise === 3){
|
||||||
$zNoise = 1;
|
$zNoise = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user