mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 15:01:19 +00:00
Avoid implicit integer cast in Normal::pickBiome()
this throws deprecation warnings on PHP 8.1.
This commit is contained in:
parent
98778052bb
commit
c13170a00b
@ -123,6 +123,7 @@ class Normal extends Generator{
|
|||||||
private function pickBiome(int $x, int $z) : Biome{
|
private function pickBiome(int $x, int $z) : Biome{
|
||||||
$hash = $x * 2345803 ^ $z * 9236449 ^ $this->seed;
|
$hash = $x * 2345803 ^ $z * 9236449 ^ $this->seed;
|
||||||
$hash *= $hash + 223;
|
$hash *= $hash + 223;
|
||||||
|
$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){
|
||||||
|
@ -80,3 +80,8 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: ../../../src/world/format/io/region/RegionLoader.php
|
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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user