mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
generation: drop AsyncWorker thread-local storage in favour of a more specialized storage
This commit is contained in:
@ -72,12 +72,13 @@ class PopulationTask extends AsyncTask{
|
||||
}
|
||||
|
||||
public function onRun() : void{
|
||||
$manager = $this->worker->getFromThreadStore("generation.world{$this->worldId}.manager");
|
||||
$generator = $this->worker->getFromThreadStore("generation.world{$this->worldId}.generator");
|
||||
if(!($manager instanceof SimpleChunkManager) or !($generator instanceof Generator)){
|
||||
$context = ThreadLocalGeneratorContext::fetch($this->worldId);
|
||||
if($context === null){
|
||||
$this->state = false;
|
||||
return;
|
||||
}
|
||||
$generator = $context->getGenerator();
|
||||
$manager = $context->getChunkManager();
|
||||
|
||||
/** @var Chunk[] $chunks */
|
||||
$chunks = [];
|
||||
|
Reference in New Issue
Block a user