Added Level->getChunks(), fixed some Doc Comments

This commit is contained in:
Shoghi Cervantes 2015-01-04 23:16:03 +01:00
parent 7a0118820c
commit f37e79b611
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 13 additions and 6 deletions

View File

@ -145,7 +145,7 @@ class Level implements ChunkManager, Metadatable{
/** @var Player[][] */ /** @var Player[][] */
protected $usedChunks = []; protected $usedChunks = [];
/** @var Chunk[] */ /** @var FullChunk[]|Chunk[] */
protected $unloadQueue; protected $unloadQueue;
protected $time; protected $time;
@ -153,7 +153,7 @@ class Level implements ChunkManager, Metadatable{
private $folderName; private $folderName;
/** @var Chunk[] */ /** @var FullChunk[]|Chunk[] */
private $chunks = []; private $chunks = [];
/** @var Block[][] */ /** @var Block[][] */
@ -1724,6 +1724,13 @@ class Level implements ChunkManager, Metadatable{
$this->getChunk($x >> 4, $z >> 4, true)->setHeightMap($x & 0x0f, $z & 0x0f, $value); $this->getChunk($x >> 4, $z >> 4, true)->setHeightMap($x & 0x0f, $z & 0x0f, $value);
} }
/**
* @return FullChunk[]|Chunk[]
*/
public function getChunks(){
return $this->chunks;
}
/** /**
* Gets the Chunk object * Gets the Chunk object
* *
@ -1731,7 +1738,7 @@ class Level implements ChunkManager, Metadatable{
* @param int $z * @param int $z
* @param bool $create Whether to generate the chunk if it does not exist * @param bool $create Whether to generate the chunk if it does not exist
* *
* @return Chunk * @return FullChunk|Chunk
*/ */
public function getChunk($x, $z, $create = false){ public function getChunk($x, $z, $create = false){
if(isset($this->chunks[$index = Level::chunkHash($x, $z)])){ if(isset($this->chunks[$index = Level::chunkHash($x, $z)])){
@ -1748,7 +1755,7 @@ class Level implements ChunkManager, Metadatable{
* @param int $z * @param int $z
* @param bool $create * @param bool $create
* *
* @return Chunk * @return FullChunk|Chunk
* *
* @deprecated * @deprecated
*/ */

View File

@ -106,7 +106,7 @@ interface LevelProvider{
* @param int $Z absolute Chunk Z value * @param int $Z absolute Chunk Z value
* @param bool $create Whether to generate the chunk if it does not exist * @param bool $create Whether to generate the chunk if it does not exist
* *
* @return Chunk * @return FullChunk|Chunk
*/ */
public function getChunk($X, $Z, $create = false); public function getChunk($X, $Z, $create = false);
@ -214,7 +214,7 @@ interface LevelProvider{
public function setSpawn(Vector3 $pos); public function setSpawn(Vector3 $pos);
/** /**
* @return Chunk[] * @return FullChunk|Chunk[]
*/ */
public function getLoadedChunks(); public function getLoadedChunks();