Mass removal of useless @param/@return PHPDoc annotations, pass 1

This commit is contained in:
Dylan K. Taylor
2020-01-21 15:10:18 +00:00
parent 7532c609fb
commit c4793241f5
322 changed files with 0 additions and 5360 deletions

View File

@ -99,12 +99,9 @@ class Chunk{
protected $NBTentities = [];
/**
* @param int $chunkX
* @param int $chunkZ
* @param SubChunkInterface[] $subChunks
* @param CompoundTag[] $entities
* @param CompoundTag[] $tiles
* @param string $biomeIds
* @param int[] $heightMap
*/
public function __construct(int $chunkX, int $chunkZ, array $subChunks = [], array $entities = [], array $tiles = [], string $biomeIds = "", array $heightMap = []){
@ -139,23 +136,15 @@ class Chunk{
$this->NBTentities = $entities;
}
/**
* @return int
*/
public function getX() : int{
return $this->x;
}
/**
* @return int
*/
public function getZ() : int{
return $this->z;
}
/**
* @param int $x
*
* @return void
*/
public function setX(int $x){
@ -163,8 +152,6 @@ class Chunk{
}
/**
* @param int $z
*
* @return void
*/
public function setZ(int $z){
@ -173,8 +160,6 @@ class Chunk{
/**
* Returns the chunk height in count of subchunks.
*
* @return int
*/
public function getHeight() : int{
return $this->height;
@ -201,8 +186,6 @@ class Chunk{
* @param int $z 0-15
* @param int|null $blockId 0-255 if null, does not change
* @param int|null $meta 0-15 if null, does not change
*
* @return bool
*/
public function setBlock(int $x, int $y, int $z, ?int $blockId = null, ?int $meta = null) : bool{
if($this->getSubChunk($y >> 4, true)->setBlock($x, $y & 0x0f, $z, $blockId !== null ? ($blockId & 0xff) : null, $meta !== null ? ($meta & 0x0f) : null)){
@ -300,8 +283,6 @@ class Chunk{
}
/**
* @param int $level
*
* @return void
*/
public function setAllBlockSkyLight(int $level){
@ -342,8 +323,6 @@ class Chunk{
}
/**
* @param int $level
*
* @return void
*/
public function setAllBlockLight(int $level){
@ -387,8 +366,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
*
* @return int
*/
public function getHeightMap(int $x, int $z) : int{
return $this->heightMap[($z << 4) | $x];
@ -399,7 +376,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
* @param int $value
*
* @return void
*/
@ -507,8 +483,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
*
* @return string
*/
public function getBlockIdColumn(int $x, int $z) : string{
$result = "";
@ -524,8 +498,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
*
* @return string
*/
public function getBlockDataColumn(int $x, int $z) : string{
$result = "";
@ -540,8 +512,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
*
* @return string
*/
public function getBlockSkyLightColumn(int $x, int $z) : string{
$result = "";
@ -556,8 +526,6 @@ class Chunk{
*
* @param int $x 0-15
* @param int $z 0-15
*
* @return string
*/
public function getBlockLightColumn(int $x, int $z) : string{
$result = "";
@ -567,48 +535,33 @@ class Chunk{
return $result;
}
/**
* @return bool
*/
public function isLightPopulated() : bool{
return $this->lightPopulated;
}
/**
* @param bool $value
*
* @return void
*/
public function setLightPopulated(bool $value = true){
$this->lightPopulated = $value;
}
/**
* @return bool
*/
public function isPopulated() : bool{
return $this->terrainPopulated;
}
/**
* @param bool $value
*
* @return void
*/
public function setPopulated(bool $value = true){
$this->terrainPopulated = $value;
}
/**
* @return bool
*/
public function isGenerated() : bool{
return $this->terrainGenerated;
}
/**
* @param bool $value
*
* @return void
*/
public function setGenerated(bool $value = true){
@ -616,8 +569,6 @@ class Chunk{
}
/**
* @param Entity $entity
*
* @return void
*/
public function addEntity(Entity $entity){
@ -631,8 +582,6 @@ class Chunk{
}
/**
* @param Entity $entity
*
* @return void
*/
public function removeEntity(Entity $entity){
@ -643,8 +592,6 @@ class Chunk{
}
/**
* @param Tile $tile
*
* @return void
*/
public function addTile(Tile $tile){
@ -662,8 +609,6 @@ class Chunk{
}
/**
* @param Tile $tile
*
* @return void
*/
public function removeTile(Tile $tile){
@ -730,8 +675,6 @@ class Chunk{
/**
* Deserializes tiles and entities from NBT
*
* @param Level $level
*
* @return void
*/
public function initChunk(Level $level){
@ -786,9 +729,6 @@ class Chunk{
}
}
/**
* @return string
*/
public function getBiomeIdArray() : string{
return $this->biomeIds;
}
@ -800,16 +740,11 @@ class Chunk{
return $this->heightMap->toArray();
}
/**
* @return bool
*/
public function hasChanged() : bool{
return $this->hasChanged;
}
/**
* @param bool $value
*
* @return void
*/
public function setChanged(bool $value = true){
@ -819,10 +754,7 @@ class Chunk{
/**
* Returns the subchunk at the specified subchunk Y coordinate, or an empty, unmodifiable stub if it does not exist or the coordinate is out of range.
*
* @param int $y
* @param bool $generateNew Whether to create a new, modifiable subchunk if there is not one in place
*
* @return SubChunkInterface
*/
public function getSubChunk(int $y, bool $generateNew = false) : SubChunkInterface{
if($y < 0 or $y >= $this->height){
@ -837,11 +769,7 @@ class Chunk{
/**
* Sets a subchunk in the chunk index
*
* @param int $y
* @param SubChunkInterface|null $subChunk
* @param bool $allowEmpty Whether to check if the chunk is empty, and if so replace it with an empty stub
*
* @return bool
*/
public function setSubChunk(int $y, SubChunkInterface $subChunk = null, bool $allowEmpty = false) : bool{
if($y < 0 or $y >= $this->height){
@ -865,8 +793,6 @@ class Chunk{
/**
* Returns the Y coordinate of the highest non-empty subchunk in this chunk.
*
* @return int
*/
public function getHighestSubChunkIndex() : int{
for($y = $this->subChunks->count() - 1; $y >= 0; --$y){
@ -882,8 +808,6 @@ class Chunk{
/**
* Returns the count of subchunks that need sending to players
*
* @return int
*/
public function getSubChunkSendCount() : int{
return $this->getHighestSubChunkIndex() + 1;
@ -906,8 +830,6 @@ class Chunk{
/**
* Serializes the chunk for sending to players
*
* @return string
*/
public function networkSerialize() : string{
$result = "";
@ -930,8 +852,6 @@ class Chunk{
/**
* Fast-serializes the chunk for passing between threads
* TODO: tiles and entities
*
* @return string
*/
public function fastSerialize() : string{
$stream = new BinaryStream();
@ -967,10 +887,6 @@ class Chunk{
/**
* Deserializes a fast-serialized chunk
*
* @param string $data
*
* @return Chunk
*/
public static function fastDeserialize(string $data) : Chunk{
$stream = new BinaryStream($data);

View File

@ -25,185 +25,55 @@ namespace pocketmine\level\format;
interface SubChunkInterface{
/**
* @param bool $checkLight
*
* @return bool
*/
public function isEmpty(bool $checkLight = true) : bool;
/**
* @param int $x
* @param int $y
* @param int $z
*
* @return int
*/
public function getBlockId(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $id
*
* @return bool
*/
public function setBlockId(int $x, int $y, int $z, int $id) : bool;
/**
* @param int $x
* @param int $y
* @param int $z
*
* @return int
*/
public function getBlockData(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $data
*
* @return bool
*/
public function setBlockData(int $x, int $y, int $z, int $data) : bool;
/**
* @param int $x
* @param int $y
* @param int $z
*
* @return int
*/
public function getFullBlock(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int|null $id
* @param int|null $data
*
* @return bool
*/
public function setBlock(int $x, int $y, int $z, ?int $id = null, ?int $data = null) : bool;
/**
* @param int $x
* @param int $y
* @param int $z
*
* @return int
*/
public function getBlockLight(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $level
*
* @return bool
*/
public function setBlockLight(int $x, int $y, int $z, int $level) : bool;
/**
* @param int $x
* @param int $y
* @param int $z
*
* @return int
*/
public function getBlockSkyLight(int $x, int $y, int $z) : int;
/**
* @param int $x
* @param int $y
* @param int $z
* @param int $level
*
* @return bool
*/
public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool;
/**
* @param int $x
* @param int $z
*
* @return int
*/
public function getHighestBlockAt(int $x, int $z) : int;
/**
* @param int $x
* @param int $z
*
* @return string
*/
public function getBlockIdColumn(int $x, int $z) : string;
/**
* @param int $x
* @param int $z
*
* @return string
*/
public function getBlockDataColumn(int $x, int $z) : string;
/**
* @param int $x
* @param int $z
*
* @return string
*/
public function getBlockLightColumn(int $x, int $z) : string;
/**
* @param int $x
* @param int $z
*
* @return string
*/
public function getBlockSkyLightColumn(int $x, int $z) : string;
/**
* @return string
*/
public function getBlockIdArray() : string;
/**
* @return string
*/
public function getBlockDataArray() : string;
/**
* @return string
*/
public function getBlockSkyLightArray() : string;
/**
* @param string $data
*
* @return void
*/
public function setBlockSkyLightArray(string $data);
/**
* @return string
*/
public function getBlockLightArray() : string;
/**
* @param string $data
*
* @return void
*/
public function setBlockLightArray(string $data);
/**
* @return string
*/
public function networkSerialize() : string;
}

View File

@ -143,9 +143,6 @@ abstract class BaseLevelProvider implements LevelProvider{
}
/**
* @return CompoundTag
*/
public function getLevelData() : CompoundTag{
return $this->levelData;
}
@ -162,10 +159,6 @@ abstract class BaseLevelProvider implements LevelProvider{
}
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return Chunk|null
* @throws CorruptedChunkException
* @throws UnsupportedChunkFormatException
*/
@ -181,10 +174,6 @@ abstract class BaseLevelProvider implements LevelProvider{
}
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return Chunk|null
* @throws UnsupportedChunkFormatException
* @throws CorruptedChunkException
*/

View File

@ -98,8 +98,6 @@ if(!extension_loaded('pocketmine_chunkutils')){
* Converts pre-MCPE-1.0 biome color array to biome ID array.
*
* @param int[] $array of biome color values
*
* @return string
*/
public static function convertBiomeColors(array $array) : string{
$result = str_repeat("\x00", 256);

View File

@ -30,137 +30,84 @@ use pocketmine\math\Vector3;
interface LevelProvider{
/**
* @param string $path
*/
public function __construct(string $path);
/**
* Returns the full provider name, like "anvil" or "mcregion", will be used to find the correct format.
*
* @return string
*/
public static function getProviderName() : string;
/**
* Gets the build height limit of this world
*
* @return int
*/
public function getWorldHeight() : int;
/**
* @return string
*/
public function getPath() : string;
/**
* Tells if the path is a valid level.
* This must tell if the current format supports opening the files in the directory
*
* @param string $path
*
* @return bool
*/
public static function isValid(string $path) : bool;
/**
* Generate the needed files in the path given
*
* @param string $path
* @param string $name
* @param int $seed
* @param string $generator
* @param array $options
*
* @return void
*/
public static function generate(string $path, string $name, int $seed, string $generator, array $options = []);
/**
* Returns the generator name
*
* @return string
*/
public function getGenerator() : string;
/**
* @return array
*/
public function getGeneratorOptions() : array;
/**
* Saves a chunk (usually to disk).
*
* @param Chunk $chunk
*/
public function saveChunk(Chunk $chunk) : void;
/**
* Loads a chunk (usually from disk storage) and returns it. If the chunk does not exist, null is returned.
*
* @param int $chunkX
* @param int $chunkZ
*
* @return null|Chunk
*
* @throws CorruptedChunkException
* @throws UnsupportedChunkFormatException
*/
public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk;
/**
* @return string
*/
public function getName() : string;
/**
* @return int
*/
public function getTime() : int;
/**
* @param int $value
*
* @return void
*/
public function setTime(int $value);
/**
* @return int
*/
public function getSeed() : int;
/**
* @param int $value
*
* @return void
*/
public function setSeed(int $value);
/**
* @return Vector3
*/
public function getSpawn() : Vector3;
/**
* @param Vector3 $pos
*
* @return void
*/
public function setSpawn(Vector3 $pos);
/**
* Returns the world difficulty. This will be one of the Level constants.
* @return int
*/
public function getDifficulty() : int;
/**
* Sets the world difficulty.
*
* @param int $difficulty
*
* @return void
*/
public function setDifficulty(int $difficulty);

View File

@ -42,8 +42,6 @@ abstract class LevelProviderManager{
}
/**
* @param string $class
*
* @return void
* @throws \InvalidArgumentException
*/
@ -67,8 +65,6 @@ abstract class LevelProviderManager{
/**
* Returns a LevelProvider class for this path, or null
*
* @param string $path
*
* @return string|null
*/
public static function getProvider(string $path){
@ -85,8 +81,6 @@ abstract class LevelProviderManager{
/**
* Returns a LevelProvider by name, or null if not found
*
* @param string $name
*
* @return string|null
*/
public static function getProviderByName(string $name){

View File

@ -297,10 +297,6 @@ class LevelDB extends BaseLevelProvider{
}
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return Chunk|null
* @throws UnsupportedChunkFormatException
*/
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{
@ -521,7 +517,6 @@ class LevelDB extends BaseLevelProvider{
/**
* @param CompoundTag[] $targets
* @param string $index
*/
private function writeTags(array $targets, string $index) : void{
if(count($targets) > 0){
@ -532,9 +527,6 @@ class LevelDB extends BaseLevelProvider{
}
}
/**
* @return \LevelDB
*/
public function getDatabase() : \LevelDB{
return $this->db;
}

View File

@ -67,11 +67,6 @@ class McRegion extends BaseLevelProvider{
/** @var RegionLoader[] */
protected $regions = [];
/**
* @param Chunk $chunk
*
* @return string
*/
protected function nbtSerialize(Chunk $chunk) : string{
$nbt = new CompoundTag("Level", []);
$nbt->setInt("xPos", $chunk->getX());
@ -127,9 +122,6 @@ class McRegion extends BaseLevelProvider{
}
/**
* @param string $data
*
* @return Chunk
* @throws CorruptedChunkException
*/
protected function nbtDeserialize(string $data) : Chunk{
@ -206,9 +198,6 @@ class McRegion extends BaseLevelProvider{
}
/**
* @param string $context
* @param ListTag $list
*
* @return CompoundTag[]
* @throws CorruptedChunkException
*/
@ -236,7 +225,6 @@ class McRegion extends BaseLevelProvider{
/**
* Returns the storage version as per Minecraft PC world formats.
* @return int
*/
public static function getPcWorldFormatVersion() : int{
return 19132; //mcregion
@ -329,8 +317,6 @@ class McRegion extends BaseLevelProvider{
}
/**
* @param int $chunkX
* @param int $chunkZ
* @param int $regionX reference parameter
* @param int $regionZ reference parameter
*
@ -342,9 +328,6 @@ class McRegion extends BaseLevelProvider{
}
/**
* @param int $regionX
* @param int $regionZ
*
* @return RegionLoader|null
*/
protected function getRegion(int $regionX, int $regionZ){
@ -353,20 +336,12 @@ class McRegion extends BaseLevelProvider{
/**
* Returns the path to a specific region file based on its X/Z coordinates
*
* @param int $regionX
* @param int $regionZ
*
* @return string
*/
protected function pathToRegion(int $regionX, int $regionZ) : string{
return $this->path . "region/r.$regionX.$regionZ." . static::REGION_FILE_EXTENSION;
}
/**
* @param int $regionX
* @param int $regionZ
*
* @return void
*/
protected function loadRegion(int $regionX, int $regionZ){
@ -402,11 +377,6 @@ class McRegion extends BaseLevelProvider{
}
/**
* @param int $chunkX
* @param int $chunkZ
*
* @return Chunk|null
*
* @throws CorruptedChunkException
*/
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{

View File

@ -122,10 +122,6 @@ class RegionLoader{
}
/**
* @param int $x
* @param int $z
*
* @return null|string
* @throws \InvalidArgumentException if invalid coordinates are given
* @throws CorruptedChunkException if chunk corruption is detected
*/
@ -174,10 +170,6 @@ class RegionLoader{
}
/**
* @param int $x
* @param int $z
*
* @return bool
* @throws \InvalidArgumentException
*/
public function chunkExists(int $x, int $z) : bool{
@ -185,10 +177,6 @@ class RegionLoader{
}
/**
* @param int $x
* @param int $z
* @param string $chunkData
*
* @return void
* @throws ChunkException
* @throws \InvalidArgumentException
@ -219,9 +207,6 @@ class RegionLoader{
}
/**
* @param int $x
* @param int $z
*
* @return void
* @throws \InvalidArgumentException
*/
@ -232,10 +217,6 @@ class RegionLoader{
}
/**
* @param int $x
* @param int $z
*
* @return int
* @throws \InvalidArgumentException
*/
protected static function getChunkOffset(int $x, int $z) : int{
@ -246,7 +227,6 @@ class RegionLoader{
}
/**
* @param int $offset
* @param int $x reference parameter
* @param int $z reference parameter
*/
@ -258,8 +238,6 @@ class RegionLoader{
/**
* Writes the region header and closes the file
*
* @param bool $writeHeader
*
* @return void
*/
public function close(bool $writeHeader = true){

View File

@ -35,10 +35,6 @@ class RegionLocationTableEntry{
private $timestamp;
/**
* @param int $firstSector
* @param int $sectorCount
* @param int $timestamp
*
* @throws \InvalidArgumentException
*/
public function __construct(int $firstSector, int $sectorCount, int $timestamp){
@ -53,16 +49,10 @@ class RegionLocationTableEntry{
$this->timestamp = $timestamp;
}
/**
* @return int
*/
public function getFirstSector() : int{
return $this->firstSector;
}
/**
* @return int
*/
public function getLastSector() : int{
return $this->firstSector + $this->sectorCount - 1;
}
@ -75,23 +65,14 @@ class RegionLocationTableEntry{
return range($this->getFirstSector(), $this->getLastSector());
}
/**
* @return int
*/
public function getSectorCount() : int{
return $this->sectorCount;
}
/**
* @return int
*/
public function getTimestamp() : int{
return $this->timestamp;
}
/**
* @return bool
*/
public function isNull() : bool{
return $this->firstSector === 0 or $this->sectorCount === 0;
}