LevelProvider: Remove some dead methods

This commit is contained in:
Dylan K. Taylor 2017-12-31 16:28:19 +00:00
parent f17b3b2a3b
commit d19683b7dd
4 changed files with 0 additions and 50 deletions

View File

@ -70,14 +70,6 @@ abstract class BaseLevelProvider implements LevelProvider{
return $this->path; return $this->path;
} }
public function getServer(){
return $this->level->getServer();
}
public function getLevel() : Level{
return $this->level;
}
public function getName() : string{ public function getName() : string{
return $this->levelData->getString("LevelName"); return $this->levelData->getString("LevelName");
} }
@ -217,15 +209,6 @@ abstract class BaseLevelProvider implements LevelProvider{
$this->chunks = []; $this->chunks = [];
} }
public function isChunkPopulated(int $chunkX, int $chunkZ) : bool{
$chunk = $this->getChunk($chunkX, $chunkZ);
if($chunk !== null){
return $chunk->isPopulated();
}else{
return false;
}
}
abstract protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk; abstract protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk;
abstract protected function writeChunk(Chunk $chunk) : void; abstract protected function writeChunk(Chunk $chunk) : void;

View File

@ -144,22 +144,6 @@ interface LevelProvider{
*/ */
public function isChunkLoaded(int $chunkX, int $chunkZ) : bool; public function isChunkLoaded(int $chunkX, int $chunkZ) : bool;
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return bool
*/
public function isChunkGenerated(int $chunkX, int $chunkZ) : bool;
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return bool
*/
public function isChunkPopulated(int $chunkX, int $chunkZ) : bool;
/** /**
* @return string * @return string
*/ */
@ -214,11 +198,6 @@ interface LevelProvider{
public function doGarbageCollection(); public function doGarbageCollection();
/**
* @return Level
*/
public function getLevel() : Level;
public function close(); public function close();
} }

View File

@ -527,10 +527,6 @@ class LevelDB extends BaseLevelProvider{
return $this->db->get(LevelDB::chunkIndex($chunkX, $chunkZ) . self::TAG_VERSION) !== false; return $this->db->get(LevelDB::chunkIndex($chunkX, $chunkZ) . self::TAG_VERSION) !== false;
} }
public function isChunkGenerated(int $chunkX, int $chunkZ) : bool{
return $this->chunkExists($chunkX, $chunkZ) and ($chunk = $this->getChunk($chunkX, $chunkZ, false)) !== null;
}
public function close(){ public function close(){
$this->unloadChunks(); $this->unloadChunks();
$this->db->close(); $this->db->close();

View File

@ -280,14 +280,6 @@ class McRegion extends BaseLevelProvider{
$this->levelData->setByte("Difficulty", $difficulty); $this->levelData->setByte("Difficulty", $difficulty);
} }
public function isChunkGenerated(int $chunkX, int $chunkZ) : bool{
if(($region = $this->getRegion($chunkX >> 5, $chunkZ >> 5)) !== null){
return $region->chunkExists($chunkX & 0x1f, $chunkZ & 0x1f) and $this->getChunk($chunkX & 0x1f, $chunkZ & 0x1f, true)->isGenerated();
}
return false;
}
public function doGarbageCollection(){ public function doGarbageCollection(){
$limit = time() - 300; $limit = time() - 300;
foreach($this->regions as $index => $region){ foreach($this->regions as $index => $region){