mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fixed other invisibility issues
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user