mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Mass removal of useless @param/@return PHPDoc annotations, pass 1
This commit is contained in:
@ -39,9 +39,6 @@ class AddEntityPacket extends DataPacket/* implements ClientboundPacket*/{
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getUvarint1() : int{
|
||||
return $this->uvarint1;
|
||||
}
|
||||
|
@ -103,9 +103,6 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $flag
|
||||
* @param bool $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setFlag(int $flag, bool $value){
|
||||
|
@ -149,7 +149,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
/**
|
||||
* @param string[] $enumValueList
|
||||
*
|
||||
* @return CommandEnum
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws BinaryDataException
|
||||
*/
|
||||
@ -184,7 +183,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandEnum $enum
|
||||
* @param int[] $enumValueMap string enum name -> int index
|
||||
*/
|
||||
protected function putEnum(CommandEnum $enum, array $enumValueMap) : void{
|
||||
@ -211,9 +209,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $valueCount
|
||||
*
|
||||
* @return int
|
||||
* @throws BinaryDataException
|
||||
*/
|
||||
protected function getEnumValueIndex(int $valueCount) : int{
|
||||
@ -239,8 +234,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
/**
|
||||
* @param CommandEnum[] $enums
|
||||
* @param string[] $enumValues
|
||||
*
|
||||
* @return CommandEnumConstraint
|
||||
*/
|
||||
protected function getEnumConstraint(array $enums, array $enumValues) : CommandEnumConstraint{
|
||||
//wtf, what was wrong with an offset inside the enum? :(
|
||||
@ -267,7 +260,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandEnumConstraint $constraint
|
||||
* @param int[] $enumIndexes string enum name -> int index
|
||||
* @param int[] $enumValueIndexes string value -> int index
|
||||
*/
|
||||
@ -284,7 +276,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
* @param CommandEnum[] $enums
|
||||
* @param string[] $postfixes
|
||||
*
|
||||
* @return CommandData
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws BinaryDataException
|
||||
*/
|
||||
@ -329,7 +320,6 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandData $data
|
||||
* @param int[] $enumIndexes string enum name -> int index
|
||||
* @param int[] $postfixIndexes
|
||||
*/
|
||||
|
@ -76,8 +76,6 @@ class BatchPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DataPacket $packet
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPacket(DataPacket $packet){
|
||||
@ -110,8 +108,6 @@ class BatchPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCompressionLevel(int $level){
|
||||
|
@ -39,8 +39,6 @@ class ClientCacheBlobStatusPacket extends DataPacket/* implements ServerboundPac
|
||||
/**
|
||||
* @param int[] $hitHashes
|
||||
* @param int[] $missHashes
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function create(array $hitHashes, array $missHashes) : self{
|
||||
//type checks
|
||||
|
@ -37,8 +37,6 @@ class ClientCacheMissResponsePacket extends DataPacket/* implements ClientboundP
|
||||
|
||||
/**
|
||||
* @param ChunkCacheBlob[] $blobs
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function create(array $blobs) : self{
|
||||
//type check
|
||||
|
@ -39,9 +39,6 @@ class ClientCacheStatusPacket extends DataPacket/* implements ServerboundPacket*
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isEnabled() : bool{
|
||||
return $this->enabled;
|
||||
}
|
||||
|
@ -87,8 +87,6 @@ class CommandOutputPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandOutputMessage $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function putCommandMessage(CommandOutputMessage $message){
|
||||
|
@ -164,10 +164,6 @@ class CraftingDataPacket extends DataPacket{
|
||||
|
||||
/**
|
||||
* @param object $entry
|
||||
* @param NetworkBinaryStream $stream
|
||||
* @param int $pos
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private static function writeEntry($entry, NetworkBinaryStream $stream, int $pos) : int{
|
||||
if($entry instanceof ShapelessRecipe){
|
||||
@ -239,8 +235,6 @@ class CraftingDataPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ShapelessRecipe $recipe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addShapelessRecipe(ShapelessRecipe $recipe){
|
||||
@ -248,8 +242,6 @@ class CraftingDataPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ShapedRecipe $recipe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addShapedRecipe(ShapedRecipe $recipe){
|
||||
@ -257,8 +249,6 @@ class CraftingDataPacket extends DataPacket{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FurnaceRecipe $recipe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addFurnaceRecipe(FurnaceRecipe $recipe){
|
||||
|
@ -70,7 +70,6 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
|
||||
/**
|
||||
* Returns whether the packet may legally have unread bytes left in the buffer.
|
||||
* @return bool
|
||||
*/
|
||||
public function mayHaveUnreadBytes() : bool{
|
||||
return false;
|
||||
@ -142,8 +141,6 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
* This method returns a bool to indicate whether the packet was handled or not. If the packet was unhandled, a debug message will be logged with a hexdump of the packet.
|
||||
* Typically this method returns the return value of the handler in the supplied NetworkSession. See other packets for examples how to implement this.
|
||||
*
|
||||
* @param NetworkSession $session
|
||||
*
|
||||
* @return bool true if the packet was handled successfully, false if not.
|
||||
*/
|
||||
abstract public function handle(NetworkSession $session) : bool;
|
||||
|
@ -49,7 +49,6 @@ class EmotePacket extends DataPacket/* implements ClientboundPacket, Serverbound
|
||||
|
||||
/**
|
||||
* TODO: we can't call this getEntityRuntimeId() because of base class collision (crap architecture, thanks Shoghi)
|
||||
* @return int
|
||||
*/
|
||||
public function getEntityRuntimeIdField() : int{
|
||||
return $this->entityRuntimeId;
|
||||
|
@ -70,30 +70,18 @@ class LevelChunkPacket extends DataPacket/* implements ClientboundPacket*/{
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getChunkX() : int{
|
||||
return $this->chunkX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getChunkZ() : int{
|
||||
return $this->chunkZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSubChunkCount() : int{
|
||||
return $this->subChunkCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isCacheEnabled() : bool{
|
||||
return $this->cacheEnabled;
|
||||
}
|
||||
@ -105,9 +93,6 @@ class LevelChunkPacket extends DataPacket/* implements ClientboundPacket*/{
|
||||
return $this->usedBlobHashes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getExtraPayload() : string{
|
||||
return $this->extraPayload;
|
||||
}
|
||||
|
@ -44,16 +44,10 @@ class LevelEventGenericPacket extends DataPacket/* implements ClientboundPacket*
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getEventId() : int{
|
||||
return $this->eventId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEventData() : string{
|
||||
return $this->eventData;
|
||||
}
|
||||
|
@ -181,27 +181,17 @@ class PacketPool{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DataPacket $packet
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function registerPacket(DataPacket $packet){
|
||||
static::$pool[$packet->pid()] = clone $packet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pid
|
||||
*
|
||||
* @return DataPacket
|
||||
*/
|
||||
public static function getPacketById(int $pid) : DataPacket{
|
||||
return isset(static::$pool[$pid]) ? clone static::$pool[$pid] : new UnknownPacket();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buffer
|
||||
*
|
||||
* @return DataPacket
|
||||
* @throws BinaryDataException
|
||||
*/
|
||||
public static function getPacket(string $buffer) : DataPacket{
|
||||
|
@ -56,18 +56,9 @@ class PlayerAuthInputPacket extends DataPacket/* implements ServerboundPacket*/{
|
||||
private $vrGazeDirection = null;
|
||||
|
||||
/**
|
||||
* @param Vector3 $position
|
||||
* @param float $pitch
|
||||
* @param float $yaw
|
||||
* @param float $headYaw
|
||||
* @param float $moveVecX
|
||||
* @param float $moveVecZ
|
||||
* @param int $inputFlags
|
||||
* @param int $inputMode @see InputMode
|
||||
* @param int $playMode @see PlayMode
|
||||
* @param Vector3|null $vrGazeDirection only used when PlayMode::VR
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function create(Vector3 $position, float $pitch, float $yaw, float $headYaw, float $moveVecX, float $moveVecZ, int $inputFlags, int $inputMode, int $playMode, ?Vector3 $vrGazeDirection = null) : self{
|
||||
if($playMode === PlayMode::VR and $vrGazeDirection === null){
|
||||
@ -120,7 +111,6 @@ class PlayerAuthInputPacket extends DataPacket/* implements ServerboundPacket*/{
|
||||
|
||||
/**
|
||||
* @see InputMode
|
||||
* @return int
|
||||
*/
|
||||
public function getInputMode() : int{
|
||||
return $this->inputMode;
|
||||
@ -128,7 +118,6 @@ class PlayerAuthInputPacket extends DataPacket/* implements ServerboundPacket*/{
|
||||
|
||||
/**
|
||||
* @see PlayMode
|
||||
* @return int
|
||||
*/
|
||||
public function getPlayMode() : int{
|
||||
return $this->playMode;
|
||||
|
@ -39,9 +39,6 @@ class RemoveEntityPacket extends DataPacket/* implements ClientboundPacket*/{
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getUvarint1() : int{
|
||||
return $this->uvarint1;
|
||||
}
|
||||
|
@ -31,25 +31,16 @@ class ChunkCacheBlob{
|
||||
|
||||
/**
|
||||
* ChunkCacheBlob constructor.
|
||||
*
|
||||
* @param int $hash
|
||||
* @param string $payload
|
||||
*/
|
||||
public function __construct(int $hash, string $payload){
|
||||
$this->hash = $hash;
|
||||
$this->payload = $payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getHash() : int{
|
||||
return $this->hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPayload() : string{
|
||||
return $this->payload;
|
||||
}
|
||||
|
@ -32,8 +32,6 @@ class CommandEnumConstraint{
|
||||
private $constraints; //TODO: find constants
|
||||
|
||||
/**
|
||||
* @param CommandEnum $enum
|
||||
* @param int $valueOffset
|
||||
* @param int[] $constraints
|
||||
*/
|
||||
public function __construct(CommandEnum $enum, int $valueOffset, array $constraints){
|
||||
|
@ -83,8 +83,6 @@ class NetworkInventoryAction{
|
||||
public $newItem;
|
||||
|
||||
/**
|
||||
* @param InventoryTransactionPacket $packet
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function read(InventoryTransactionPacket $packet){
|
||||
@ -114,7 +112,6 @@ class NetworkInventoryAction{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param InventoryTransactionPacket $packet
|
||||
* @return void
|
||||
*/
|
||||
public function write(InventoryTransactionPacket $packet){
|
||||
@ -142,8 +139,6 @@ class NetworkInventoryAction{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
*
|
||||
* @return InventoryAction|null
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
|
@ -129,12 +129,6 @@ final class RuntimeBlockMapping{
|
||||
return $table;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function toStaticRuntimeId(int $id, int $meta = 0) : int{
|
||||
self::lazyInit();
|
||||
/*
|
||||
@ -146,8 +140,6 @@ final class RuntimeBlockMapping{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $runtimeId
|
||||
*
|
||||
* @return int[] [id, meta]
|
||||
*/
|
||||
public static function fromStaticRuntimeId(int $runtimeId) : array{
|
||||
|
@ -32,17 +32,11 @@ interface SkinAdapter{
|
||||
|
||||
/**
|
||||
* Allows you to convert a skin entity to skin data.
|
||||
*
|
||||
* @param Skin $skin
|
||||
* @return SkinData
|
||||
*/
|
||||
public function toSkinData(Skin $skin) : SkinData;
|
||||
|
||||
/**
|
||||
* Allows you to convert skin data to a skin entity.
|
||||
*
|
||||
* @param SkinData $data
|
||||
* @return Skin
|
||||
*/
|
||||
public function fromSkinData(SkinData $data) : Skin;
|
||||
}
|
||||
|
@ -44,8 +44,6 @@ class SkinAnimation{
|
||||
|
||||
/**
|
||||
* Image of the animation.
|
||||
*
|
||||
* @return SkinImage
|
||||
*/
|
||||
public function getImage() : SkinImage{
|
||||
return $this->image;
|
||||
@ -53,8 +51,6 @@ class SkinAnimation{
|
||||
|
||||
/**
|
||||
* The type of animation you are applying.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getType() : int{
|
||||
return $this->type;
|
||||
@ -62,8 +58,6 @@ class SkinAnimation{
|
||||
|
||||
/**
|
||||
* The total amount of frames in an animation.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getFrames() : float{
|
||||
return $this->frames;
|
||||
|
@ -49,17 +49,7 @@ class SkinData{
|
||||
private $capeId;
|
||||
|
||||
/**
|
||||
* @param string $skinId
|
||||
* @param string $resourcePatch
|
||||
* @param SkinImage $skinImage
|
||||
* @param SkinAnimation[] $animations
|
||||
* @param SkinImage|null $capeImage
|
||||
* @param string $geometryData
|
||||
* @param string $animationData
|
||||
* @param bool $premium
|
||||
* @param bool $persona
|
||||
* @param bool $personaCapeOnClassic
|
||||
* @param string $capeId
|
||||
*/
|
||||
public function __construct(string $skinId, string $resourcePatch, SkinImage $skinImage, array $animations = [], SkinImage $capeImage = null, string $geometryData = "", string $animationData = "", bool $premium = false, bool $persona = false, bool $personaCapeOnClassic = false, string $capeId = ""){
|
||||
$this->skinId = $skinId;
|
||||
@ -75,23 +65,14 @@ class SkinData{
|
||||
$this->capeId = $capeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSkinId() : string{
|
||||
return $this->skinId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getResourcePatch() : string{
|
||||
return $this->resourcePatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SkinImage
|
||||
*/
|
||||
public function getSkinImage() : SkinImage{
|
||||
return $this->skinImage;
|
||||
}
|
||||
@ -103,51 +84,30 @@ class SkinData{
|
||||
return $this->animations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SkinImage
|
||||
*/
|
||||
public function getCapeImage() : SkinImage{
|
||||
return $this->capeImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getGeometryData() : string{
|
||||
return $this->geometryData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnimationData() : string{
|
||||
return $this->animationData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPersona() : bool{
|
||||
return $this->persona;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPremium() : bool{
|
||||
return $this->premium;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPersonaCapeOnClassic() : bool{
|
||||
return $this->personaCapeOnClassic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCapeId() : string{
|
||||
return $this->capeId;
|
||||
}
|
||||
|
Reference in New Issue
Block a user