This commit is contained in:
GameHerobrine 2023-07-03 07:54:57 +03:00
parent c12f48b84b
commit 457eee1157
5 changed files with 15 additions and 15 deletions

View file

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

View file

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

View file

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

View file

@ -173,7 +173,7 @@ class PMFLevel extends PMF{
return true;
}
public function getSeed(){
public function getSeed(): int{
return $this->levelData["seed"];
}

View file

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