mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
@ -936,7 +936,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
if($resetTime){
|
||||
$time = $this->getTime() % Level::TIME_FULL;
|
||||
$time = $this->getTimeOfDay();
|
||||
|
||||
if($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE){
|
||||
$this->setTime($this->getTime() + Level::TIME_FULL - $time);
|
||||
@ -3005,6 +3005,15 @@ class Level implements ChunkManager, Metadatable{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current time of day
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTimeOfDay() : int{
|
||||
return $this->time % self::TIME_FULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Level name
|
||||
*
|
||||
|
Reference in New Issue
Block a user