diff --git a/src/math/Matrix.php b/src/math/Matrix.php index a110517d..c62bbb98 100644 --- a/src/math/Matrix.php +++ b/src/math/Matrix.php @@ -21,7 +21,7 @@ class Matrix implements ArrayAccess{ } } - public function offsetExists(mixed $offset): mixed{ + public function offsetExists(mixed $offset): bool{ return isset($this->matrix[(int) $offset]); } @@ -29,11 +29,11 @@ class Matrix implements ArrayAccess{ return $this->matrix[(int) $offset]; } - public function offsetSet(mixed $offset, mixed $value): mixed{ + public function offsetSet(mixed $offset, mixed $value): void{ $this->matrix[(int) $offset] = $value; } - public function offsetUnset(mixed $offset): mixed{ + public function offsetUnset(mixed $offset): void{ unset($this->matrix[(int) $offset]); } diff --git a/src/nbt/tag/Compound.php b/src/nbt/tag/Compound.php index 13050f01..fa08fb92 100644 --- a/src/nbt/tag/Compound.php +++ b/src/nbt/tag/Compound.php @@ -28,7 +28,7 @@ class Compound extends NamedTag implements \ArrayAccess{ } } - public function offsetExists(mixed $offset): mixed{ + public function offsetExists(mixed $offset): bool{ return isset($this->{$offset}); } @@ -44,7 +44,7 @@ class Compound extends NamedTag implements \ArrayAccess{ return null; } - public function offsetSet(mixed $offset, mixed $value): mixed{ + public function offsetSet(mixed $offset, mixed $value): void{ if($value instanceof Tag){ $this->{$offset} = $value; }elseif(isset($this->{$offset}) and $this->{$offset} instanceof Tag){ @@ -52,7 +52,7 @@ class Compound extends NamedTag implements \ArrayAccess{ } } - public function offsetUnset(mixed $offset): mixed{ + public function offsetUnset(mixed $offset): void{ unset($this->{$offset}); } diff --git a/src/nbt/tag/EnumTag.php b/src/nbt/tag/EnumTag.php index 41aa8c45..52d15599 100644 --- a/src/nbt/tag/EnumTag.php +++ b/src/nbt/tag/EnumTag.php @@ -40,7 +40,7 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ return $value; } - public function offsetExists(mixed $offset): mixed{ + public function offsetExists(mixed $offset): bool{ return isset($this->{$offset}); } @@ -56,7 +56,7 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ return null; } - public function offsetSet(mixed $offset, mixed $value): mixed{ + public function offsetSet(mixed $offset, mixed $value): void{ if($value instanceof Tag){ $this->{$offset} = $value; }elseif($this->{$offset} instanceof Tag){ @@ -64,11 +64,11 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ } } - public function offsetUnset(mixed $offset): mixed{ + public function offsetUnset(mixed $offset): void{ unset($this->{$offset}); } - public function count(mixed $mode = COUNT_NORMAL): mixed{ + public function count(mixed $mode = COUNT_NORMAL): int{ for($i = 0; true; $i++){ if(!isset($this->{$i})){ return $i; diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index 86e26c90..7d95c1eb 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -173,7 +173,7 @@ class PMFLevel extends PMF{ return true; } - public function getSeed(){ + public function getSeed(): int{ return $this->levelData["seed"]; } diff --git a/src/world/generator/ExperimentalGenerator.php b/src/world/generator/ExperimentalGenerator.php index e1fc316e..676edd6c 100644 --- a/src/world/generator/ExperimentalGenerator.php +++ b/src/world/generator/ExperimentalGenerator.php @@ -87,11 +87,11 @@ class ExperimentalGenerator implements NewLevelGenerator{ $this->populators[] = $tallGrass; } - public function pickBiome($x, $z){ - $hash = (int) ($x * 2345803 ^ $z * 9236449 ^ $this->level->level->getSeed()); + public function pickBiome(int $x, int $z){ + $hash = $x * 2345803 ^ $z * 9236449 ^ $this->level->level->getSeed(); $hash *= $hash + 223; - $xNoise = ((int)$hash) >> 20 & 3; - $zNoise = ((int)$hash) >> 22 & 3; + $xNoise = $hash >> 20 & 3; + $zNoise = $hash >> 22 & 3; if($xNoise == 3){ $xNoise = 1; }