mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Better time ticking and sync (#2)
* Remove unnecessary SetTimePacket spam This is handled automatically client-side, as long as it is calculated correctly server side there is no issue (unless the server hits a spot of bad lag) * Better client/server time sync when lagging
This commit is contained in:
parent
5f26c21b9f
commit
e9f2bf0085
@ -156,8 +156,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
private $cacheChunks = false;
|
private $cacheChunks = false;
|
||||||
|
|
||||||
private $sendTimeTicker = 0;
|
|
||||||
|
|
||||||
/** @var Server */
|
/** @var Server */
|
||||||
private $server;
|
private $server;
|
||||||
|
|
||||||
@ -612,7 +610,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
if($this->stopTime === true){
|
if($this->stopTime === true){
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
$this->time += 1;
|
$this->time += $this->tickRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,11 +639,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
$this->checkTime();
|
$this->checkTime();
|
||||||
|
|
||||||
if(++$this->sendTimeTicker === 200){
|
|
||||||
$this->sendTime();
|
|
||||||
$this->sendTimeTicker = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->unloadChunks();
|
$this->unloadChunks();
|
||||||
|
|
||||||
//Do block updates
|
//Do block updates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user