mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Packet broadcast to players
This commit is contained in:
parent
b9e3acd017
commit
48b5afac46
3 changed files with 19 additions and 9 deletions
|
|
@ -63,14 +63,17 @@ class Level{
|
|||
}
|
||||
|
||||
public function checkThings(){
|
||||
$players = $this->server->api->player->getAll($this);
|
||||
$now = microtime(true);
|
||||
$time = $this->startTime + ($now - $this->startCheck) * 20;
|
||||
if($this->server->api->dhandle("time.change", array("level" => $this, "time" => $time)) !== false){
|
||||
$this->time = $time;
|
||||
$this->server->api->player->broadcastPacket($players, MC_SET_TIME, array(
|
||||
"time" => $this->time,
|
||||
));
|
||||
}
|
||||
|
||||
if(count($this->changedCount) > 0){
|
||||
$players = $this->server->api->player->getAll($this);
|
||||
arsort($this->changedCount);
|
||||
$resendChunks = array();
|
||||
foreach($this->changedCount as $index => $count){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue