World: added getHighestAdjacentFullLightAt()

This commit is contained in:
Dylan K. Taylor
2021-04-18 20:20:08 +01:00
parent 51b0685881
commit 53ebe4f9f9
3 changed files with 12 additions and 22 deletions

View File

@ -69,10 +69,7 @@ class FrostedIce extends Ice{
public function onRandomTick() : void{
if((!$this->checkAdjacentBlocks(4) or mt_rand(0, 2) === 0) and
max( //TODO: move this to World
$this->pos->getWorld()->getHighestAdjacentBlockLight($this->pos->x, $this->pos->y, $this->pos->z),
$this->pos->getWorld()->getHighestAdjacentRealBlockSkyLight($this->pos->x, $this->pos->y, $this->pos->z)
) >= 12 - $this->age){
$this->pos->getWorld()->getHighestAdjacentFullLightAt($this->pos->x, $this->pos->y, $this->pos->z) >= 12 - $this->age){
if($this->tryMelt()){
foreach($this->getAllSides() as $block){
if($block instanceof FrostedIce){