mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-27 05:40:01 +00:00
Merge branch 'next-minor'
This commit is contained in:
commit
0273bd4f53
@ -145,7 +145,7 @@ class Bed extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
$time = $this->getWorld()->getTime() % World::TIME_FULL;
|
||||
$time = $this->getWorld()->getTimeOfDay();
|
||||
|
||||
$isNight = ($time >= World::TIME_NIGHT and $time < World::TIME_SUNRISE);
|
||||
|
||||
|
@ -887,7 +887,7 @@ class World implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
if($resetTime){
|
||||
$time = $this->getTime() % World::TIME_FULL;
|
||||
$time = $this->getTimeOfDay();
|
||||
|
||||
if($time >= World::TIME_NIGHT and $time < World::TIME_SUNRISE){
|
||||
$this->setTime($this->getTime() + World::TIME_FULL - $time);
|
||||
@ -2682,6 +2682,15 @@ class World 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 World display name.
|
||||
* WARNING: This is NOT guaranteed to be unique. Multiple worlds at runtime may share the same display name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user