mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Changing code parts [Hey! Don't look here!]
This commit is contained in:
parent
eebbc263b0
commit
8d3ad0c5ec
7 changed files with 74 additions and 51 deletions
|
|
@ -26,13 +26,20 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
*/
|
||||
|
||||
class TickLoop extends Thread{
|
||||
var $stop = false, $lastTick = 0;
|
||||
var $tick = false, $stop = false, $lastTick = 0;
|
||||
private $server;
|
||||
public function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
}
|
||||
public function run(){
|
||||
while($this->stop !== true){
|
||||
usleep(1);
|
||||
$time = microtime(true);
|
||||
if($this->lastTick <= ($time - 0.05)){
|
||||
$this->lastTick = $time;
|
||||
$this->tick = true;
|
||||
$this->wait();
|
||||
$this->tick = false;
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue