mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-26 21:03:45 +00:00
cleanup some chunks leftovers from 1.0
This commit is contained in:
parent
5640bcb0b8
commit
2fd61163bf
@ -1004,11 +1004,6 @@ class Chunk{
|
|||||||
return $chunk;
|
return $chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: get rid of this
|
|
||||||
public static function getEmptyChunk(int $x, int $z) : Chunk{
|
|
||||||
return new Chunk($x, $z);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a block hash from chunk block coordinates. Used for extra data keys in chunk packets.
|
* Creates a block hash from chunk block coordinates. Used for extra data keys in chunk packets.
|
||||||
* @internal
|
* @internal
|
||||||
|
@ -298,7 +298,7 @@ class LevelDB extends BaseLevelProvider{
|
|||||||
$this->level->timings->syncChunkLoadDataTimer->startTiming();
|
$this->level->timings->syncChunkLoadDataTimer->startTiming();
|
||||||
$chunk = $this->readChunk($chunkX, $chunkZ);
|
$chunk = $this->readChunk($chunkX, $chunkZ);
|
||||||
if($chunk === null and $create){
|
if($chunk === null and $create){
|
||||||
$chunk = Chunk::getEmptyChunk($chunkX, $chunkZ);
|
$chunk = new Chunk($chunkX, $chunkZ);
|
||||||
}
|
}
|
||||||
$this->level->timings->syncChunkLoadDataTimer->stopTiming();
|
$this->level->timings->syncChunkLoadDataTimer->stopTiming();
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ class McRegion extends BaseLevelProvider{
|
|||||||
/** @noinspection PhpStrictTypeCheckingInspection */
|
/** @noinspection PhpStrictTypeCheckingInspection */
|
||||||
$chunk = $this->getRegion($regionX, $regionZ)->readChunk($chunkX - $regionX * 32, $chunkZ - $regionZ * 32);
|
$chunk = $this->getRegion($regionX, $regionZ)->readChunk($chunkX - $regionX * 32, $chunkZ - $regionZ * 32);
|
||||||
if($chunk === null and $create){
|
if($chunk === null and $create){
|
||||||
$chunk = $this->getEmptyChunk($chunkX, $chunkZ);
|
$chunk = new Chunk($chunkX, $chunkZ);
|
||||||
}
|
}
|
||||||
$this->level->timings->syncChunkLoadDataTimer->stopTiming();
|
$this->level->timings->syncChunkLoadDataTimer->stopTiming();
|
||||||
|
|
||||||
@ -418,16 +418,6 @@ class McRegion extends BaseLevelProvider{
|
|||||||
$z = $chunkZ >> 5;
|
$z = $chunkZ >> 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $chunkX
|
|
||||||
* @param int $chunkZ
|
|
||||||
*
|
|
||||||
* @return Chunk
|
|
||||||
*/
|
|
||||||
public function getEmptyChunk(int $chunkX, int $chunkZ) : Chunk{
|
|
||||||
return Chunk::getEmptyChunk($chunkX, $chunkZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $z
|
* @param int $z
|
||||||
|
@ -78,7 +78,7 @@ class PopulationTask extends AsyncTask{
|
|||||||
$zz = -1 + (int) ($i / 3);
|
$zz = -1 + (int) ($i / 3);
|
||||||
$ck = $this->{"chunk$i"};
|
$ck = $this->{"chunk$i"};
|
||||||
if($ck === null){
|
if($ck === null){
|
||||||
$chunks[$i] = Chunk::getEmptyChunk($chunk->getX() + $xx, $chunk->getZ() + $zz);
|
$chunks[$i] = new Chunk($chunk->getX() + $xx, $chunk->getZ() + $zz);
|
||||||
}else{
|
}else{
|
||||||
$chunks[$i] = Chunk::fastDeserialize($ck);
|
$chunks[$i] = Chunk::fastDeserialize($ck);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user