mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
BaseLevelProvider: Remove obsolete proxy methods
This commit is contained in:
parent
be190fc41b
commit
e6fb6b1f27
@ -23,8 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\world\format\io;
|
namespace pocketmine\world\format\io;
|
||||||
|
|
||||||
use pocketmine\world\format\Chunk;
|
|
||||||
use pocketmine\world\format\io\exception\CorruptedChunkException;
|
|
||||||
use pocketmine\world\format\io\exception\CorruptedWorldException;
|
use pocketmine\world\format\io\exception\CorruptedWorldException;
|
||||||
use pocketmine\world\format\io\exception\UnsupportedWorldFormatException;
|
use pocketmine\world\format\io\exception\UnsupportedWorldFormatException;
|
||||||
use pocketmine\world\WorldException;
|
use pocketmine\world\WorldException;
|
||||||
@ -58,22 +56,4 @@ abstract class BaseWorldProvider implements WorldProvider{
|
|||||||
public function getWorldData() : WorldData{
|
public function getWorldData() : WorldData{
|
||||||
return $this->worldData;
|
return $this->worldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws CorruptedChunkException
|
|
||||||
*/
|
|
||||||
public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
|
||||||
return $this->readChunk($chunkX, $chunkZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function saveChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{
|
|
||||||
$this->writeChunk($chunkX, $chunkZ, $chunk);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws CorruptedChunkException
|
|
||||||
*/
|
|
||||||
abstract protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk;
|
|
||||||
|
|
||||||
abstract protected function writeChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void;
|
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
|
|||||||
/**
|
/**
|
||||||
* @throws CorruptedChunkException
|
* @throws CorruptedChunkException
|
||||||
*/
|
*/
|
||||||
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
||||||
$index = LevelDB::chunkIndex($chunkX, $chunkZ);
|
$index = LevelDB::chunkIndex($chunkX, $chunkZ);
|
||||||
|
|
||||||
$chunkVersionRaw = $this->db->get($index . self::TAG_VERSION);
|
$chunkVersionRaw = $this->db->get($index . self::TAG_VERSION);
|
||||||
@ -418,7 +418,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
|
|||||||
return $chunk;
|
return $chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{
|
public function saveChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{
|
||||||
$idMap = LegacyBlockIdToStringIdMap::getInstance();
|
$idMap = LegacyBlockIdToStringIdMap::getInstance();
|
||||||
$index = LevelDB::chunkIndex($chunkX, $chunkZ);
|
$index = LevelDB::chunkIndex($chunkX, $chunkZ);
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
|
|||||||
/**
|
/**
|
||||||
* @throws CorruptedChunkException
|
* @throws CorruptedChunkException
|
||||||
*/
|
*/
|
||||||
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
||||||
$regionX = $regionZ = null;
|
$regionX = $regionZ = null;
|
||||||
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
||||||
assert(is_int($regionX) and is_int($regionZ));
|
assert(is_int($regionX) and is_int($regionZ));
|
||||||
@ -224,7 +224,7 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{
|
public function saveChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{
|
||||||
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
||||||
$this->loadRegion($regionX, $regionZ)->writeChunk($chunkX & 0x1f, $chunkZ & 0x1f, $this->serializeChunk($chunk));
|
$this->loadRegion($regionX, $regionZ)->writeChunk($chunkX & 0x1f, $chunkZ & 0x1f, $this->serializeChunk($chunk));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user