mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
BlockLightUpdate: actually use lightEmitters
I accidentally added this during a separation of my local changes, but it's useful anyway, so we should use it. This removes BlockLightUpdate's implicit dependency on Block, which is a step towards native light.
This commit is contained in:
parent
205617f29e
commit
ec6ac59b9c
@ -50,7 +50,9 @@ class BlockLightUpdate extends LightUpdate{
|
||||
}
|
||||
|
||||
public function recalculateNode(int $x, int $y, int $z) : void{
|
||||
$block = $this->world->getBlockAt($x, $y, $z);
|
||||
$this->setAndUpdateLight($x, $y, $z, max($block->getLightLevel(), $this->getHighestAdjacentLight($x, $y, $z) - $this->lightFilters[$block->getFullId()]));
|
||||
if($this->subChunkHandler->moveTo($x, $y, $z, false)){
|
||||
$block = $this->subChunkHandler->currentSubChunk->getFullBlock($x & 0xf, $y & 0xf, $z & 0xf);
|
||||
$this->setAndUpdateLight($x, $y, $z, max($this->lightEmitters[$block], $this->getHighestAdjacentLight($x, $y, $z) - $this->lightFilters[$block]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -910,11 +910,21 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/world/light/BlockLightUpdate.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getFullBlock\\(\\) on pocketmine\\\\world\\\\format\\\\SubChunk\\|null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/light/BlockLightUpdate.php
|
||||
|
||||
-
|
||||
message: "#^Only numeric types are allowed in \\-, int\\|null given on the right side\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/light/BlockLightUpdate.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#4 \\$newLevel of method pocketmine\\\\world\\\\light\\\\LightUpdate\\:\\:setAndUpdateLight\\(\\) expects int, int\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/light/BlockLightUpdate.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method get\\(\\) on pocketmine\\\\world\\\\format\\\\LightArray\\|null\\.$#"
|
||||
count: 4
|
||||
|
Loading…
x
Reference in New Issue
Block a user