From 5f7b0994b9426c2218bc35f1921b84c6e245f0bd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 31 Oct 2020 16:47:34 +0000 Subject: [PATCH] World: rename get(HighestAdjacent)BlockSkyLight(At) to make it clear these are **potentials**, not the actual light level --- src/world/World.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/world/World.php b/src/world/World.php index 8e3526832..74342b68d 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1195,7 +1195,7 @@ class World implements ChunkManager{ * @return int 0-15 */ public function getRealBlockSkyLightAt(int $x, int $y, int $z) : int{ - $light = $this->getBlockSkyLightAt($x, $y, $z) - $this->skyLightReduction; + $light = $this->getPotentialBlockSkyLightAt($x, $y, $z) - $this->skyLightReduction; return $light < 0 ? 0 : $light; } @@ -1219,7 +1219,7 @@ class World implements ChunkManager{ /** * Returns the highest block light level available in the positions adjacent to the specified block coordinates. */ - public function getHighestAdjacentBlockSkyLight(int $x, int $y, int $z) : int{ + public function getHighestAdjacentPotentialBlockSkyLight(int $x, int $y, int $z) : int{ $max = 0; foreach([ [$x + 1, $y, $z], @@ -1236,7 +1236,7 @@ class World implements ChunkManager{ ){ continue; } - $max = max($max, $this->getBlockSkyLightAt($x1, $y1, $z1)); + $max = max($max, $this->getPotentialBlockSkyLightAt($x1, $y1, $z1)); } return $max; } @@ -1246,7 +1246,7 @@ class World implements ChunkManager{ * 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; + return $this->getHighestAdjacentPotentialBlockSkyLight($x, $y, $z) - $this->skyLightReduction; } /** @@ -1838,7 +1838,7 @@ class World implements ChunkManager{ * * @return int 0-15 */ - public function getBlockSkyLightAt(int $x, int $y, int $z) : int{ + public function getPotentialBlockSkyLightAt(int $x, int $y, int $z) : int{ return $this->getOrLoadChunk($x >> 4, $z >> 4, true)->getSubChunk($y >> 4)->getBlockSkyLightArray()->get($x & 0x0f, $y & 0xf, $z & 0x0f); }