Block light bug fixes (#454)

* Fixed an age-old light calculation bug causing solid blocks to filter their own light, fixed #375, probably fixed #288
Light spread reduction should be done based on the _target's_ light filter level, not the source.

* Revert "Fix Glowing Obsidian lighting"
This hack is no longer necessary.
This reverts commit 35c33ba980.

* Fixed wrong light levels for torch and redstone torch

* Take adjacent light levels and opacity changes into account, block light will now spread when an obstruction is removed, close #455

* Added timings for Level->setBlock() and lighting updates
This commit is contained in:
Dylan K. Taylor
2017-03-24 17:56:26 +00:00
committed by GitHub
parent 0750b3ab59
commit 5926bab323
5 changed files with 53 additions and 4 deletions

View File

@ -25,6 +25,13 @@ use pocketmine\level\Level;
class LevelTimings{
/** @var TimingsHandler */
public $setBlock;
/** @var TimingsHandler */
public $doBlockLightUpdates;
/** @var TimingsHandler */
public $doBlockSkyLightUpdates;
/** @var TimingsHandler */
public $mobSpawn;
/** @var TimingsHandler */
@ -79,6 +86,10 @@ class LevelTimings{
public function __construct(Level $level){
$name = $level->getFolderName() . " - ";
$this->setBlock = new TimingsHandler("** " . $name . "setBlock");
$this->doBlockLightUpdates = new TimingsHandler("** " . $name . "doBlockLightUpdates");
$this->doBlockSkyLightUpdates = new TimingsHandler("** " . $name . "doBlockSkyLightUpdates");
$this->mobSpawn = new TimingsHandler("** " . $name . "mobSpawn");
$this->doChunkUnload = new TimingsHandler("** " . $name . "doChunkUnload");
$this->doTickPending = new TimingsHandler("** " . $name . "doTickPending");