mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Added "view-distance" setting to change chunk sending radius
This commit is contained in:
parent
e88c337229
commit
dccfbfd572
2 changed files with 8 additions and 3 deletions
|
|
@ -107,10 +107,10 @@ class Player{
|
|||
asort($this->chunksOrder);
|
||||
}
|
||||
|
||||
public function getNextChunk(){
|
||||
public function getNextChunk($repeat = false){
|
||||
$c = key($this->chunksOrder);
|
||||
$d = $this->chunksOrder[$c];
|
||||
if($c === null or $d > 6){
|
||||
if($c === null or $d > $this->server->getProperty("view-distance")){
|
||||
$this->server->schedule(50, array($this, "getNextChunk"));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -139,7 +139,11 @@ class Player{
|
|||
$this->server->api->tileentity->spawnTo($tile["ID"], $this);
|
||||
}
|
||||
}
|
||||
$this->server->schedule(0.5, array($this, "getNextChunk"));
|
||||
if($repeat === false){
|
||||
$this->getNextChunk(true);
|
||||
}
|
||||
|
||||
$this->server->schedule(1, array($this, "getNextChunk"));
|
||||
}
|
||||
|
||||
public function onTick($time, $event){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue