diff --git a/src/block/FrostedIce.php b/src/block/FrostedIce.php index 9d957d5fc..e28ba8427 100644 --- a/src/block/FrostedIce.php +++ b/src/block/FrostedIce.php @@ -60,7 +60,7 @@ class FrostedIce extends Ice{ 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()->getHighestAdjacentBlockSkyLight($this->pos->x, $this->pos->y, $this->pos->z) - $this->pos->getWorld()->getSkyLightReduction() + $this->pos->getWorld()->getHighestAdjacentRealBlockSkyLight($this->pos->x, $this->pos->y, $this->pos->z) ) >= 12 - $this->age){ if($this->tryMelt()){ foreach($this->getAllSides() as $block){ diff --git a/src/world/World.php b/src/world/World.php index 8bfa1cf10..8e3526832 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1241,6 +1241,14 @@ class World implements ChunkManager{ return $max; } + /** + * Returns the highest block sky light available in the positions adjacent to the given coordinates, adjusted for + * the world's current time of day and weather conditions. + */ + public function getHighestAdjacentRealBlockSkyLight(int $x, int $y, int $z) : int{ + return $this->getHighestAdjacentBlockSkyLight($x, $y, $z) - $this->skyLightReduction; + } + /** * Returns the highest block light level available in the positions adjacent to the specified block coordinates. */