Fixed other invisibility issues

This commit is contained in:
Shoghi Cervantes
2015-06-04 16:51:48 +02:00
parent 05dbf7b47f
commit 71490f60f2
8 changed files with 32 additions and 22 deletions

View File

@ -2191,7 +2191,7 @@ class Level implements ChunkManager, Metadatable{
}
$this->timings->syncChunkSendPrepareTimer->startTiming();
$task = $this->provider->requestChunkTask($x, $z);
if($task instanceof AsyncTask){
if($task !== null){
$this->server->getScheduler()->scheduleAsyncTask($task);
}
$this->timings->syncChunkSendPrepareTimer->stopTiming();
@ -2582,9 +2582,9 @@ class Level implements ChunkManager, Metadatable{
return false;
}
Timings::$populationTimer->startTiming();
$chunk = $this->getChunk($x, $z, true);
if(!$chunk->isPopulated()){
Timings::$populationTimer->startTiming();
$populate = true;
for($xx = -1; $xx <= 1; ++$xx){
for($zz = -1; $zz <= 1; ++$zz){
@ -2606,14 +2606,12 @@ class Level implements ChunkManager, Metadatable{
$task = new PopulationTask($this, $chunk);
$this->server->getScheduler()->scheduleAsyncTask($task);
}
Timings::$populationTimer->stopTiming();
return false;
}
Timings::$populationTimer->stopTiming();
return false;
}
Timings::$populationTimer->stopTiming();
return true;
}

View File

@ -120,14 +120,21 @@ class McRegion extends BaseLevelProvider{
}
$tiles = "";
$nbt = new NBT(NBT::LITTLE_ENDIAN);
foreach($chunk->getTiles() as $tile){
if($tile instanceof Spawnable){
$nbt->setData($tile->getSpawnCompound());
$tiles .= $nbt->write();
if(count($chunk->getTiles()) > 0){
$nbt = new NBT(NBT::LITTLE_ENDIAN);
$list = [];
foreach($chunk->getTiles() as $tile){
if($tile instanceof Spawnable){
$list[] = $tile->getSpawnCompound();
}
}
$nbt->setData($list);
$tiles = $nbt->write();
}
$heightmap = pack("C*", ...$chunk->getHeightMapArray());
$biomeColors = pack("N*", ...$chunk->getBiomeColorArray());