mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Mass removal of useless @param/@return PHPDoc annotations, pass 1
This commit is contained in:
@ -127,8 +127,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
|
||||
/**
|
||||
* Returns the color of the banner base.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBaseColor() : int{
|
||||
return $this->baseColor;
|
||||
@ -136,8 +134,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
|
||||
/**
|
||||
* Sets the color of the banner base.
|
||||
*
|
||||
* @param int $color
|
||||
*/
|
||||
public function setBaseColor(int $color) : void{
|
||||
$this->baseColor = $color;
|
||||
@ -147,9 +143,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
/**
|
||||
* Applies a new pattern on the banner with the given color.
|
||||
*
|
||||
* @param string $pattern
|
||||
* @param int $color
|
||||
*
|
||||
* @return int ID of pattern.
|
||||
*/
|
||||
public function addPattern(string $pattern, int $color) : int{
|
||||
@ -164,10 +157,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
|
||||
/**
|
||||
* Returns whether a pattern with the given ID exists on the banner or not.
|
||||
*
|
||||
* @param int $patternId
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function patternExists(int $patternId) : bool{
|
||||
return $this->patterns->isset($patternId);
|
||||
@ -175,10 +164,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
|
||||
/**
|
||||
* Returns the data of a pattern with the given ID.
|
||||
*
|
||||
* @param int $patternId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPatternData(int $patternId) : array{
|
||||
if(!$this->patternExists($patternId)){
|
||||
@ -197,10 +182,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
/**
|
||||
* Changes the pattern of a previously existing pattern.
|
||||
*
|
||||
* @param int $patternId
|
||||
* @param string $pattern
|
||||
* @param int $color
|
||||
*
|
||||
* @return bool indicating success.
|
||||
*/
|
||||
public function changePattern(int $patternId, string $pattern, int $color) : bool{
|
||||
@ -220,8 +201,6 @@ class Banner extends Spawnable implements Nameable{
|
||||
/**
|
||||
* Deletes a pattern from the banner with the given ID.
|
||||
*
|
||||
* @param int $patternId
|
||||
*
|
||||
* @return bool indicating whether the pattern existed or not.
|
||||
*/
|
||||
public function deletePattern(int $patternId) : bool{
|
||||
@ -255,16 +234,11 @@ class Banner extends Spawnable implements Nameable{
|
||||
|
||||
/**
|
||||
* Returns the total count of patterns on this banner.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPatternCount() : int{
|
||||
return $this->patterns->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ListTag
|
||||
*/
|
||||
public function getPatterns() : ListTag{
|
||||
return $this->patterns;
|
||||
}
|
||||
|
@ -147,9 +147,6 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultName() : string{
|
||||
return "Chest";
|
||||
}
|
||||
@ -161,9 +158,6 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
return $this->pairX !== null and $this->pairZ !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Chest|null
|
||||
*/
|
||||
public function getPair() : ?Chest{
|
||||
if($this->isPaired()){
|
||||
$tile = $this->getLevel()->getTileAt($this->pairX, $this->y, $this->pairZ);
|
||||
|
@ -41,10 +41,6 @@ interface Container{
|
||||
|
||||
/**
|
||||
* Returns whether this container can be opened by an item with the given custom name.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canOpenWith(string $key) : bool;
|
||||
}
|
||||
|
@ -73,10 +73,6 @@ trait ContainerTrait{
|
||||
|
||||
/**
|
||||
* @see Container::canOpenWith()
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canOpenWith(string $key) : bool{
|
||||
return $this->lock === null or $this->lock === $key;
|
||||
|
@ -29,9 +29,6 @@ class EnchantTable extends Spawnable implements Nameable{
|
||||
saveName as writeSaveData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultName() : string{
|
||||
return "Enchanting Table";
|
||||
}
|
||||
|
@ -71,8 +71,6 @@ class FlowerPot extends Spawnable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Item $item
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setItem(Item $item){
|
||||
|
@ -108,9 +108,6 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
$this->saveItems($nbt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultName() : string{
|
||||
return "Furnace";
|
||||
}
|
||||
@ -139,8 +136,6 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Item $fuel
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function checkFuel(Item $fuel){
|
||||
|
@ -64,8 +64,6 @@ class ItemFrame extends Spawnable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Item|null $item
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setItem(Item $item = null){
|
||||
@ -82,8 +80,6 @@ class ItemFrame extends Spawnable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $rotation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setItemRotation(int $rotation){
|
||||
@ -96,8 +92,6 @@ class ItemFrame extends Spawnable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $chance
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setItemDropChance(float $chance){
|
||||
|
@ -26,25 +26,14 @@ namespace pocketmine\tile;
|
||||
interface Nameable{
|
||||
public const TAG_CUSTOM_NAME = "CustomName";
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultName() : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() : string;
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setName(string $str);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasName() : bool;
|
||||
}
|
||||
|
@ -36,21 +36,12 @@ trait NameableTrait{
|
||||
/** @var string|null */
|
||||
private $customName;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getDefaultName() : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() : string{
|
||||
return $this->customName ?? $this->getDefaultName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name) : void{
|
||||
if($name === ""){
|
||||
$this->customName = null;
|
||||
@ -59,9 +50,6 @@ trait NameableTrait{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasName() : bool{
|
||||
return $this->customName !== null;
|
||||
}
|
||||
|
@ -77,11 +77,6 @@ class Sign extends Spawnable{
|
||||
/**
|
||||
* Changes contents of the specific lines to the string provided.
|
||||
* Leaves contents of the specific lines as is if null is provided.
|
||||
*
|
||||
* @param null|string $line1
|
||||
* @param null|string $line2
|
||||
* @param null|string $line3
|
||||
* @param null|string $line4
|
||||
*/
|
||||
public function setText(?string $line1 = "", ?string $line2 = "", ?string $line3 = "", ?string $line4 = "") : void{
|
||||
if($line1 !== null){
|
||||
@ -102,8 +97,6 @@ class Sign extends Spawnable{
|
||||
|
||||
/**
|
||||
* @param int $index 0-3
|
||||
* @param string $line
|
||||
* @param bool $update
|
||||
*/
|
||||
public function setLine(int $index, string $line, bool $update = true) : void{
|
||||
if($index < 0 or $index > 3){
|
||||
@ -121,8 +114,6 @@ class Sign extends Spawnable{
|
||||
|
||||
/**
|
||||
* @param int $index 0-3
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLine(int $index) : string{
|
||||
if($index < 0 or $index > 3){
|
||||
|
@ -58,8 +58,6 @@ class Skull extends Spawnable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setType(int $type){
|
||||
|
@ -102,9 +102,6 @@ abstract class Spawnable extends Tile{
|
||||
return $this->spawnCompoundCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CompoundTag
|
||||
*/
|
||||
final public function getSpawnCompound() : CompoundTag{
|
||||
$nbt = new CompoundTag("", [
|
||||
new StringTag(self::TAG_ID, static::getSaveId()),
|
||||
@ -119,8 +116,6 @@ abstract class Spawnable extends Tile{
|
||||
/**
|
||||
* An extension to getSpawnCompound() for
|
||||
* further modifying the generic tile NBT.
|
||||
*
|
||||
* @param CompoundTag $nbt
|
||||
*/
|
||||
abstract protected function addAdditionalSpawnData(CompoundTag $nbt) : void;
|
||||
|
||||
@ -128,9 +123,6 @@ abstract class Spawnable extends Tile{
|
||||
* Called when a player updates a block entity's NBT data
|
||||
* for example when writing on a sign.
|
||||
*
|
||||
* @param CompoundTag $nbt
|
||||
* @param Player $player
|
||||
*
|
||||
* @return bool indication of success, will respawn the tile to the player if false.
|
||||
*/
|
||||
public function updateCompoundTag(CompoundTag $nbt, Player $player) : bool{
|
||||
|
@ -102,11 +102,7 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param Level $level
|
||||
* @param CompoundTag $nbt
|
||||
* @param mixed ...$args
|
||||
*
|
||||
* @return Tile|null
|
||||
*/
|
||||
public static function createTile($type, Level $level, CompoundTag $nbt, ...$args) : ?Tile{
|
||||
if(isset(self::$knownTiles[$type])){
|
||||
@ -119,10 +115,6 @@ abstract class Tile extends Position{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
* @param array $saveNames
|
||||
*
|
||||
* @return bool
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function registerTile(string $className, array $saveNames = []) : bool{
|
||||
@ -148,7 +140,6 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* Returns the short save name
|
||||
* @return string
|
||||
*/
|
||||
public static function getSaveId() : string{
|
||||
if(!isset(self::$saveNames[static::class])){
|
||||
@ -178,15 +169,11 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* Reads additional data from the CompoundTag on tile creation.
|
||||
*
|
||||
* @param CompoundTag $nbt
|
||||
*/
|
||||
abstract protected function readSaveData(CompoundTag $nbt) : void;
|
||||
|
||||
/**
|
||||
* Writes additional save data to a CompoundTag, not including generic things like ID and coordinates.
|
||||
*
|
||||
* @param CompoundTag $nbt
|
||||
*/
|
||||
abstract protected function writeSaveData(CompoundTag $nbt) : void;
|
||||
|
||||
@ -208,13 +195,6 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* Creates and returns a CompoundTag containing the necessary information to spawn a tile of this type.
|
||||
*
|
||||
* @param Vector3 $pos
|
||||
* @param int|null $face
|
||||
* @param Item|null $item
|
||||
* @param Player|null $player
|
||||
*
|
||||
* @return CompoundTag
|
||||
*/
|
||||
public static function createNBT(Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : CompoundTag{
|
||||
if(static::class === self::class){
|
||||
@ -243,27 +223,15 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* Called by createNBT() to allow descendent classes to add their own base NBT using the parameters provided.
|
||||
*
|
||||
* @param CompoundTag $nbt
|
||||
* @param Vector3 $pos
|
||||
* @param int|null $face
|
||||
* @param Item|null $item
|
||||
* @param Player|null $player
|
||||
*/
|
||||
protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block
|
||||
*/
|
||||
public function getBlock() : Block{
|
||||
return $this->level->getBlockAt($this->x, $this->y, $this->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function onUpdate() : bool{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user