phpdoc armageddon for master, pass 1

This commit is contained in:
Dylan K. Taylor
2020-01-22 11:55:03 +00:00
parent 4bae3baa74
commit 67bcc1c0fb
397 changed files with 0 additions and 5391 deletions

View File

@ -39,9 +39,6 @@ class PlayerBedEnterEvent extends PlayerEvent implements Cancellable{
$this->bed = $bed;
}
/**
* @return Block
*/
public function getBed() : Block{
return $this->bed;
}

View File

@ -35,9 +35,6 @@ class PlayerBedLeaveEvent extends PlayerEvent{
$this->bed = $bed;
}
/**
* @return Block
*/
public function getBed() : Block{
return $this->bed;
}

View File

@ -44,13 +44,6 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
/** @var Item */
private $item;
/**
* @param Player $who
* @param Block $blockClicked
* @param int $blockFace
* @param Item $bucket
* @param Item $itemInHand
*/
public function __construct(Player $who, Block $blockClicked, int $blockFace, Item $bucket, Item $itemInHand){
$this->player = $who;
$this->blockClicked = $blockClicked;
@ -61,8 +54,6 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
/**
* Returns the bucket used in this event
*
* @return Item
*/
public function getBucket() : Item{
return $this->bucket;
@ -70,30 +61,19 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
/**
* Returns the item in hand after the event
*
* @return Item
*/
public function getItem() : Item{
return $this->item;
}
/**
* @param Item $item
*/
public function setItem(Item $item) : void{
$this->item = $item;
}
/**
* @return Block
*/
public function getBlockClicked() : Block{
return $this->blockClicked;
}
/**
* @return int
*/
public function getBlockFace() : int{
return $this->blockFace;
}

View File

@ -39,34 +39,21 @@ class PlayerChangeSkinEvent extends PlayerEvent implements Cancellable{
/** @var Skin */
private $newSkin;
/**
* @param Player $player
* @param Skin $oldSkin
* @param Skin $newSkin
*/
public function __construct(Player $player, Skin $oldSkin, Skin $newSkin){
$this->player = $player;
$this->oldSkin = $oldSkin;
$this->newSkin = $newSkin;
}
/**
* @return Skin
*/
public function getOldSkin() : Skin{
return $this->oldSkin;
}
/**
* @return Skin
*/
public function getNewSkin() : Skin{
return $this->newSkin;
}
/**
* @param Skin $skin
*
* @throws \InvalidArgumentException if the specified skin is not valid
*/
public function setNewSkin(Skin $skin) : void{

View File

@ -49,9 +49,6 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
protected $recipients = [];
/**
* @param Player $player
* @param string $message
* @param string $format
* @param CommandSender[] $recipients
*/
public function __construct(Player $player, string $message, string $format = "chat.type.text", ?array $recipients = null){
@ -71,39 +68,25 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
}
}
/**
* @return string
*/
public function getMessage() : string{
return $this->message;
}
/**
* @param string $message
*/
public function setMessage(string $message) : void{
$this->message = $message;
}
/**
* Changes the player that is sending the message
*
* @param Player $player
*/
public function setPlayer(Player $player) : void{
$this->player = $player;
}
/**
* @return string
*/
public function getFormat() : string{
return $this->format;
}
/**
* @param string $format
*/
public function setFormat(string $format) : void{
$this->format = $format;
}

View File

@ -41,33 +41,19 @@ class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancellable{
/** @var string */
protected $message;
/**
* @param Player $player
* @param string $message
*/
public function __construct(Player $player, string $message){
$this->player = $player;
$this->message = $message;
}
/**
* @return string
*/
public function getMessage() : string{
return $this->message;
}
/**
* @param string $message
*/
public function setMessage(string $message) : void{
$this->message = $message;
}
/**
* @param Player $player
*/
public function setPlayer(Player $player) : void{
$this->player = $player;
}

View File

@ -41,31 +41,18 @@ class PlayerCreationEvent extends Event{
/** @var string */
private $playerClass = Player::class;
/**
* @param NetworkSession $session
*/
public function __construct(NetworkSession $session){
$this->session = $session;
}
/**
* @return NetworkSession
*/
public function getNetworkSession() : NetworkSession{
return $this->session;
}
/**
* @return string
*/
public function getAddress() : string{
return $this->session->getIp();
}
/**
* @return int
*/
public function getPort() : int{
return $this->session->getPort();
}

View File

@ -48,22 +48,17 @@ class PlayerDataSaveEvent extends Event implements Cancellable{
/**
* Returns the data to be written to disk as a CompoundTag
* @return CompoundTag
*/
public function getSaveData() : CompoundTag{
return $this->data;
}
/**
* @param CompoundTag $data
*/
public function setSaveData(CompoundTag $data) : void{
$this->data = $data;
}
/**
* Returns the username of the player whose data is being saved. This is not necessarily an online player.
* @return string
*/
public function getPlayerName() : string{
return $this->playerName;

View File

@ -44,9 +44,7 @@ class PlayerDeathEvent extends EntityDeathEvent{
private $keepInventory = false;
/**
* @param Player $entity
* @param Item[] $drops
* @param int $xp
* @param string|TextContainer|null $deathMessage Null will cause the default vanilla message to be used
*/
public function __construct(Player $entity, array $drops, int $xp, $deathMessage){
@ -61,9 +59,6 @@ class PlayerDeathEvent extends EntityDeathEvent{
return $this->entity;
}
/**
* @return Player
*/
public function getPlayer() : Player{
return $this->entity;
}
@ -92,11 +87,6 @@ class PlayerDeathEvent extends EntityDeathEvent{
/**
* Returns the vanilla death message for the given death cause.
*
* @param string $name
* @param null|EntityDamageEvent $deathCause
*
* @return TranslationContainer
*/
public static function deriveMessage(string $name, ?EntityDamageEvent $deathCause) : TranslationContainer{
$message = "death.attack.generic";

View File

@ -37,18 +37,11 @@ class PlayerDropItemEvent extends PlayerEvent implements Cancellable{
/** @var Item */
private $drop;
/**
* @param Player $player
* @param Item $drop
*/
public function __construct(Player $player, Item $drop){
$this->player = $player;
$this->drop = $drop;
}
/**
* @return Item
*/
public function getItem() : Item{
return $this->drop;
}

View File

@ -57,16 +57,11 @@ class PlayerDuplicateLoginEvent extends Event implements Cancellable{
/**
* Returns the message shown to the session which gets disconnected.
*
* @return string
*/
public function getDisconnectMessage() : string{
return $this->disconnectMessage;
}
/**
* @param string $message
*/
public function setDisconnectMessage(string $message) : void{
$this->disconnectMessage = $message;
}

View File

@ -56,8 +56,6 @@ class PlayerEditBookEvent extends PlayerEvent implements Cancellable{
/**
* Returns the action of the event.
*
* @return int
*/
public function getAction() : int{
return $this->action;
@ -65,8 +63,6 @@ class PlayerEditBookEvent extends PlayerEvent implements Cancellable{
/**
* Returns the book before it was modified.
*
* @return WritableBookBase
*/
public function getOldBook() : WritableBookBase{
return $this->oldBook;
@ -75,8 +71,6 @@ class PlayerEditBookEvent extends PlayerEvent implements Cancellable{
/**
* Returns the book after it was modified.
* The new book may be a written book, if the book was signed.
*
* @return WritableBookBase
*/
public function getNewBook() : WritableBookBase{
return $this->newBook;
@ -84,8 +78,6 @@ class PlayerEditBookEvent extends PlayerEvent implements Cancellable{
/**
* Sets the new book as the given instance.
*
* @param WritableBookBase $book
*/
public function setNewBook(WritableBookBase $book) : void{
$this->newBook = $book;

View File

@ -75,7 +75,6 @@ class PlayerExhaustEvent extends EntityEvent implements Cancellable{
/**
* Returns an int cause of the exhaustion - one of the constants at the top of this class.
* @return int
*/
public function getCause() : int{
return $this->cause;

View File

@ -54,16 +54,10 @@ class PlayerExperienceChangeEvent extends EntityEvent implements Cancellable{
$this->newProgress = $newProgress;
}
/**
* @return int
*/
public function getOldLevel() : int{
return $this->oldLevel;
}
/**
* @return float
*/
public function getOldProgress() : float{
return $this->oldProgress;
}
@ -82,16 +76,10 @@ class PlayerExperienceChangeEvent extends EntityEvent implements Cancellable{
return $this->newProgress;
}
/**
* @param int|null $newLevel
*/
public function setNewLevel(?int $newLevel) : void{
$this->newLevel = $newLevel;
}
/**
* @param float|null $newProgress
*/
public function setNewProgress(?float $newProgress) : void{
$this->newProgress = $newProgress;
}

View File

@ -54,14 +54,6 @@ class PlayerInteractEvent extends PlayerEvent implements Cancellable{
/** @var int */
protected $action;
/**
* @param Player $player
* @param Item $item
* @param Block $block
* @param Vector3|null $touchVector
* @param int $face
* @param int $action
*/
public function __construct(Player $player, Item $item, Block $block, ?Vector3 $touchVector, int $face, int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK){
$this->player = $player;
$this->item = $item;
@ -71,37 +63,22 @@ class PlayerInteractEvent extends PlayerEvent implements Cancellable{
$this->action = $action;
}
/**
* @return int
*/
public function getAction() : int{
return $this->action;
}
/**
* @return Item
*/
public function getItem() : Item{
return $this->item;
}
/**
* @return Block
*/
public function getBlock() : Block{
return $this->blockTouched;
}
/**
* @return Vector3
*/
public function getTouchVector() : Vector3{
return $this->touchVector;
}
/**
* @return int
*/
public function getFace() : int{
return $this->blockFace;
}

View File

@ -37,18 +37,11 @@ class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable{
/** @var Item */
private $item;
/**
* @param Player $player
* @param Item $item
*/
public function __construct(Player $player, Item $item){
$this->player = $player;
$this->item = $item;
}
/**
* @return Item
*/
public function getItem() : Item{
return clone $this->item;
}

View File

@ -49,8 +49,6 @@ class PlayerItemHeldEvent extends PlayerEvent implements Cancellable{
* event will result in the **old** slot being changed, not this one.
*
* To change the item in the slot that the player is attempting to hold, set the slot that this function reports.
*
* @return int
*/
public function getSlot() : int{
return $this->hotbarSlot;
@ -58,8 +56,6 @@ class PlayerItemHeldEvent extends PlayerEvent implements Cancellable{
/**
* Returns the item in the slot that the player is trying to equip.
*
* @return Item
*/
public function getItem() : Item{
return $this->item;

View File

@ -40,11 +40,6 @@ class PlayerItemUseEvent extends PlayerEvent implements Cancellable{
/** @var Vector3 */
private $directionVector;
/**
* @param Player $player
* @param Item $item
* @param Vector3 $directionVector
*/
public function __construct(Player $player, Item $item, Vector3 $directionVector){
$this->player = $player;
$this->item = $item;
@ -53,8 +48,6 @@ class PlayerItemUseEvent extends PlayerEvent implements Cancellable{
/**
* Returns the item used.
*
* @return Item
*/
public function getItem() : Item{
return $this->item;
@ -62,8 +55,6 @@ class PlayerItemUseEvent extends PlayerEvent implements Cancellable{
/**
* Returns the direction the player is aiming when activating this item. Used for projectile direction.
*
* @return Vector3
*/
public function getDirectionVector() : Vector3{
return $this->directionVector;

View File

@ -40,7 +40,6 @@ class PlayerJoinEvent extends PlayerEvent{
/**
* PlayerJoinEvent constructor.
*
* @param Player $player
* @param TextContainer|string $joinMessage
*/
public function __construct(Player $player, $joinMessage){

View File

@ -32,8 +32,6 @@ class PlayerJumpEvent extends PlayerEvent{
/**
* PlayerJumpEvent constructor.
*
* @param Player $player
*/
public function __construct(Player $player){
$this->player = $player;

View File

@ -43,8 +43,6 @@ class PlayerKickEvent extends PlayerEvent implements Cancellable{
/**
* PlayerKickEvent constructor.
*
* @param Player $player
* @param string $reason
* @param TextContainer|string $quitMessage
*/
public function __construct(Player $player, string $reason, $quitMessage){
@ -53,9 +51,6 @@ class PlayerKickEvent extends PlayerEvent implements Cancellable{
$this->reason = $reason;
}
/**
* @param string $reason
*/
public function setReason(string $reason) : void{
$this->reason = $reason;
}

View File

@ -38,25 +38,15 @@ class PlayerLoginEvent extends PlayerEvent implements Cancellable{
/** @var string */
protected $kickMessage;
/**
* @param Player $player
* @param string $kickMessage
*/
public function __construct(Player $player, string $kickMessage){
$this->player = $player;
$this->kickMessage = $kickMessage;
}
/**
* @param string $kickMessage
*/
public function setKickMessage(string $kickMessage) : void{
$this->kickMessage = $kickMessage;
}
/**
* @return string
*/
public function getKickMessage() : string{
return $this->kickMessage;
}

View File

@ -36,34 +36,20 @@ class PlayerMoveEvent extends PlayerEvent implements Cancellable{
/** @var Location */
private $to;
/**
* @param Player $player
* @param Location $from
* @param Location $to
*/
public function __construct(Player $player, Location $from, Location $to){
$this->player = $player;
$this->from = $from;
$this->to = $to;
}
/**
* @return Location
*/
public function getFrom() : Location{
return $this->from;
}
/**
* @return Location
*/
public function getTo() : Location{
return $this->to;
}
/**
* @param Location $to
*/
public function setTo(Location $to) : void{
$this->to = $to;
}

View File

@ -62,12 +62,6 @@ class PlayerPreLoginEvent extends Event{
/** @var string[] reason const => associated message */
protected $kickReasons = [];
/**
* @param PlayerInfo $playerInfo
* @param string $ip
* @param int $port
* @param bool $authRequired
*/
public function __construct(PlayerInfo $playerInfo, string $ip, int $port, bool $authRequired){
$this->playerInfo = $playerInfo;
$this->ip = $ip;
@ -79,37 +73,23 @@ class PlayerPreLoginEvent extends Event{
* Returns an object containing self-proclaimed information about the connecting player.
* WARNING: THE PLAYER IS NOT VERIFIED DURING THIS EVENT. At this point, it's unknown if the player is real or a
* hacker.
*
* @return PlayerInfo
*/
public function getPlayerInfo() : PlayerInfo{
return $this->playerInfo;
}
/**
* @return string
*/
public function getIp() : string{
return $this->ip;
}
/**
* @return int
*/
public function getPort() : int{
return $this->port;
}
/**
* @return bool
*/
public function isAuthRequired() : bool{
return $this->authRequired;
}
/**
* @param bool $v
*/
public function setAuthRequired(bool $v) : void{
$this->authRequired = $v;
}
@ -125,10 +105,6 @@ class PlayerPreLoginEvent extends Event{
/**
* Returns whether the given kick reason is set for this event.
*
* @param int $flag
*
* @return bool
*/
public function isKickReasonSet(int $flag) : bool{
return isset($this->kickReasons[$flag]);
@ -137,9 +113,6 @@ class PlayerPreLoginEvent extends Event{
/**
* Sets a reason to disallow the player to continue continue authenticating, with a message.
* This can also be used to change kick messages for already-set flags.
*
* @param int $flag
* @param string $message
*/
public function setKickReason(int $flag, string $message) : void{
$this->kickReasons[$flag] = $message;
@ -164,8 +137,6 @@ class PlayerPreLoginEvent extends Event{
/**
* Returns whether the player is allowed to continue logging in.
*
* @return bool
*/
public function isAllowed() : bool{
return empty($this->kickReasons);
@ -173,10 +144,6 @@ class PlayerPreLoginEvent extends Event{
/**
* Returns the kick message provided for the given kick flag, or null if not set.
*
* @param int $flag
*
* @return string|null
*/
public function getKickMessage(int $flag) : ?string{
return $this->kickReasons[$flag] ?? null;
@ -189,8 +156,6 @@ class PlayerPreLoginEvent extends Event{
* messages.
*
* @see PlayerPreLoginEvent::KICK_REASON_PRIORITY
*
* @return string
*/
public function getFinalKickMessage() : string{
foreach(self::KICK_REASON_PRIORITY as $p){

View File

@ -37,9 +37,7 @@ class PlayerQuitEvent extends PlayerEvent{
protected $quitReason;
/**
* @param Player $player
* @param TranslationContainer|string $quitMessage
* @param string $quitReason
*/
public function __construct(Player $player, $quitMessage, string $quitReason){
$this->player = $player;
@ -61,9 +59,6 @@ class PlayerQuitEvent extends PlayerEvent{
return $this->quitMessage;
}
/**
* @return string
*/
public function getQuitReason() : string{
return $this->quitReason;
}

View File

@ -33,25 +33,15 @@ class PlayerRespawnEvent extends PlayerEvent{
/** @var Position */
protected $position;
/**
* @param Player $player
* @param Position $position
*/
public function __construct(Player $player, Position $position){
$this->player = $player;
$this->position = $position;
}
/**
* @return Position
*/
public function getRespawnPosition() : Position{
return $this->position;
}
/**
* @param Position $position
*/
public function setRespawnPosition(Position $position) : void{
$this->position = $position;
}

View File

@ -33,18 +33,11 @@ class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable{
/** @var bool */
protected $isFlying;
/**
* @param Player $player
* @param bool $isFlying
*/
public function __construct(Player $player, bool $isFlying){
$this->player = $player;
$this->isFlying = $isFlying;
}
/**
* @return bool
*/
public function isFlying() : bool{
return $this->isFlying;
}

View File

@ -33,18 +33,11 @@ class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable{
/** @var bool */
protected $isSneaking;
/**
* @param Player $player
* @param bool $isSneaking
*/
public function __construct(Player $player, bool $isSneaking){
$this->player = $player;
$this->isSneaking = $isSneaking;
}
/**
* @return bool
*/
public function isSneaking() : bool{
return $this->isSneaking;
}

View File

@ -33,18 +33,11 @@ class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable{
/** @var bool */
protected $isSprinting;
/**
* @param Player $player
* @param bool $isSprinting
*/
public function __construct(Player $player, bool $isSprinting){
$this->player = $player;
$this->isSprinting = $isSprinting;
}
/**
* @return bool
*/
public function isSprinting() : bool{
return $this->isSprinting;
}

View File

@ -37,12 +37,6 @@ class PlayerTransferEvent extends PlayerEvent implements Cancellable{
/** @var string */
protected $message;
/**
* @param Player $player
* @param string $address
* @param int $port
* @param string $message
*/
public function __construct(Player $player, string $address, int $port, string $message){
$this->player = $player;
$this->address = $address;
@ -50,44 +44,26 @@ class PlayerTransferEvent extends PlayerEvent implements Cancellable{
$this->message = $message;
}
/**
* @return string
*/
public function getAddress() : string{
return $this->address;
}
/**
* @param string $address
*/
public function setAddress(string $address) : void{
$this->address = $address;
}
/**
* @return int
*/
public function getPort() : int{
return $this->port;
}
/**
* @param int $port
*/
public function setPort(int $port) : void{
$this->port = $port;
}
/**
* @return string
*/
public function getMessage() : string{
return $this->message;
}
/**
* @param string $message
*/
public function setMessage(string $message) : void{
$this->message = $message;
}