Avoid implicit integer cast in Normal::pickBiome()

this throws deprecation warnings on PHP 8.1.
This commit is contained in:
Dylan K. Taylor 2022-08-20 17:16:38 +01:00
parent 98778052bb
commit c13170a00b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,7 @@ class Normal extends Generator{
private function pickBiome(int $x, int $z) : Biome{
$hash = $x * 2345803 ^ $z * 9236449 ^ $this->seed;
$hash *= $hash + 223;
$hash = (int) $hash;
$xNoise = $hash >> 20 & 3;
$zNoise = $hash >> 22 & 3;
if($xNoise == 3){

View File

@ -80,3 +80,8 @@ parameters:
count: 2
path: ../../../src/world/format/io/region/RegionLoader.php
-
message: "#^Casting to int something that's already int\\.$#"
count: 1
path: ../../../src/world/generator/normal/Normal.php