populate remaining missing return types, using native returns where possible

this is done separately to stable so that stable changes can be integrated easily using an empty merge.
This commit is contained in:
Dylan K. Taylor
2020-01-19 10:26:35 +00:00
parent 3cf0b50b4a
commit 3ee6887792
17 changed files with 97 additions and 85 deletions

View File

@ -136,7 +136,7 @@ class Chest extends Spawnable implements Container, Nameable{
return $this->inventory;
}
protected function checkPairing(){
protected function checkPairing() : void{
if($this->isPaired() and !$this->pos->getWorld()->isInLoadedTerrain(new Vector3($this->pairX, $this->pos->y, $this->pairZ))){
//paired to a tile in an unloaded chunk
$this->doubleInventory = null;
@ -170,7 +170,7 @@ class Chest extends Spawnable implements Container, Nameable{
return "Chest";
}
public function isPaired(){
public function isPaired() : bool{
return $this->pairX !== null and $this->pairZ !== null;
}
@ -188,7 +188,7 @@ class Chest extends Spawnable implements Container, Nameable{
return null;
}
public function pairWith(Chest $tile){
public function pairWith(Chest $tile) : bool{
if($this->isPaired() or $tile->isPaired()){
return false;
}
@ -202,7 +202,7 @@ class Chest extends Spawnable implements Container, Nameable{
return true;
}
private function createPair(Chest $tile){
private function createPair(Chest $tile) : void{
$this->pairX = $tile->getPos()->x;
$this->pairZ = $tile->getPos()->z;
@ -210,7 +210,7 @@ class Chest extends Spawnable implements Container, Nameable{
$tile->pairZ = $this->getPos()->z;
}
public function unpair(){
public function unpair() : bool{
if(!$this->isPaired()){
return false;
}

View File

@ -120,7 +120,7 @@ class Furnace extends Spawnable implements Container, Nameable{
return $this->getInventory();
}
protected function checkFuel(Item $fuel){
protected function checkFuel(Item $fuel) : void{
$ev = new FurnaceBurnEvent($this, $fuel, $fuel->getFuelTime());
$ev->call();
if($ev->isCancelled()){