mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 00:09:39 +00:00
parent
5a17a0d1aa
commit
6afc689529
@ -146,7 +146,7 @@ class Bed extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
$time = $this->getLevel()->getTime() % Level::TIME_FULL;
|
||||
$time = $this->getLevel()->getTimeOfDay();
|
||||
|
||||
$isNight = ($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE);
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user