World: fix time sync

This commit is contained in:
Dylan K. Taylor 2020-05-04 11:23:44 +01:00
parent aac017eae4
commit d40152e3bb

View File

@ -629,6 +629,9 @@ class World implements ChunkManager{
* @param Player ...$targets If empty, will send to all players in the world. * @param Player ...$targets If empty, will send to all players in the world.
*/ */
public function sendTime(Player ...$targets) : void{ public function sendTime(Player ...$targets) : void{
if(count($targets) === 0){
$targets = $this->players;
}
foreach($targets as $player){ foreach($targets as $player){
$player->getNetworkSession()->syncWorldTime($this->time); $player->getNetworkSession()->syncWorldTime($this->time);
} }