generator: fixup issues reported by PHPStan 2.0

This commit is contained in:
Dylan K. Taylor 2025-01-07 22:07:38 +00:00
parent 28d31c97f8
commit 7b1b35ab1f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 3 additions and 4 deletions

View File

@ -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\"");
}

View File

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