mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Default Generator Presets
This commit is contained in:
parent
e0c245d86e
commit
fbfbd53204
4 changed files with 53 additions and 19 deletions
|
|
@ -306,8 +306,8 @@ class PocketMinecraftServer extends stdClass{
|
|||
public function tick(){
|
||||
$time = microtime(true);
|
||||
if($this->lastTick <= ($time - 0.05)){
|
||||
$this->tickMeasure[] = $this->lastTick = $time;
|
||||
array_shift($this->tickMeasure);
|
||||
$this->tickMeasure[] = $this->lastTick = $time;
|
||||
$this->tickerFunction($time);
|
||||
$this->trigger("onTick", $time);
|
||||
}
|
||||
|
|
@ -427,11 +427,14 @@ class PocketMinecraftServer extends stdClass{
|
|||
}
|
||||
|
||||
public function process(){
|
||||
$cnt = 0;
|
||||
while($this->stop === false){
|
||||
$packet = @$this->interface->readPacket();
|
||||
if($packet !== false){
|
||||
if($packet !== false and $cnt < 20){
|
||||
$this->packetHandler($packet);
|
||||
++$cnt;
|
||||
}else{
|
||||
$cnt = 0;
|
||||
usleep(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue