mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
AsyncWorker IDs now start from 0 instead of 1
this now matches their IDs in the AsyncWorker pool, as used by submitTask().
This commit is contained in:
parent
8704d378d4
commit
3be6665e3d
@ -139,7 +139,7 @@ class PopulationTask extends AsyncTask{
|
||||
$level = $server->getLevel($this->levelId);
|
||||
if($level !== null){
|
||||
if(!$this->state){
|
||||
$level->registerGeneratorToWorker($this->worker->getAsyncWorkerId() - 1);
|
||||
$level->registerGeneratorToWorker($this->worker->getAsyncWorkerId());
|
||||
}
|
||||
|
||||
$chunk = Chunk::fastDeserialize($this->chunk);
|
||||
|
@ -131,7 +131,7 @@ class AsyncPool{
|
||||
private function getWorker(int $worker) : AsyncWorker{
|
||||
if(!isset($this->workers[$worker])){
|
||||
$this->workerUsage[$worker] = 0;
|
||||
$this->workers[$worker] = new AsyncWorker($this->logger, $worker + 1, $this->workerMemoryLimit);
|
||||
$this->workers[$worker] = new AsyncWorker($this->logger, $worker, $this->workerMemoryLimit);
|
||||
$this->workers[$worker]->setClassLoader($this->classLoader);
|
||||
$this->workers[$worker]->start(self::WORKER_START_OPTIONS);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user