Hello, pmmp developers, Sorry if this question was already answered here, couldn't find a solution over all the forum I'm trying to fix lighting on my map. There many blocks that are dark despite the fact that there is a torch next to them. I want to recalculate lighting once and save the fixed map, but I can not succeed. I'm simply iterating over all blocks in some wrongly dark area: PHP: $lv = Server::getInstance()->getDefaultLevel(); for ($px = 80; $px <= 110; $px++) { echo "$px\n"; for ($py = 0; $py <= 120; $py++) { for ($pz = 80; $pz <= 110; $pz++) { $bId = $lv->getBlockIdAt($px, $py, $pz); //if ($bId != Block::AIR) { //shoud i recalculate light for air? $lv->updateAllLight(new Vector3($px, $py, $pz)); //} } } } But nothing changes! I assumed that maybe client do not see changes because chuks are already sent to him, but after "save-all" command and relogin to the server - still no changes What did I missed? Thank you in advance
That would not interfere with his code. Your code seems to be fine, check that it is really iterrating over the right coordinates.
Well, I've fixed my map Not sure if it was optimal, but anyway... Light was recalculated correctly after this code implemented to each block: PHP: $ll = $lv->getFullLight($pos); $lv->setBlockLightAt($px, $py, $pz, $ll); $lv->updateAllLight($pos); the trick is to get/set light level. That worked for me