level/light: populate missing return type information

This commit is contained in:
Dylan K. Taylor 2020-01-19 18:06:31 +00:00
parent facca13139
commit 31e8efa6d1

View File

@ -59,8 +59,24 @@ abstract class LightUpdate{
abstract protected function getLight(int $x, int $y, int $z) : int; abstract protected function getLight(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $level
*
* @return void
*/
abstract protected function setLight(int $x, int $y, int $z, int $level); abstract protected function setLight(int $x, int $y, int $z, int $level);
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $newLevel
*
* @return void
*/
public function setAndUpdateLight(int $x, int $y, int $z, int $newLevel){ public function setAndUpdateLight(int $x, int $y, int $z, int $newLevel){
$this->updateNodes[Level::blockHash($x, $y, $z)] = [$x, $y, $z, $newLevel]; $this->updateNodes[Level::blockHash($x, $y, $z)] = [$x, $y, $z, $newLevel];
} }
@ -84,6 +100,9 @@ abstract class LightUpdate{
} }
} }
/**
* @return void
*/
public function execute(){ public function execute(){
$this->prepareNodes(); $this->prepareNodes();
@ -137,6 +156,14 @@ abstract class LightUpdate{
} }
} }
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $oldAdjacentLevel
*
* @return void
*/
protected function computeRemoveLight(int $x, int $y, int $z, int $oldAdjacentLevel){ protected function computeRemoveLight(int $x, int $y, int $z, int $oldAdjacentLevel){
$current = $this->getLight($x, $y, $z); $current = $this->getLight($x, $y, $z);
@ -157,6 +184,14 @@ abstract class LightUpdate{
} }
} }
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $newAdjacentLevel
*
* @return void
*/
protected function computeSpreadLight(int $x, int $y, int $z, int $newAdjacentLevel){ protected function computeSpreadLight(int $x, int $y, int $z, int $newAdjacentLevel){
$current = $this->getLight($x, $y, $z); $current = $this->getLight($x, $y, $z);
$potentialLight = $newAdjacentLevel - BlockFactory::$lightFilter[$this->subChunkHandler->currentSubChunk->getBlockId($x & 0x0f, $y & 0x0f, $z & 0x0f)]; $potentialLight = $newAdjacentLevel - BlockFactory::$lightFilter[$this->subChunkHandler->currentSubChunk->getBlockId($x & 0x0f, $y & 0x0f, $z & 0x0f)];