mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
World: do not hardcode length of day in computeSunAnglePercentage()
This commit is contained in:
parent
4dbac79e86
commit
8b1bd5b7ff
@ -1273,7 +1273,7 @@ class World implements ChunkManager{
|
|||||||
* get an angle in radians, or by 360 to get an angle in degrees.
|
* get an angle in radians, or by 360 to get an angle in degrees.
|
||||||
*/
|
*/
|
||||||
public function computeSunAnglePercentage() : float{
|
public function computeSunAnglePercentage() : float{
|
||||||
$timeProgress = ($this->time % 24000) / 24000;
|
$timeProgress = ($this->time % self::TIME_FULL) / self::TIME_FULL;
|
||||||
|
|
||||||
//0.0 needs to be high noon, not dusk
|
//0.0 needs to be high noon, not dusk
|
||||||
$sunProgress = $timeProgress + ($timeProgress < 0.25 ? 0.75 : -0.25);
|
$sunProgress = $timeProgress + ($timeProgress < 0.25 ? 0.75 : -0.25);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user