Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-05-22 16:21:05 +01:00
30 changed files with 201 additions and 37 deletions

View File

@ -42,6 +42,7 @@ use pocketmine\world\utils\SubChunkExplorer;
use pocketmine\world\utils\SubChunkExplorerStatus;
use function ceil;
use function floor;
use function min;
use function mt_rand;
use function sqrt;
@ -90,9 +91,6 @@ class Explosion{
$blockFactory = BlockFactory::getInstance();
$currentChunk = null;
$currentSubChunk = null;
$mRays = $this->rays - 1;
for($i = 0; $i < $this->rays; ++$i){
for($j = 0; $j < $this->rays; ++$j){
@ -151,10 +149,8 @@ class Explosion{
* and creating sounds and particles.
*/
public function explodeB() : bool{
$updateBlocks = [];
$source = (new Vector3($this->source->x, $this->source->y, $this->source->z))->floor();
$yield = (1 / $this->size) * 100;
$yield = min(100, (1 / $this->size) * 100);
if($this->what instanceof Entity){
$ev = new EntityExplodeEvent($this->what, $this->source, $this->affectedBlocks, $yield);

View File

@ -114,6 +114,9 @@ abstract class LightUpdate{
$context->removalQueue->enqueue([$x, $y, $z, $oldLevel]);
}
}
}elseif($this->getEffectiveLight($x, $y, $z) > 0){ //outside the chunk (e.g. virtual sky light from y=256)
$context->spreadVisited[$blockHash] = true;
$context->spreadQueue->enqueue([$x, $y, $z]);
}
}
return $context;