Skip to content

Commit

Permalink
level/light: populate missing return type information
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 19, 2020
1 parent facca13 commit 31e8efa
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/pocketmine/level/light/LightUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,24 @@ public function __construct(ChunkManager $level){

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

/**
* @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){
$this->updateNodes[Level::blockHash($x, $y, $z)] = [$x, $y, $z, $newLevel];
}
Expand All @@ -84,6 +100,9 @@ private function prepareNodes() : void{
}
}

/**
* @return void
*/
public function execute(){
$this->prepareNodes();

Expand Down Expand Up @@ -137,6 +156,14 @@ public function execute(){
}
}

/**
* @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){
$current = $this->getLight($x, $y, $z);

Expand All @@ -157,6 +184,14 @@ protected function computeRemoveLight(int $x, int $y, int $z, int $oldAdjacentLe
}
}

/**
* @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){
$current = $this->getLight($x, $y, $z);
$potentialLight = $newAdjacentLevel - BlockFactory::$lightFilter[$this->subChunkHandler->currentSubChunk->getBlockId($x & 0x0f, $y & 0x0f, $z & 0x0f)];
Expand Down

0 comments on commit 31e8efa

Please sign in to comment.