mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
light population is now optional via pocketmine.yml
This commit is contained in:
parent
c578898aa4
commit
3bb037204e
@ -2300,7 +2300,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$chunk->isLightPopulated() and $chunk->isPopulated()){
|
if(!$chunk->isLightPopulated() and $chunk->isPopulated() and $this->getServer()->getProperty("chunk-ticking.light-updates", false)){
|
||||||
$this->getServer()->getScheduler()->scheduleAsyncTask(new LightPopulationTask($this, $chunk));
|
$this->getServer()->getScheduler()->scheduleAsyncTask(new LightPopulationTask($this, $chunk));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ chunk-ticking:
|
|||||||
per-tick: 40
|
per-tick: 40
|
||||||
#Radius of chunks around a player to tick
|
#Radius of chunks around a player to tick
|
||||||
tick-radius: 3
|
tick-radius: 3
|
||||||
#NOTE: This is currently not implemented
|
|
||||||
light-updates: false
|
light-updates: false
|
||||||
clear-tick-list: false
|
clear-tick-list: false
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@ class Config{
|
|||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
private $config = [];
|
private $config = [];
|
||||||
|
|
||||||
|
private $nestedCache = [];
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $file;
|
private $file;
|
||||||
/** @var boolean */
|
/** @var boolean */
|
||||||
@ -83,6 +86,7 @@ class Config{
|
|||||||
*/
|
*/
|
||||||
public function reload(){
|
public function reload(){
|
||||||
$this->config = [];
|
$this->config = [];
|
||||||
|
$this->nestedCache = [];
|
||||||
$this->correct = false;
|
$this->correct = false;
|
||||||
$this->load($this->file);
|
$this->load($this->file);
|
||||||
$this->load($this->file, $this->type);
|
$this->load($this->file, $this->type);
|
||||||
@ -273,6 +277,7 @@ class Config{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$base = $value;
|
$base = $value;
|
||||||
|
$this->nestedCache[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -282,6 +287,10 @@ class Config{
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getNested($key, $default = null){
|
public function getNested($key, $default = null){
|
||||||
|
if(isset($this->nestedCache[$key])){
|
||||||
|
return $this->nestedCache[$key];
|
||||||
|
}
|
||||||
|
|
||||||
$vars = explode(".", $key);
|
$vars = explode(".", $key);
|
||||||
$base = array_shift($vars);
|
$base = array_shift($vars);
|
||||||
if(isset($this->config[$base])){
|
if(isset($this->config[$base])){
|
||||||
@ -299,7 +308,7 @@ class Config{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $base;
|
return $this->nestedCache[$key] = $base;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user