LevelProvider: Remove redundant method requestChunkTask()

This removes one more dependency that LevelProvider has on Level.
This commit is contained in:
Dylan K. Taylor
2017-12-31 14:51:06 +00:00
parent 7264ce43ae
commit 8a3f8b4706
3 changed files with 8 additions and 25 deletions

View File

@ -23,8 +23,6 @@ declare(strict_types=1);
namespace pocketmine\level\format\io;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\ChunkException;
use pocketmine\level\generator\Generator;
use pocketmine\level\Level;
use pocketmine\level\LevelException;
@ -32,7 +30,6 @@ use pocketmine\math\Vector3;
use pocketmine\nbt\BigEndianNBTStream;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\scheduler\AsyncTask;
abstract class BaseLevelProvider implements LevelProvider{
/** @var Level */
@ -127,13 +124,4 @@ abstract class BaseLevelProvider implements LevelProvider{
$buffer = $nbt->writeCompressed();
file_put_contents($this->getPath() . "level.dat", $buffer);
}
public function requestChunkTask(int $x, int $z) : AsyncTask{
$chunk = $this->getChunk($x, $z, false);
if(!($chunk instanceof Chunk)){
throw new ChunkException("Invalid Chunk sent");
}
return new ChunkRequestTask($this->level, $chunk);
}
}