diff --git a/src/MemoryManager.php b/src/MemoryManager.php index 008e720e9..adce63085 100644 --- a/src/MemoryManager.php +++ b/src/MemoryManager.php @@ -174,33 +174,20 @@ class MemoryManager{ gc_enable(); } - /** - * @return bool - */ public function isLowMemory() : bool{ return $this->lowMemory; } - /** - * @return int - */ public function getGlobalMemoryLimit() : int{ return $this->globalMemoryLimit; } - /** - * @return bool - */ public function canUseChunkCache() : bool{ return !$this->lowMemory or !$this->lowMemDisableChunkCache; } /** * Returns the allowed chunk radius based on the current memory usage. - * - * @param int $distance - * - * @return int */ public function getViewDistance(int $distance) : int{ return ($this->lowMemory and $this->lowMemChunkRadiusOverride > 0) ? (int) min($this->lowMemChunkRadiusOverride, $distance) : $distance; @@ -208,11 +195,6 @@ class MemoryManager{ /** * Triggers garbage collection and cache cleanup to try and free memory. - * - * @param int $memory - * @param int $limit - * @param bool $global - * @param int $triggerCount */ public function trigger(int $memory, int $limit, bool $global = false, int $triggerCount = 0) : void{ $this->logger->debug(sprintf("%sLow memory triggered, limit %gMB, using %gMB", @@ -280,9 +262,6 @@ class MemoryManager{ Timings::$memoryManagerTimer->stopTiming(); } - /** - * @return int - */ public function triggerGarbageCollector() : int{ Timings::$garbageCollectorTimer->startTiming(); @@ -305,10 +284,6 @@ class MemoryManager{ /** * Dumps the server memory into the specified output folder. - * - * @param string $outputFolder - * @param int $maxNesting - * @param int $maxStringSize */ public function dumpServerMemory(string $outputFolder, int $maxNesting, int $maxStringSize) : void{ $logger = new \PrefixedLogger($this->server->getLogger(), "Memory Dump"); @@ -327,10 +302,6 @@ class MemoryManager{ * Static memory dumper accessible from any thread. * * @param mixed $startingObject - * @param string $outputFolder - * @param int $maxNesting - * @param int $maxStringSize - * @param \Logger $logger * * @throws \ReflectionException */ @@ -488,9 +459,6 @@ class MemoryManager{ * @param mixed $data reference parameter * @param object[] $objects reference parameter * @param int[] $refCounts reference parameter - * @param int $recursion - * @param int $maxNesting - * @param int $maxStringSize */ private static function continueDump($from, &$data, array &$objects, array &$refCounts, int $recursion, int $maxNesting, int $maxStringSize) : void{ if($maxNesting <= 0){ diff --git a/src/Server.php b/src/Server.php index 2bd8f86b9..72d458643 100644 --- a/src/Server.php +++ b/src/Server.php @@ -284,72 +284,42 @@ class Server{ /** @var Player[] */ private $playerList = []; - /** - * @return string - */ public function getName() : string{ return \pocketmine\NAME; } - /** - * @return bool - */ public function isRunning() : bool{ return $this->isRunning; } - /** - * @return string - */ public function getPocketMineVersion() : string{ return \pocketmine\VERSION; } - /** - * @return string - */ public function getVersion() : string{ return ProtocolInfo::MINECRAFT_VERSION; } - /** - * @return string - */ public function getApiVersion() : string{ return \pocketmine\BASE_VERSION; } - /** - * @return string - */ public function getFilePath() : string{ return \pocketmine\PATH; } - /** - * @return string - */ public function getResourcePath() : string{ return \pocketmine\RESOURCE_PATH; } - /** - * @return string - */ public function getDataPath() : string{ return $this->dataPath; } - /** - * @return string - */ public function getPluginPath() : string{ return $this->pluginPath; } - /** - * @return int - */ public function getMaxPlayers() : int{ return $this->maxPlayers; } @@ -357,8 +327,6 @@ class Server{ /** * Returns whether the server requires that players be authenticated to Xbox Live. If true, connecting players who * are not logged into Xbox Live will be disconnected. - * - * @return bool */ public function getOnlineMode() : bool{ return $this->onlineMode; @@ -366,40 +334,26 @@ class Server{ /** * Alias of {@link #getOnlineMode()}. - * @return bool */ public function requiresAuthentication() : bool{ return $this->getOnlineMode(); } - /** - * @return int - */ public function getPort() : int{ return $this->getConfigInt("server-port", 19132); } - /** - * @return int - */ public function getViewDistance() : int{ return max(2, $this->getConfigInt("view-distance", 8)); } /** * Returns a view distance up to the currently-allowed limit. - * - * @param int $distance - * - * @return int */ public function getAllowedViewDistance(int $distance) : int{ return max(2, min($distance, $this->memoryManager->getViewDistance($this->getViewDistance()))); } - /** - * @return string - */ public function getIp() : string{ $str = $this->getConfigString("server-ip"); return $str !== "" ? $str : "0.0.0.0"; @@ -412,45 +366,29 @@ class Server{ return $this->serverID; } - /** - * @return GameMode - */ public function getGamemode() : GameMode{ return GameMode::fromMagicNumber($this->getConfigInt("gamemode", 0) & 0b11); } - /** - * @return bool - */ public function getForceGamemode() : bool{ return $this->getConfigBool("force-gamemode", false); } /** * Returns Server global difficulty. Note that this may be overridden in individual worlds. - * @return int */ public function getDifficulty() : int{ return $this->getConfigInt("difficulty", World::DIFFICULTY_NORMAL); } - /** - * @return bool - */ public function hasWhitelist() : bool{ return $this->getConfigBool("white-list", false); } - /** - * @return bool - */ public function isHardcore() : bool{ return $this->getConfigBool("hardcore", false); } - /** - * @return string - */ public function getMotd() : string{ return $this->getConfigString("motd", \pocketmine\NAME . " Server"); } @@ -490,16 +428,10 @@ class Server{ return $this->craftingManager; } - /** - * @return ResourcePackManager - */ public function getResourcePackManager() : ResourcePackManager{ return $this->resourceManager; } - /** - * @return WorldManager - */ public function getWorldManager() : WorldManager{ return $this->worldManager; } @@ -508,17 +440,12 @@ class Server{ return $this->asyncPool; } - /** - * @return int - */ public function getTick() : int{ return $this->tickCounter; } /** * Returns the last server TPS measure - * - * @return float */ public function getTicksPerSecond() : float{ return round($this->currentTPS, 2); @@ -526,8 +453,6 @@ class Server{ /** * Returns the last server TPS average measure - * - * @return float */ public function getTicksPerSecondAverage() : float{ return round(array_sum($this->tickAverage) / count($this->tickAverage), 2); @@ -535,8 +460,6 @@ class Server{ /** * Returns the TPS usage/load in % - * - * @return float */ public function getTickUsage() : float{ return round($this->currentUse * 100, 2); @@ -544,16 +467,11 @@ class Server{ /** * Returns the TPS usage/load average in % - * - * @return float */ public function getTickUsageAverage() : float{ return round((array_sum($this->useAverage) / count($this->useAverage)) * 100, 2); } - /** - * @return float - */ public function getStartTime() : float{ return $this->startTime; } @@ -577,8 +495,6 @@ class Server{ } /** - * @param string $name - * * @return OfflinePlayer|Player */ public function getOfflinePlayer(string $name){ @@ -594,21 +510,12 @@ class Server{ /** * Returns whether the server has stored any saved data for this player. - * - * @param string $name - * - * @return bool */ public function hasOfflinePlayerData(string $name) : bool{ $name = strtolower($name); return file_exists($this->getDataPath() . "players/$name.dat"); } - /** - * @param string $name - * - * @return CompoundTag|null - */ public function getOfflinePlayerData(string $name) : ?CompoundTag{ $name = strtolower($name); $path = $this->getDataPath() . "players/"; @@ -624,10 +531,6 @@ class Server{ return null; } - /** - * @param string $name - * @param CompoundTag $nbtTag - */ public function saveOfflinePlayerData(string $name, CompoundTag $nbtTag) : void{ $ev = new PlayerDataSaveEvent($nbtTag, $name); $ev->setCancelled(!$this->shouldSavePlayerData()); @@ -650,10 +553,6 @@ class Server{ * The closest match will be returned, or null if there are no online matches. * * @see Server::getPlayerExact() - * - * @param string $name - * - * @return Player|null */ public function getPlayer(string $name) : ?Player{ $found = null; @@ -677,10 +576,6 @@ class Server{ /** * Returns an online player with the given name (case insensitive), or null if not found. - * - * @param string $name - * - * @return Player|null */ public function getPlayerExact(string $name) : ?Player{ $name = strtolower($name); @@ -697,8 +592,6 @@ class Server{ * Returns a list of online players whose names contain with the given string (case insensitive). * If an exact match is found, only that match is returned. * - * @param string $partialName - * * @return Player[] */ public function matchPlayer(string $partialName) : array{ @@ -718,10 +611,6 @@ class Server{ /** * Returns the player online with the specified raw UUID, or null if not found - * - * @param string $rawUUID - * - * @return null|Player */ public function getPlayerByRawUUID(string $rawUUID) : ?Player{ return $this->playerList[$rawUUID] ?? null; @@ -729,17 +618,12 @@ class Server{ /** * Returns the player online with a UUID equivalent to the specified UUID object, or null if not found - * - * @param UUID $uuid - * - * @return null|Player */ public function getPlayerByUUID(UUID $uuid) : ?Player{ return $this->getPlayerByRawUUID($uuid->toBinary()); } /** - * @param string $variable * @param mixed $defaultValue * * @return mixed @@ -757,12 +641,6 @@ class Server{ return $this->propertyCache[$variable] ?? $defaultValue; } - /** - * @param string $variable - * @param string $defaultValue - * - * @return string - */ public function getConfigString(string $variable, string $defaultValue = "") : string{ $v = getopt("", ["$variable::"]); if(isset($v[$variable])){ @@ -772,20 +650,10 @@ class Server{ return $this->properties->exists($variable) ? (string) $this->properties->get($variable) : $defaultValue; } - /** - * @param string $variable - * @param string $value - */ public function setConfigString(string $variable, string $value) : void{ $this->properties->set($variable, $value); } - /** - * @param string $variable - * @param int $defaultValue - * - * @return int - */ public function getConfigInt(string $variable, int $defaultValue = 0) : int{ $v = getopt("", ["$variable::"]); if(isset($v[$variable])){ @@ -795,20 +663,10 @@ class Server{ return $this->properties->exists($variable) ? (int) $this->properties->get($variable) : $defaultValue; } - /** - * @param string $variable - * @param int $value - */ public function setConfigInt(string $variable, int $value) : void{ $this->properties->set($variable, $value); } - /** - * @param string $variable - * @param bool $defaultValue - * - * @return bool - */ public function getConfigBool(string $variable, bool $defaultValue = false) : bool{ $v = getopt("", ["$variable::"]); if(isset($v[$variable])){ @@ -831,17 +689,11 @@ class Server{ return false; } - /** - * @param string $variable - * @param bool $value - */ public function setConfigBool(string $variable, bool $value) : void{ $this->properties->set($variable, $value ? "1" : "0"); } /** - * @param string $name - * * @return PluginIdentifiableCommand|null */ public function getPluginCommand(string $name){ @@ -866,9 +718,6 @@ class Server{ return $this->banByIP; } - /** - * @param string $name - */ public function addOp(string $name) : void{ $this->operators->set(strtolower($name), true); @@ -878,9 +727,6 @@ class Server{ $this->operators->save(); } - /** - * @param string $name - */ public function removeOp(string $name) : void{ $this->operators->remove(strtolower($name)); @@ -890,36 +736,20 @@ class Server{ $this->operators->save(); } - /** - * @param string $name - */ public function addWhitelist(string $name) : void{ $this->whitelist->set(strtolower($name), true); $this->whitelist->save(); } - /** - * @param string $name - */ public function removeWhitelist(string $name) : void{ $this->whitelist->remove(strtolower($name)); $this->whitelist->save(); } - /** - * @param string $name - * - * @return bool - */ public function isWhitelisted(string $name) : bool{ return !$this->hasWhitelist() or $this->operators->exists($name, true) or $this->whitelist->exists($name, true); } - /** - * @param string $name - * - * @return bool - */ public function isOp(string $name) : bool{ return $this->operators->exists($name, true); } @@ -960,9 +790,6 @@ class Server{ return $result; } - /** - * @return Server - */ public static function getInstance() : Server{ if(self::$instance === null){ throw new \RuntimeException("Attempt to retrieve Server instance outside server thread"); @@ -970,12 +797,6 @@ class Server{ return self::$instance; } - /** - * @param \DynamicClassLoader $autoloader - * @param \AttachableThreadedLogger $logger - * @param string $dataPath - * @param string $pluginPath - */ public function __construct(\DynamicClassLoader $autoloader, \AttachableThreadedLogger $logger, string $dataPath, string $pluginPath){ if(self::$instance !== null){ throw new \InvalidStateException("Only one server instance can exist at once"); @@ -1316,8 +1137,6 @@ class Server{ /** * @param TextContainer|string $message * @param CommandSender[] $recipients - * - * @return int */ public function broadcastMessage($message, ?array $recipients = null) : int{ if(!is_array($recipients)){ @@ -1343,10 +1162,7 @@ class Server{ } /** - * @param string $tip * @param Player[] $recipients - * - * @return int */ public function broadcastTip(string $tip, ?array $recipients = null) : int{ $recipients = $recipients ?? $this->selectPermittedPlayers(self::BROADCAST_CHANNEL_USERS); @@ -1359,10 +1175,7 @@ class Server{ } /** - * @param string $popup * @param Player[] $recipients - * - * @return int */ public function broadcastPopup(string $popup, ?array $recipients = null) : int{ $recipients = $recipients ?? $this->selectPermittedPlayers(self::BROADCAST_CHANNEL_USERS); @@ -1375,14 +1188,10 @@ class Server{ } /** - * @param string $title - * @param string $subtitle * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. * @param int $stay Duration in ticks to stay on screen for * @param int $fadeOut Duration in ticks for fade-out. * @param Player[]|null $recipients - * - * @return int */ public function broadcastTitle(string $title, string $subtitle = "", int $fadeIn = -1, int $stay = -1, int $fadeOut = -1, ?array $recipients = null) : int{ $recipients = $recipients ?? $this->selectPermittedPlayers(self::BROADCAST_CHANNEL_USERS); @@ -1396,9 +1205,6 @@ class Server{ /** * @param TextContainer|string $message - * @param string $permissions - * - * @return int */ public function broadcast($message, string $permissions) : int{ /** @var CommandSender[] $recipients */ @@ -1421,8 +1227,6 @@ class Server{ /** * @param Player[] $players * @param ClientboundPacket[] $packets - * - * @return bool */ public function broadcastPackets(array $players, array $packets) : bool{ if(count($packets) === 0){ @@ -1467,11 +1271,6 @@ class Server{ /** * Broadcasts a list of packets in a batch to a list of players - * - * @param PacketBatch $stream - * @param bool $forceSync - * - * @return CompressBatchPromise */ public function prepareBatch(PacketBatch $stream, bool $forceSync = false) : CompressBatchPromise{ try{ @@ -1498,9 +1297,6 @@ class Server{ } } - /** - * @param PluginLoadOrder $type - */ public function enablePlugins(PluginLoadOrder $type) : void{ foreach($this->pluginManager->getPlugins() as $plugin){ if(!$plugin->isEnabled() and $plugin->getDescription()->getOrder()->equals($type)){ @@ -1516,12 +1312,6 @@ class Server{ /** * Executes a command from a CommandSender - * - * @param CommandSender $sender - * @param string $commandLine - * @param bool $internal - * - * @return bool */ public function dispatchCommand(CommandSender $sender, string $commandLine, bool $internal = false) : bool{ if(!$internal){ @@ -1627,7 +1417,6 @@ class Server{ } /** - * @param \Throwable $e * @param array|null $trace */ public function exceptionHandler(\Throwable $e, $trace = null) : void{ @@ -1799,9 +1588,6 @@ class Server{ return $this->language; } - /** - * @return bool - */ public function isLanguageForced() : bool{ return $this->forceLanguage; } diff --git a/src/block/Banner.php b/src/block/Banner.php index cf32d486b..9091d5bfb 100644 --- a/src/block/Banner.php +++ b/src/block/Banner.php @@ -120,7 +120,6 @@ class Banner extends Transparent{ /** * TODO: interface method? this is only the BASE colour... - * @return DyeColor */ public function getColor() : DyeColor{ return $this->baseColor; diff --git a/src/block/BaseRail.php b/src/block/BaseRail.php index 8bcd22e4b..cff41ea3d 100644 --- a/src/block/BaseRail.php +++ b/src/block/BaseRail.php @@ -124,10 +124,6 @@ abstract class BaseRail extends Flowable{ /** * Returns a meta value for the rail with the given connections. * - * @param array $connections - * - * @return int - * * @throws \InvalidArgumentException if no state matches the given connections */ protected function getMetaForState(array $connections) : int{ @@ -137,8 +133,6 @@ abstract class BaseRail extends Flowable{ /** * Returns the connection directions of this rail (depending on the current block state) * - * @param int $meta - * * @return int[] */ abstract protected function getConnectionsFromMeta(int $meta) : ?array; diff --git a/src/block/Bed.php b/src/block/Bed.php index a8f4cdf47..fb5c35f23 100644 --- a/src/block/Bed.php +++ b/src/block/Bed.php @@ -99,9 +99,6 @@ class Bed extends Transparent{ return $this->head; } - /** - * @return bool - */ public function isOccupied() : bool{ return $this->occupied; } @@ -116,16 +113,10 @@ class Bed extends Transparent{ } } - /** - * @return int - */ private function getOtherHalfSide() : int{ return $this->head ? Facing::opposite($this->facing) : $this->facing; } - /** - * @return Bed|null - */ public function getOtherHalf() : ?Bed{ $other = $this->getSide($this->getOtherHalfSide()); if($other instanceof Bed and $other->head !== $this->head and $other->facing === $this->facing){ diff --git a/src/block/Block.php b/src/block/Block.php index 993b94d60..e006a4217 100644 --- a/src/block/Block.php +++ b/src/block/Block.php @@ -68,9 +68,7 @@ class Block{ protected $collisionBoxes = null; /** - * @param BlockIdentifier $idInfo * @param string $name English name of the block type (TODO: implement translations) - * @param BlockBreakInfo $breakInfo */ public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){ if(($idInfo->getVariant() & $this->getStateBitmask()) !== 0){ @@ -90,23 +88,16 @@ class Block{ return $this->idInfo; } - /** - * @return string - */ public function getName() : string{ return $this->fallbackName; } - /** - * @return int - */ public function getId() : int{ return $this->idInfo->getBlockId(); } /** * @internal - * @return int */ public function getFullId() : int{ return ($this->getId() << 4) | $this->getMeta(); @@ -118,26 +109,19 @@ class Block{ /** * @internal - * @return int */ public function getRuntimeId() : int{ return RuntimeBlockMapping::toStaticRuntimeId($this->getId(), $this->getMeta()); } - /** - * @return int - */ public function getMeta() : int{ $stateMeta = $this->writeStateToMeta(); assert(($stateMeta & ~$this->getStateBitmask()) === 0); return $this->idInfo->getVariant() | $stateMeta; } - /** * Returns a bitmask used to extract state bits from block metadata. - * - * @return int */ public function getStateBitmask() : int{ return 0; @@ -148,9 +132,6 @@ class Block{ } /** - * @param int $id - * @param int $stateMeta - * * @throws InvalidBlockStateException */ public function readStateFromData(int $id, int $stateMeta) : void{ @@ -191,10 +172,6 @@ class Block{ * * Note: This ignores additional IDs used to represent additional states. This means that, for example, a lit * furnace and unlit furnace are considered the same type. - * - * @param Block $other - * - * @return bool */ public function isSameType(Block $other) : bool{ return $this->idInfo->getBlockId() === $other->idInfo->getBlockId() and $this->idInfo->getVariant() === $other->idInfo->getVariant(); @@ -202,10 +179,6 @@ class Block{ /** * Returns whether the given block has the same type and properties as this block. - * - * @param Block $other - * - * @return bool */ public function isSameState(Block $other) : bool{ return $this->isSameType($other) and $this->writeStateToMeta() === $other->writeStateToMeta(); @@ -213,15 +186,11 @@ class Block{ /** * AKA: Block->isPlaceable - * @return bool */ public function canBePlaced() : bool{ return true; } - /** - * @return bool - */ public function canBeReplaced() : bool{ return false; } @@ -232,16 +201,6 @@ class Block{ /** * Places the Block, using block space and block target, and side. Returns if the block has been placed. - * - * @param BlockTransaction $tx - * @param Item $item - * @param Block $blockReplace - * @param Block $blockClicked - * @param int $face - * @param Vector3 $clickVector - * @param Player|null $player - * - * @return bool */ public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ $tx->addBlock($blockReplace->pos, $this); @@ -254,8 +213,6 @@ class Block{ /** * Returns an object containing information about the destruction requirements of this block. - * - * @return BlockBreakInfo */ public function getBreakInfo() : BlockBreakInfo{ return $this->breakInfo; @@ -263,11 +220,6 @@ class Block{ /** * Do the actions needed so the block is broken with the Item - * - * @param Item $item - * @param Player|null $player - * - * @return bool */ public function onBreak(Item $item, ?Player $player = null) : bool{ if(($t = $this->pos->getWorld()->getTile($this->pos)) !== null){ @@ -286,8 +238,6 @@ class Block{ /** * Returns whether random block updates will be done on this block. - * - * @return bool */ public function ticksRandomly() : bool{ return false; @@ -310,13 +260,6 @@ class Block{ /** * Do actions when interacted by Item. Returns if it has done anything - * - * @param Item $item - * @param int $face - * @param Vector3 $clickVector - * @param Player|null $player - * - * @return bool */ public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ return false; @@ -326,19 +269,12 @@ class Block{ * Called when this block is attacked (left-clicked). This is called when a player left-clicks the block to try and * start to break it in survival mode. * - * @param Item $item - * @param int $face - * @param Player|null $player - * * @return bool if an action took place, prevents starting to break the block if true. */ public function onAttack(Item $item, int $face, ?Player $player = null) : bool{ return false; } - /** - * @return float - */ public function getFrictionFactor() : float{ return 0.6; } @@ -366,16 +302,11 @@ class Block{ * Examples of this behaviour include leaves and cobwebs. * * Light-diffusing blocks are included by the heightmap. - * - * @return bool */ public function diffusesSkyLight() : bool{ return false; } - /** - * @return bool - */ public function isTransparent() : bool{ return false; } @@ -386,7 +317,6 @@ class Block{ /** * AKA: Block->isFlowable - * @return bool */ public function canBeFlowedInto() : bool{ return false; @@ -398,7 +328,6 @@ class Block{ /** * Returns whether entities can climb up this block. - * @return bool */ public function canClimb() : bool{ return false; @@ -415,11 +344,6 @@ class Block{ /** * @internal - * - * @param World $world - * @param int $x - * @param int $y - * @param int $z */ final public function position(World $world, int $x, int $y, int $z) : void{ $this->pos->x = $x; @@ -431,8 +355,6 @@ class Block{ /** * Returns an array of Item objects to be dropped * - * @param Item $item - * * @return Item[] */ public function getDrops(Item $item) : array{ @@ -450,8 +372,6 @@ class Block{ /** * Returns an array of Items to be dropped when the block is broken using the correct tool type. * - * @param Item $item - * * @return Item[] */ public function getDropsForCompatibleTool(Item $item) : array{ @@ -461,8 +381,6 @@ class Block{ /** * Returns an array of Items to be dropped when the block is broken using a compatible Silk Touch-enchanted tool. * - * @param Item $item - * * @return Item[] */ public function getSilkTouchDrops(Item $item) : array{ @@ -471,10 +389,6 @@ class Block{ /** * Returns how much XP will be dropped by breaking this block with the given item. - * - * @param Item $item - * - * @return int */ public function getXpDropForTool(Item $item) : int{ if($item->hasEnchantment(Enchantment::SILK_TOUCH()) or !$this->breakInfo->isToolCompatible($item)){ @@ -486,8 +400,6 @@ class Block{ /** * Returns how much XP this block will drop when broken with an appropriate tool. - * - * @return int */ protected function getXpDropAmount() : int{ return 0; @@ -496,8 +408,6 @@ class Block{ /** * Returns whether Silk Touch enchanted tools will cause this block to drop as itself. Since most blocks drop * themselves anyway, this is implicitly true. - * - * @return bool */ public function isAffectedBySilkTouch() : bool{ return true; @@ -505,10 +415,6 @@ class Block{ /** * Returns the item that players will equip when middle-clicking on this block. - * - * @param bool $addUserData - * - * @return Item */ public function getPickedItem(bool $addUserData = false) : Item{ $item = $this->asItem(); @@ -527,7 +433,6 @@ class Block{ /** * Returns the time in ticks which the block will fuel a furnace for. - * @return int */ public function getFuelTime() : int{ return 0; @@ -536,8 +441,6 @@ class Block{ /** * Returns the chance that the block will catch fire from nearby fire sources. Higher values lead to faster catching * fire. - * - * @return int */ public function getFlameEncouragement() : int{ return 0; @@ -545,8 +448,6 @@ class Block{ /** * Returns the base flammability of this block. Higher values lead to the block burning away more quickly. - * - * @return int */ public function getFlammability() : int{ return 0; @@ -554,8 +455,6 @@ class Block{ /** * Returns whether fire lit on this block will burn indefinitely. - * - * @return bool */ public function burnsForever() : bool{ return false; @@ -563,8 +462,6 @@ class Block{ /** * Returns whether this block can catch fire. - * - * @return bool */ public function isFlammable() : bool{ return $this->getFlammability() > 0; @@ -580,9 +477,6 @@ class Block{ /** * Returns the Block on the side $side, works like Vector3::getSide() * - * @param int $side - * @param int $step - * * @return Block */ public function getSide(int $side, int $step = 1){ @@ -641,10 +535,6 @@ class Block{ /** * Checks for collision against an AxisAlignedBB - * - * @param AxisAlignedBB $bb - * - * @return bool */ public function collidesWithBB(AxisAlignedBB $bb) : bool{ foreach($this->getCollisionBoxes() as $bb2){ @@ -659,8 +549,6 @@ class Block{ /** * Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting * with the collision box or bounding box. - * - * @param Entity $entity */ public function onEntityInside(Entity $entity) : void{ @@ -687,21 +575,12 @@ class Block{ return [AxisAlignedBB::one()]; } - /** - * @return bool - */ public function isFullCube() : bool{ $bb = $this->getCollisionBoxes(); return count($bb) === 1 and $bb[0]->getAverageEdgeLength() >= 1; //TODO: average length 1 != cube } - /** - * @param Vector3 $pos1 - * @param Vector3 $pos2 - * - * @return RayTraceResult|null - */ public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?RayTraceResult{ $bbs = $this->getCollisionBoxes(); if(count($bbs) === 0){ diff --git a/src/block/BlockBreakInfo.php b/src/block/BlockBreakInfo.php index 68e287bb6..cff5a9034 100644 --- a/src/block/BlockBreakInfo.php +++ b/src/block/BlockBreakInfo.php @@ -38,9 +38,6 @@ class BlockBreakInfo{ private $toolHarvestLevel; /** - * @param float $hardness - * @param int $toolType - * @param int $toolHarvestLevel * @param float|null $blastResistance default 5x hardness */ public function __construct(float $hardness, int $toolType = BlockToolType::NONE, int $toolHarvestLevel = 0, ?float $blastResistance = null){ @@ -60,8 +57,6 @@ class BlockBreakInfo{ /** * Returns a base value used to compute block break times. - * - * @return float */ public function getHardness() : float{ return $this->hardness; @@ -69,8 +64,6 @@ class BlockBreakInfo{ /** * Returns whether the block can be broken at all. - * - * @return bool */ public function isBreakable() : bool{ return $this->hardness >= 0; @@ -78,8 +71,6 @@ class BlockBreakInfo{ /** * Returns whether this block can be instantly broken. - * - * @return bool */ public function breaksInstantly() : bool{ return $this->hardness == 0.0; @@ -87,16 +78,11 @@ class BlockBreakInfo{ /** * Returns the block's resistance to explosions. Usually 5x hardness. - * - * @return float */ public function getBlastResistance() : float{ return $this->blastResistance; } - /** - * @return int - */ public function getToolType() : int{ return $this->toolType; } @@ -110,8 +96,6 @@ class BlockBreakInfo{ * Otherwise, 1 should be returned if a tool is required, 0 if not. * * @see Item::getBlockToolHarvestLevel() - * - * @return int */ public function getToolHarvestLevel() : int{ return $this->toolHarvestLevel; @@ -123,10 +107,6 @@ class BlockBreakInfo{ * * In most cases this is also used to determine whether block drops should be created or not, except in some * special cases such as vines. - * - * @param Item $tool - * - * @return bool */ public function isToolCompatible(Item $tool) : bool{ if($this->hardness < 0){ @@ -140,9 +120,6 @@ class BlockBreakInfo{ /** * Returns the seconds that this block takes to be broken using an specific Item * - * @param Item $item - * - * @return float * @throws \InvalidArgumentException if the item efficiency is not a positive number */ public function getBreakTime(Item $item) : float{ diff --git a/src/block/BlockFactory.php b/src/block/BlockFactory.php index 065f34eac..5c34585e3 100644 --- a/src/block/BlockFactory.php +++ b/src/block/BlockFactory.php @@ -763,7 +763,6 @@ class BlockFactory{ * NOTE: If you are registering a new block type, you will need to add it to the creative inventory yourself - it * will not automatically appear there. * - * @param Block $block * @param bool $override Whether to override existing registrations * * @throws \RuntimeException if something attempted to override an already-registered block without specifying the @@ -828,11 +827,6 @@ class BlockFactory{ /** * Returns a new Block instance with the specified ID, meta and position. - * - * @param int $id - * @param int $meta - * - * @return Block */ public static function get(int $id, int $meta = 0) : Block{ if($meta < 0 or $meta > 0xf){ @@ -863,11 +857,6 @@ class BlockFactory{ /** * Returns whether a specified block state is already registered in the block factory. - * - * @param int $id - * @param int $meta - * - * @return bool */ public static function isRegistered(int $id, int $meta = 0) : bool{ $b = self::$fullList[($id << 4) | $meta]; diff --git a/src/block/BlockIdentifier.php b/src/block/BlockIdentifier.php index 87cae2ad7..87faf3a31 100644 --- a/src/block/BlockIdentifier.php +++ b/src/block/BlockIdentifier.php @@ -41,9 +41,6 @@ class BlockIdentifier{ $this->tileClass = $tileClass; } - /** - * @return int - */ public function getBlockId() : int{ return $this->blockId; } @@ -55,23 +52,14 @@ class BlockIdentifier{ return [$this->blockId]; } - /** - * @return int - */ public function getVariant() : int{ return $this->variant; } - /** - * @return int - */ public function getItemId() : int{ return $this->itemId ?? ($this->blockId > 255 ? 255 - $this->blockId : $this->blockId); } - /** - * @return string|null - */ public function getTileClass() : ?string{ return $this->tileClass; } diff --git a/src/block/BlockIdentifierFlattened.php b/src/block/BlockIdentifierFlattened.php index adbeddede..f22c801d7 100644 --- a/src/block/BlockIdentifierFlattened.php +++ b/src/block/BlockIdentifierFlattened.php @@ -33,9 +33,6 @@ class BlockIdentifierFlattened extends BlockIdentifier{ $this->secondId = $secondId; } - /** - * @return int - */ public function getSecondId() : int{ return $this->secondId; } diff --git a/src/block/ConcretePowder.php b/src/block/ConcretePowder.php index 5261ddc7b..432c6ef7c 100644 --- a/src/block/ConcretePowder.php +++ b/src/block/ConcretePowder.php @@ -44,16 +44,10 @@ class ConcretePowder extends Opaque implements Fallable{ } } - /** - * @return null|Block - */ public function tickFalling() : ?Block{ return $this->checkAdjacentWater(); } - /** - * @return null|Block - */ private function checkAdjacentWater() : ?Block{ foreach(Facing::ALL as $i){ if($i === Facing::DOWN){ diff --git a/src/block/DaylightSensor.php b/src/block/DaylightSensor.php index ad16340cf..5892bf0ab 100644 --- a/src/block/DaylightSensor.php +++ b/src/block/DaylightSensor.php @@ -70,8 +70,6 @@ class DaylightSensor extends Transparent{ } /** - * @param bool $inverted - * * @return $this */ public function setInverted(bool $inverted = true) : self{ diff --git a/src/block/DoublePlant.php b/src/block/DoublePlant.php index 2e1a89111..bfb02c8dd 100644 --- a/src/block/DoublePlant.php +++ b/src/block/DoublePlant.php @@ -64,7 +64,6 @@ class DoublePlant extends Flowable{ /** * Returns whether this double-plant has a corresponding other half. - * @return bool */ public function isValidHalfPlant() : bool{ $other = $this->getSide($this->top ? Facing::DOWN : Facing::UP); diff --git a/src/block/Element.php b/src/block/Element.php index 16234b308..f12ab8672 100644 --- a/src/block/Element.php +++ b/src/block/Element.php @@ -39,23 +39,14 @@ class Element extends Opaque{ $this->symbol = $symbol; } - /** - * @return int - */ public function getAtomicWeight() : int{ return $this->atomicWeight; } - /** - * @return int - */ public function getGroup() : int{ return $this->group; } - /** - * @return string - */ public function getSymbol() : string{ return $this->symbol; } diff --git a/src/block/FlowerPot.php b/src/block/FlowerPot.php index 5f19a7575..1e8edd16f 100644 --- a/src/block/FlowerPot.php +++ b/src/block/FlowerPot.php @@ -77,16 +77,10 @@ class FlowerPot extends Flowable{ $tile->setPlant($this->plant); } - /** - * @return Block|null - */ public function getPlant() : ?Block{ return $this->plant; } - /** - * @param Block|null $plant - */ public function setPlant(?Block $plant) : void{ if($plant === null or $plant instanceof Air){ $this->plant = null; diff --git a/src/block/Furnace.php b/src/block/Furnace.php index 736de20c7..70ffde36d 100644 --- a/src/block/Furnace.php +++ b/src/block/Furnace.php @@ -71,8 +71,6 @@ class Furnace extends Opaque{ } /** - * @param bool $lit - * * @return $this */ public function setLit(bool $lit = true) : self{ diff --git a/src/block/ItemFrame.php b/src/block/ItemFrame.php index f0a181637..a28f00f62 100644 --- a/src/block/ItemFrame.php +++ b/src/block/ItemFrame.php @@ -86,30 +86,18 @@ class ItemFrame extends Flowable{ return 0b111; } - /** - * @return int - */ public function getFacing() : int{ return $this->facing; } - /** - * @param int $facing - */ public function setFacing(int $facing) : void{ $this->facing = $facing; } - /** - * @return Item|null - */ public function getFramedItem() : ?Item{ return $this->framedItem !== null ? clone $this->framedItem : null; } - /** - * @param Item|null $item - */ public function setFramedItem(?Item $item) : void{ if($item === null or $item->isNull()){ $this->framedItem = null; @@ -119,30 +107,18 @@ class ItemFrame extends Flowable{ } } - /** - * @return int - */ public function getItemRotation() : int{ return $this->itemRotation; } - /** - * @param int $itemRotation - */ public function setItemRotation(int $itemRotation) : void{ $this->itemRotation = $itemRotation; } - /** - * @return float - */ public function getItemDropChance() : float{ return $this->itemDropChance; } - /** - * @param float $itemDropChance - */ public function setItemDropChance(float $itemDropChance) : void{ $this->itemDropChance = $itemDropChance; } diff --git a/src/block/Liquid.php b/src/block/Liquid.php index 46cdb947b..3819f5039 100644 --- a/src/block/Liquid.php +++ b/src/block/Liquid.php @@ -143,8 +143,6 @@ abstract class Liquid extends Transparent{ } /** - * @param bool $still - * * @return $this */ public function setStill(bool $still = true) : self{ @@ -247,8 +245,6 @@ abstract class Liquid extends Transparent{ /** * Returns how many liquid levels are lost per block flowed horizontally. Affects how far the liquid can flow. - * - * @return int */ public function getFlowDecayPerBlock() : int{ return 1; diff --git a/src/block/NetherPortal.php b/src/block/NetherPortal.php index e68c65e32..0eb9efc05 100644 --- a/src/block/NetherPortal.php +++ b/src/block/NetherPortal.php @@ -48,15 +48,11 @@ class NetherPortal extends Transparent{ return 0b11; } - /** - * @return int - */ public function getAxis() : int{ return $this->axis; } /** - * @param int $axis * @throws \InvalidArgumentException */ public function setAxis(int $axis) : void{ diff --git a/src/block/Note.php b/src/block/Note.php index 2edd5b316..3e027c220 100644 --- a/src/block/Note.php +++ b/src/block/Note.php @@ -58,16 +58,10 @@ class Note extends Opaque{ return 300; } - /** - * @return int - */ public function getPitch() : int{ return $this->pitch; } - /** - * @param int $pitch - */ public function setPitch(int $pitch) : void{ if($pitch < self::MIN_PITCH or $pitch > self::MAX_PITCH){ throw new \InvalidArgumentException("Pitch must be in range " . self::MIN_PITCH . " - " . self::MAX_PITCH); diff --git a/src/block/RedstoneComparator.php b/src/block/RedstoneComparator.php index 7554e1e7c..7372ab99a 100644 --- a/src/block/RedstoneComparator.php +++ b/src/block/RedstoneComparator.php @@ -87,7 +87,6 @@ class RedstoneComparator extends Flowable{ /** * TODO: ad hoc, move to interface - * @return int */ public function getFacing() : int{ return $this->facing; @@ -95,50 +94,31 @@ class RedstoneComparator extends Flowable{ /** * TODO: ad hoc, move to interface - * @param int $facing */ public function setFacing(int $facing) : void{ $this->facing = $facing; } - /** - * @return bool - */ public function isSubtractMode() : bool{ return $this->isSubtractMode; } - /** - * @param bool $isSubtractMode - */ public function setSubtractMode(bool $isSubtractMode) : void{ $this->isSubtractMode = $isSubtractMode; } - /** - * @return bool - */ public function isPowered() : bool{ return $this->powered; } - /** - * @param bool $powered - */ public function setPowered(bool $powered) : void{ $this->powered = $powered; } - /** - * @return int - */ public function getSignalStrength() : int{ return $this->signalStrength; } - /** - * @param int $signalStrength - */ public function setSignalStrength(int $signalStrength) : void{ $this->signalStrength = $signalStrength; } diff --git a/src/block/RedstoneLamp.php b/src/block/RedstoneLamp.php index d16ca52e8..c09f73b45 100644 --- a/src/block/RedstoneLamp.php +++ b/src/block/RedstoneLamp.php @@ -48,8 +48,6 @@ class RedstoneLamp extends Opaque{ } /** - * @param bool $lit - * * @return $this */ public function setLit(bool $lit = true) : self{ diff --git a/src/block/RedstoneOre.php b/src/block/RedstoneOre.php index c3e2cbe11..cde5462d0 100644 --- a/src/block/RedstoneOre.php +++ b/src/block/RedstoneOre.php @@ -54,8 +54,6 @@ class RedstoneOre extends Opaque{ } /** - * @param bool $lit - * * @return $this */ public function setLit(bool $lit = true) : self{ diff --git a/src/block/RedstoneRepeater.php b/src/block/RedstoneRepeater.php index c1e7a7af0..82af3f53d 100644 --- a/src/block/RedstoneRepeater.php +++ b/src/block/RedstoneRepeater.php @@ -76,8 +76,6 @@ class RedstoneRepeater extends Flowable{ } /** - * @param bool $powered - * * @return $this */ public function setPowered(bool $powered = true) : self{ diff --git a/src/block/RedstoneTorch.php b/src/block/RedstoneTorch.php index a1974c2ce..c47765b15 100644 --- a/src/block/RedstoneTorch.php +++ b/src/block/RedstoneTorch.php @@ -49,8 +49,6 @@ class RedstoneTorch extends Torch{ } /** - * @param bool $lit - * * @return $this */ public function setLit(bool $lit = true) : self{ diff --git a/src/block/Sign.php b/src/block/Sign.php index 88bd8f784..e549ff741 100644 --- a/src/block/Sign.php +++ b/src/block/Sign.php @@ -135,8 +135,6 @@ class Sign extends Transparent{ /** * Returns an object containing information about the sign text. - * - * @return SignText */ public function getText() : SignText{ return $this->text; @@ -145,9 +143,6 @@ class Sign extends Transparent{ /** * Called by the player controller (network session) to update the sign text, firing events as appropriate. * - * @param Player $author - * @param SignText $text - * * @return bool if the sign update was successful. * @throws \UnexpectedValueException if the text payload is too large */ diff --git a/src/block/Skull.php b/src/block/Skull.php index e5cd481e9..e912f19e0 100644 --- a/src/block/Skull.php +++ b/src/block/Skull.php @@ -83,9 +83,6 @@ class Skull extends Flowable{ $tile->setSkullType($this->skullType); } - /** - * @return SkullType - */ public function getSkullType() : SkullType{ return $this->skullType; } diff --git a/src/block/Slab.php b/src/block/Slab.php index 4c8c701c1..275aa8bf8 100644 --- a/src/block/Slab.php +++ b/src/block/Slab.php @@ -72,16 +72,12 @@ class Slab extends Transparent{ /** * Returns the type of slab block. - * - * @return SlabType */ public function getSlabType() : SlabType{ return $this->slabType; } /** - * @param SlabType $slabType - * * @return $this */ public function setSlabType(SlabType $slabType) : self{ diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index 605c629d6..fc85d0d65 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -675,11 +675,6 @@ final class VanillaBlocks{ self::_registryRegister($name, $block); } - /** - * @param string $name - * - * @return Block - */ public static function fromString(string $name) : Block{ $result = self::_registryFromString($name); assert($result instanceof Block); diff --git a/src/block/Wood.php b/src/block/Wood.php index a4650749b..6db53bee0 100644 --- a/src/block/Wood.php +++ b/src/block/Wood.php @@ -37,7 +37,6 @@ class Wood extends Opaque{ /** * TODO: this is ad hoc, but add an interface for this to all tree-related blocks - * @return TreeType */ public function getTreeType() : TreeType{ return $this->treeType; diff --git a/src/block/tile/Banner.php b/src/block/tile/Banner.php index 1860997e1..e72ee276d 100644 --- a/src/block/tile/Banner.php +++ b/src/block/tile/Banner.php @@ -98,8 +98,6 @@ class Banner extends Spawnable{ /** * Returns the color of the banner base. - * - * @return DyeColor */ public function getBaseColor() : DyeColor{ return $this->baseColor; @@ -107,8 +105,6 @@ class Banner extends Spawnable{ /** * Sets the color of the banner base. - * - * @param DyeColor $color */ public function setBaseColor(DyeColor $color) : void{ $this->baseColor = $color; diff --git a/src/block/tile/Chest.php b/src/block/tile/Chest.php index 9a4f2dd44..ed824a499 100644 --- a/src/block/tile/Chest.php +++ b/src/block/tile/Chest.php @@ -163,9 +163,6 @@ class Chest extends Spawnable implements Container, Nameable{ } } - /** - * @return string - */ public function getDefaultName() : string{ return "Chest"; } @@ -174,9 +171,6 @@ class Chest extends Spawnable implements Container, Nameable{ return $this->pairX !== null and $this->pairZ !== null; } - /** - * @return Chest|null - */ public function getPair() : ?Chest{ if($this->isPaired()){ $tile = $this->pos->getWorld()->getTileAt($this->pairX, $this->pos->y, $this->pairZ); diff --git a/src/block/tile/Comparator.php b/src/block/tile/Comparator.php index c19383ab1..24e63a79d 100644 --- a/src/block/tile/Comparator.php +++ b/src/block/tile/Comparator.php @@ -36,16 +36,10 @@ class Comparator extends Tile{ /** @var int */ protected $signalStrength = 0; - /** - * @return int - */ public function getSignalStrength() : int{ return $this->signalStrength; } - /** - * @param int $signalStrength - */ public function setSignalStrength(int $signalStrength) : void{ $this->signalStrength = $signalStrength; } diff --git a/src/block/tile/Container.php b/src/block/tile/Container.php index 0587d22d5..b549ad137 100644 --- a/src/block/tile/Container.php +++ b/src/block/tile/Container.php @@ -37,10 +37,6 @@ interface Container extends InventoryHolder{ /** * 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; } diff --git a/src/block/tile/ContainerTrait.php b/src/block/tile/ContainerTrait.php index 6217b2f70..2acc3ea80 100644 --- a/src/block/tile/ContainerTrait.php +++ b/src/block/tile/ContainerTrait.php @@ -78,10 +78,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; @@ -89,7 +85,6 @@ trait ContainerTrait{ /** * @see Position::asPosition() - * @return Position */ abstract protected function getPos() : Position; diff --git a/src/block/tile/EnchantTable.php b/src/block/tile/EnchantTable.php index fe48a8518..8e56166be 100644 --- a/src/block/tile/EnchantTable.php +++ b/src/block/tile/EnchantTable.php @@ -29,9 +29,6 @@ class EnchantTable extends Spawnable implements Nameable{ saveName as writeSaveData; } - /** - * @return string - */ public function getDefaultName() : string{ return "Enchanting Table"; } diff --git a/src/block/tile/Furnace.php b/src/block/tile/Furnace.php index dbd05dce7..0428cfb0b 100644 --- a/src/block/tile/Furnace.php +++ b/src/block/tile/Furnace.php @@ -90,9 +90,6 @@ class Furnace extends Spawnable implements Container, Nameable{ $this->saveItems($nbt); } - /** - * @return string - */ public function getDefaultName() : string{ return "Furnace"; } diff --git a/src/block/tile/Nameable.php b/src/block/tile/Nameable.php index 8e8683533..2d206ffc2 100644 --- a/src/block/tile/Nameable.php +++ b/src/block/tile/Nameable.php @@ -26,23 +26,11 @@ namespace pocketmine\block\tile; interface Nameable{ public const TAG_CUSTOM_NAME = "CustomName"; - /** - * @return string - */ public function getDefaultName() : string; - /** - * @return string - */ public function getName() : string; - /** - * @param string $str - */ public function setName(string $str) : void; - /** - * @return bool - */ public function hasName() : bool; } diff --git a/src/block/tile/NameableTrait.php b/src/block/tile/NameableTrait.php index 38b89897c..74631a25f 100644 --- a/src/block/tile/NameableTrait.php +++ b/src/block/tile/NameableTrait.php @@ -34,21 +34,12 @@ trait NameableTrait{ /** @var string|null */ private $customName = null; - /** - * @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; @@ -57,9 +48,6 @@ trait NameableTrait{ } } - /** - * @return bool - */ public function hasName() : bool{ return $this->customName !== null; } @@ -83,7 +71,6 @@ trait NameableTrait{ } /** - * @param Item $item * @see Tile::copyDataFromItem() */ public function copyDataFromItem(Item $item) : void{ diff --git a/src/block/tile/Note.php b/src/block/tile/Note.php index 4d178d837..5157f7436 100644 --- a/src/block/tile/Note.php +++ b/src/block/tile/Note.php @@ -43,16 +43,10 @@ class Note extends Tile{ $nbt->setByte("note", $this->pitch); } - /** - * @return int - */ public function getPitch() : int{ return $this->pitch; } - /** - * @param int $pitch - */ public function setPitch(int $pitch) : void{ if($pitch < BlockNote::MIN_PITCH or $pitch > BlockNote::MAX_PITCH){ throw new \InvalidArgumentException("Pitch must be in range " . BlockNote::MIN_PITCH . " - " . BlockNote::MAX_PITCH); diff --git a/src/block/tile/Sign.php b/src/block/tile/Sign.php index e625448c9..dd9cfff70 100644 --- a/src/block/tile/Sign.php +++ b/src/block/tile/Sign.php @@ -78,16 +78,10 @@ class Sign extends Spawnable{ } } - /** - * @return SignText - */ public function getText() : SignText{ return $this->text; } - /** - * @param SignText $text - */ public function setText(SignText $text) : void{ $this->text = $text; } diff --git a/src/block/tile/Spawnable.php b/src/block/tile/Spawnable.php index c0d911fbc..3c6c5d7c1 100644 --- a/src/block/tile/Spawnable.php +++ b/src/block/tile/Spawnable.php @@ -39,16 +39,11 @@ abstract class Spawnable extends Tile{ /** * Returns whether the tile needs to be respawned to viewers. - * - * @return bool */ public function isDirty() : bool{ return $this->dirty; } - /** - * @param bool $dirty - */ public function setDirty(bool $dirty = true) : void{ if($dirty){ $this->spawnCompoundCache = null; @@ -74,9 +69,6 @@ abstract class Spawnable extends Tile{ return $this->spawnCompoundCache; } - /** - * @return CompoundTag - */ final public function getSpawnCompound() : CompoundTag{ $nbt = CompoundTag::create() ->setString(self::TAG_ID, TileFactory::getSaveId(get_class($this))) //TODO: disassociate network ID from save ID @@ -90,8 +82,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; } diff --git a/src/block/tile/Tile.php b/src/block/tile/Tile.php index 734162544..8a0184bf5 100644 --- a/src/block/tile/Tile.php +++ b/src/block/tile/Tile.php @@ -59,15 +59,11 @@ abstract class Tile{ /** * @internal * Reads additional data from the CompoundTag on tile creation. - * - * @param CompoundTag $nbt */ abstract public 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; @@ -90,8 +86,6 @@ abstract class Tile{ /** * @internal * - * @param Item $item - * * @throws \RuntimeException */ public function copyDataFromItem(Item $item) : void{ @@ -100,16 +94,10 @@ abstract class Tile{ } } - /** - * @return Block - */ public function getBlock() : Block{ return $this->pos->getWorld()->getBlock($this->pos); } - /** - * @return Position - */ public function getPos() : Position{ return $this->pos; } diff --git a/src/block/tile/TileFactory.php b/src/block/tile/TileFactory.php index c1e7d3c84..a72951af3 100644 --- a/src/block/tile/TileFactory.php +++ b/src/block/tile/TileFactory.php @@ -89,7 +89,6 @@ final class TileFactory{ } /** - * @param string $className * @param string[] $saveNames */ public static function register(string $className, array $saveNames = []) : void{ @@ -125,10 +124,6 @@ final class TileFactory{ } /** - * @param string $baseClass - * @param World $world - * @param Vector3 $pos - * * @return Tile (will be an instanceof $baseClass) * @throws \InvalidArgumentException if the specified class is not a registered tile */ @@ -149,12 +144,7 @@ final class TileFactory{ } /** - * @param World $world - * @param CompoundTag $nbt - * - * @return Tile|null *@internal - * */ public static function createFromData(World $world, CompoundTag $nbt) : ?Tile{ $type = $nbt->getString(Tile::TAG_ID, "", true); diff --git a/src/block/utils/BannerPattern.php b/src/block/utils/BannerPattern.php index 857bde3ac..5d77cde81 100644 --- a/src/block/utils/BannerPattern.php +++ b/src/block/utils/BannerPattern.php @@ -79,16 +79,10 @@ class BannerPattern{ $this->color = $color; } - /** - * @return string - */ public function getId() : string{ return $this->id; } - /** - * @return DyeColor - */ public function getColor() : DyeColor{ return $this->color; } diff --git a/src/block/utils/BlockDataSerializer.php b/src/block/utils/BlockDataSerializer.php index db0ae9ead..95849dac2 100644 --- a/src/block/utils/BlockDataSerializer.php +++ b/src/block/utils/BlockDataSerializer.php @@ -32,9 +32,6 @@ final class BlockDataSerializer{ } /** - * @param int $raw - * - * @return int * @throws InvalidBlockStateException */ public static function readFacing(int $raw) : int{ @@ -68,9 +65,6 @@ final class BlockDataSerializer{ } /** - * @param int $facing - * - * @return int * @throws InvalidBlockStateException */ public static function readHorizontalFacing(int $facing) : int{ @@ -89,9 +83,6 @@ final class BlockDataSerializer{ } /** - * @param int $raw - * - * @return int * @throws InvalidBlockStateException */ public static function readLegacyHorizontalFacing(int $raw) : int{ @@ -121,9 +112,6 @@ final class BlockDataSerializer{ } /** - * @param int $value - * - * @return int * @throws InvalidBlockStateException */ public static function read5MinusHorizontalFacing(int $value) : int{ diff --git a/src/block/utils/DyeColor.php b/src/block/utils/DyeColor.php index 3540d62a3..764e13833 100644 --- a/src/block/utils/DyeColor.php +++ b/src/block/utils/DyeColor.php @@ -87,10 +87,8 @@ final class DyeColor{ * Returns a DyeColor object matching the given magic number * @internal * - * @param int $magicNumber * @param bool $inverted Invert the ID before using it (useful for actual dye magic IDs) * - * @return DyeColor * @throws \InvalidArgumentException */ public static function fromMagicNumber(int $magicNumber, bool $inverted = false) : DyeColor{ @@ -116,30 +114,18 @@ final class DyeColor{ $this->rgbValue = $rgbValue; } - /** - * @return string - */ public function getDisplayName() : string{ return $this->displayName; } - /** - * @return Color - */ public function getRgbValue() : Color{ return $this->rgbValue; } - /** - * @return int - */ public function getMagicNumber() : int{ return $this->magicNumber; } - /** - * @return int - */ public function getInvertedMagicNumber() : int{ return ~$this->magicNumber & 0xf; } diff --git a/src/block/utils/Fallable.php b/src/block/utils/Fallable.php index 1eb3cd12d..70ac23e68 100644 --- a/src/block/utils/Fallable.php +++ b/src/block/utils/Fallable.php @@ -31,8 +31,6 @@ interface Fallable{ * Called every tick by FallingBlock to update the falling state of this block. Used by concrete to check when it * hits water. * Return null if you don't want to change the usual behaviour. - * - * @return Block|null */ public function tickFalling() : ?Block; } diff --git a/src/block/utils/PillarRotationTrait.php b/src/block/utils/PillarRotationTrait.php index 639dd3ed2..fa7de1a4e 100644 --- a/src/block/utils/PillarRotationTrait.php +++ b/src/block/utils/PillarRotationTrait.php @@ -41,7 +41,6 @@ trait PillarRotationTrait{ /** * @see Block::writeStateToMeta() - * @return int */ protected function writeStateToMeta() : int{ return $this->writeAxisToMeta(); @@ -49,9 +48,6 @@ trait PillarRotationTrait{ /** * @see Block::readStateFromData() - * - * @param int $id - * @param int $stateMeta */ public function readStateFromData(int $id, int $stateMeta) : void{ $this->readAxisFromMeta($stateMeta); @@ -59,7 +55,6 @@ trait PillarRotationTrait{ /** * @see Block::getStateBitmask() - * @return int */ public function getStateBitmask() : int{ return 0b11 << $this->getAxisMetaShift(); @@ -89,16 +84,6 @@ trait PillarRotationTrait{ /** * @see Block::place() - * - * @param BlockTransaction $tx - * @param Item $item - * @param Block $blockReplace - * @param Block $blockClicked - * @param int $face - * @param Vector3 $clickVector - * @param Player|null $player - * - * @return bool */ public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ $this->axis = Facing::axis($face); diff --git a/src/block/utils/SignText.php b/src/block/utils/SignText.php index 364b0ebea..a4ab838bb 100644 --- a/src/block/utils/SignText.php +++ b/src/block/utils/SignText.php @@ -50,9 +50,6 @@ class SignText{ * Parses sign lines from the given string blob. * TODO: add a strict mode for this * - * @param string $blob - * - * @return SignText * @throws \InvalidArgumentException if the text is not valid UTF-8 */ public static function fromBlob(string $blob) : SignText{ @@ -101,9 +98,6 @@ class SignText{ /** * Returns the sign line at the given offset. * - * @param int $index - * - * @return string * @throws \InvalidArgumentException */ public function getLine(int $index) : string{ @@ -114,9 +108,6 @@ class SignText{ /** * Sets the line at the given offset. * - * @param int $index - * @param string $line - * * @throws \InvalidArgumentException if the text is not valid UTF-8 * @throws \InvalidArgumentException if the text contains a newline */ diff --git a/src/block/utils/SkullType.php b/src/block/utils/SkullType.php index 38bdc20f6..408d68741 100644 --- a/src/block/utils/SkullType.php +++ b/src/block/utils/SkullType.php @@ -64,9 +64,7 @@ final class SkullType{ /** * @internal - * @param int $magicNumber * - * @return SkullType * @throws \InvalidArgumentException */ public static function fromMagicNumber(int $magicNumber) : SkullType{ @@ -87,16 +85,10 @@ final class SkullType{ $this->magicNumber = $magicNumber; } - /** - * @return string - */ public function getDisplayName() : string{ return $this->displayName; } - /** - * @return int - */ public function getMagicNumber() : int{ return $this->magicNumber; } diff --git a/src/block/utils/TreeType.php b/src/block/utils/TreeType.php index 8e0622dd6..4d880169a 100644 --- a/src/block/utils/TreeType.php +++ b/src/block/utils/TreeType.php @@ -65,9 +65,6 @@ final class TreeType{ /** * @internal * - * @param int $magicNumber - * - * @return TreeType * @throws \InvalidArgumentException */ public static function fromMagicNumber(int $magicNumber) : TreeType{ @@ -83,27 +80,16 @@ final class TreeType{ /** @var int */ private $magicNumber; - /** - * @param string $enumName - * @param string $displayName - * @param int $magicNumber - */ private function __construct(string $enumName, string $displayName, int $magicNumber){ $this->Enum___construct($enumName); $this->displayName = $displayName; $this->magicNumber = $magicNumber; } - /** - * @return string - */ public function getDisplayName() : string{ return $this->displayName; } - /** - * @return int - */ public function getMagicNumber() : int{ return $this->magicNumber; } diff --git a/src/command/Command.php b/src/command/Command.php index 87aae29c3..fbf73b354 100644 --- a/src/command/Command.php +++ b/src/command/Command.php @@ -74,8 +74,6 @@ abstract class Command{ public $timings; /** - * @param string $name - * @param string $description * @param string $usageMessage * @param string[] $aliases */ @@ -88,8 +86,6 @@ abstract class Command{ } /** - * @param CommandSender $sender - * @param string $commandLabel * @param string[] $args * * @return mixed @@ -97,33 +93,18 @@ abstract class Command{ */ abstract public function execute(CommandSender $sender, string $commandLabel, array $args); - /** - * @return string - */ public function getName() : string{ return $this->name; } - /** - * @return string|null - */ public function getPermission() : ?string{ return $this->permission; } - - /** - * @param string|null $permission - */ public function setPermission(?string $permission) : void{ $this->permission = $permission; } - /** - * @param CommandSender $target - * - * @return bool - */ public function testPermission(CommandSender $target) : bool{ if($this->testPermissionSilent($target)){ return true; @@ -138,11 +119,6 @@ abstract class Command{ return false; } - /** - * @param CommandSender $target - * - * @return bool - */ public function testPermissionSilent(CommandSender $target) : bool{ if($this->permission === null or $this->permission === ""){ return true; @@ -157,9 +133,6 @@ abstract class Command{ return false; } - /** - * @return string - */ public function getLabel() : string{ return $this->label; } @@ -181,10 +154,6 @@ abstract class Command{ /** * Registers the command into a Command map - * - * @param CommandMap $commandMap - * - * @return bool */ public function register(CommandMap $commandMap) : bool{ if($this->allowChangesFrom($commandMap)){ @@ -196,11 +165,6 @@ abstract class Command{ return false; } - /** - * @param CommandMap $commandMap - * - * @return bool - */ public function unregister(CommandMap $commandMap) : bool{ if($this->allowChangesFrom($commandMap)){ $this->commandMap = null; @@ -213,18 +177,10 @@ abstract class Command{ return false; } - /** - * @param CommandMap $commandMap - * - * @return bool - */ private function allowChangesFrom(CommandMap $commandMap) : bool{ return $this->commandMap === null or $this->commandMap === $commandMap; } - /** - * @return bool - */ public function isRegistered() : bool{ return $this->commandMap !== null; } @@ -236,23 +192,14 @@ abstract class Command{ return $this->activeAliases; } - /** - * @return string|null - */ public function getPermissionMessage() : ?string{ return $this->permissionMessage; } - /** - * @return string - */ public function getDescription() : string{ return $this->description; } - /** - * @return string - */ public function getUsage() : string{ return $this->usageMessage; } @@ -267,31 +214,20 @@ abstract class Command{ } } - /** - * @param string $description - */ public function setDescription(string $description) : void{ $this->description = $description; } - /** - * @param string $permissionMessage - */ public function setPermissionMessage(string $permissionMessage) : void{ $this->permissionMessage = $permissionMessage; } - /** - * @param string $usage - */ public function setUsage(string $usage) : void{ $this->usageMessage = $usage; } /** - * @param CommandSender $source * @param TextContainer|string $message - * @param bool $sendToSource */ public static function broadcastCommandMessage(CommandSender $source, $message, bool $sendToSource = true) : void{ $users = PermissionManager::getInstance()->getPermissionSubscriptions(Server::BROADCAST_CHANNEL_ADMINISTRATIVE); @@ -325,9 +261,6 @@ abstract class Command{ } } - /** - * @return string - */ public function __toString() : string{ return $this->name; } diff --git a/src/command/CommandExecutor.php b/src/command/CommandExecutor.php index fcc75f15f..1efcd5f52 100644 --- a/src/command/CommandExecutor.php +++ b/src/command/CommandExecutor.php @@ -27,12 +27,7 @@ namespace pocketmine\command; interface CommandExecutor{ /** - * @param CommandSender $sender - * @param Command $command - * @param string $label * @param string[] $args - * - * @return bool */ public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool; diff --git a/src/command/CommandMap.php b/src/command/CommandMap.php index c8dda9019..fa1b63cbd 100644 --- a/src/command/CommandMap.php +++ b/src/command/CommandMap.php @@ -27,38 +27,16 @@ namespace pocketmine\command; interface CommandMap{ /** - * @param string $fallbackPrefix * @param Command[] $commands */ public function registerAll(string $fallbackPrefix, array $commands) : void; - /** - * @param string $fallbackPrefix - * @param Command $command - * @param string|null $label - * - * @return bool - */ public function register(string $fallbackPrefix, Command $command, ?string $label = null) : bool; - /** - * @param CommandSender $sender - * @param string $cmdLine - * - * @return bool - */ public function dispatch(CommandSender $sender, string $cmdLine) : bool; - /** - * @return void - */ public function clearCommands() : void; - /** - * @param string $name - * - * @return Command|null - */ public function getCommand(string $name) : ?Command; diff --git a/src/command/CommandReader.php b/src/command/CommandReader.php index 0a9f7f3a6..c1310e486 100644 --- a/src/command/CommandReader.php +++ b/src/command/CommandReader.php @@ -114,8 +114,6 @@ class CommandReader extends Thread{ * Checks if the specified stream is a FIFO pipe. * * @param resource $stream - * - * @return bool */ private function isPipe($stream) : bool{ return is_resource($stream) and (!stream_isatty($stream) or ((fstat($stream)["mode"] & 0170000) === 0010000)); @@ -177,8 +175,6 @@ class CommandReader extends Thread{ /** * Reads a line from console, if available. Returns null if not available - * - * @return string|null */ public function getLine() : ?string{ if($this->buffer->count() !== 0){ diff --git a/src/command/CommandSender.php b/src/command/CommandSender.php index ab707ffca..86406bb7d 100644 --- a/src/command/CommandSender.php +++ b/src/command/CommandSender.php @@ -34,28 +34,18 @@ interface CommandSender extends Permissible{ */ public function sendMessage($message) : void; - /** - * @return Server - */ public function getServer() : Server; - /** - * @return string - */ public function getName() : string; /** * Returns the line height of the command-sender's screen. Used for determining sizes for command output pagination * such as in the /help command. - * - * @return int */ public function getScreenLineHeight() : int; /** * Sets the line height used for command output pagination for this command sender. `null` will reset it to default. - * - * @param int|null $height */ public function setScreenLineHeight(?int $height) : void; } diff --git a/src/command/ConsoleCommandSender.php b/src/command/ConsoleCommandSender.php index a80a3c235..6eb61b496 100644 --- a/src/command/ConsoleCommandSender.php +++ b/src/command/ConsoleCommandSender.php @@ -41,9 +41,6 @@ class ConsoleCommandSender implements CommandSender{ $this->perm = new PermissibleBase($this); } - /** - * @return Server - */ public function getServer() : Server{ return Server::getInstance(); } @@ -64,23 +61,14 @@ class ConsoleCommandSender implements CommandSender{ } } - /** - * @return string - */ public function getName() : string{ return "CONSOLE"; } - /** - * @return bool - */ public function isOp() : bool{ return true; } - /** - * @param bool $value - */ public function setOp(bool $value) : void{ } diff --git a/src/command/FormattedCommandAlias.php b/src/command/FormattedCommandAlias.php index d6daabed1..cfad08347 100644 --- a/src/command/FormattedCommandAlias.php +++ b/src/command/FormattedCommandAlias.php @@ -36,7 +36,6 @@ class FormattedCommandAlias extends Command{ private $formatStrings = []; /** - * @param string $alias * @param string[] $formatStrings */ public function __construct(string $alias, array $formatStrings){ @@ -65,12 +64,6 @@ class FormattedCommandAlias extends Command{ return (bool) $result; } - /** - * @param string $formatString - * @param array $args - * - * @return string - */ private function buildCommand(string $formatString, array $args) : string{ $index = strpos($formatString, '$'); while($index !== false){ @@ -144,13 +137,6 @@ class FormattedCommandAlias extends Command{ return $formatString; } - /** - * @param int $i - * @param int $j - * @param int $k - * - * @return bool - */ private static function inRange(int $i, int $j, int $k) : bool{ return $i >= $j and $i <= $k; } diff --git a/src/command/PluginCommand.php b/src/command/PluginCommand.php index 87c96bb32..827239c26 100644 --- a/src/command/PluginCommand.php +++ b/src/command/PluginCommand.php @@ -34,11 +34,6 @@ class PluginCommand extends Command implements PluginIdentifiableCommand{ /** @var CommandExecutor */ private $executor; - /** - * @param string $name - * @param Plugin $owner - * @param CommandExecutor $executor - */ public function __construct(string $name, Plugin $owner, CommandExecutor $executor){ parent::__construct($name); $this->owningPlugin = $owner; @@ -69,16 +64,10 @@ class PluginCommand extends Command implements PluginIdentifiableCommand{ return $this->executor; } - /** - * @param CommandExecutor $executor - */ public function setExecutor(CommandExecutor $executor) : void{ $this->executor = $executor; } - /** - * @return Plugin - */ public function getPlugin() : Plugin{ return $this->owningPlugin; } diff --git a/src/command/PluginIdentifiableCommand.php b/src/command/PluginIdentifiableCommand.php index 035bdc327..02e85f7e9 100644 --- a/src/command/PluginIdentifiableCommand.php +++ b/src/command/PluginIdentifiableCommand.php @@ -27,8 +27,5 @@ use pocketmine\plugin\Plugin; interface PluginIdentifiableCommand{ - /** - * @return Plugin - */ public function getPlugin() : Plugin; } diff --git a/src/command/SimpleCommandMap.php b/src/command/SimpleCommandMap.php index 1374c53a8..1eff4dd70 100644 --- a/src/command/SimpleCommandMap.php +++ b/src/command/SimpleCommandMap.php @@ -142,13 +142,6 @@ class SimpleCommandMap implements CommandMap{ } } - /** - * @param string $fallbackPrefix - * @param Command $command - * @param string|null $label - * - * @return bool - */ public function register(string $fallbackPrefix, Command $command, ?string $label = null) : bool{ if($label === null){ $label = $command->getName(); @@ -175,11 +168,6 @@ class SimpleCommandMap implements CommandMap{ return $registered; } - /** - * @param Command $command - * - * @return bool - */ public function unregister(Command $command) : bool{ foreach($this->knownCommands as $lbl => $cmd){ if($cmd === $command){ @@ -192,14 +180,6 @@ class SimpleCommandMap implements CommandMap{ return true; } - /** - * @param Command $command - * @param bool $isAlias - * @param string $fallbackPrefix - * @param string $label - * - * @return bool - */ private function registerAlias(Command $command, bool $isAlias, string $fallbackPrefix, string $label) : bool{ $this->knownCommands[$fallbackPrefix . ":" . $label] = $command; if(($command instanceof VanillaCommand or $isAlias) and isset($this->knownCommands[$label])){ @@ -226,8 +206,6 @@ class SimpleCommandMap implements CommandMap{ * * @param string $commandName reference parameter * @param string[] $args reference parameter - * - * @return Command|null */ public function matchCommand(string &$commandName, array &$args) : ?Command{ $count = min(count($args), 255); @@ -294,10 +272,6 @@ class SimpleCommandMap implements CommandMap{ return $this->knownCommands; } - - /** - * @return void - */ public function registerServerAliases() : void{ $values = $this->server->getCommandAliases(); diff --git a/src/command/defaults/ParticleCommand.php b/src/command/defaults/ParticleCommand.php index 904c4ebe0..18342534c 100644 --- a/src/command/defaults/ParticleCommand.php +++ b/src/command/defaults/ParticleCommand.php @@ -137,12 +137,6 @@ class ParticleCommand extends VanillaCommand{ return true; } - /** - * @param string $name - * @param int|null $data - * - * @return Particle|null - */ private function getParticle(string $name, ?int $data = null) : ?Particle{ switch($name){ case "explode": diff --git a/src/command/defaults/VanillaCommand.php b/src/command/defaults/VanillaCommand.php index 50c5313a1..c4b821e6d 100644 --- a/src/command/defaults/VanillaCommand.php +++ b/src/command/defaults/VanillaCommand.php @@ -36,12 +36,7 @@ abstract class VanillaCommand extends Command{ public const MIN_COORD = -30000000; /** - * @param CommandSender $sender * @param mixed $value - * @param int $min - * @param int $max - * - * @return int */ protected function getInteger(CommandSender $sender, $value, int $min = self::MIN_COORD, int $max = self::MAX_COORD) : int{ $i = (int) $value; @@ -55,15 +50,6 @@ abstract class VanillaCommand extends Command{ return $i; } - /** - * @param float $original - * @param CommandSender $sender - * @param string $input - * @param float $min - * @param float $max - * - * @return float - */ protected function getRelativeDouble(float $original, CommandSender $sender, string $input, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{ if($input[0] === "~"){ $value = $this->getDouble($sender, substr($input, 1)); @@ -75,12 +61,7 @@ abstract class VanillaCommand extends Command{ } /** - * @param CommandSender $sender * @param mixed $value - * @param float $min - * @param float $max - * - * @return float */ protected function getDouble(CommandSender $sender, $value, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{ $i = (double) $value; diff --git a/src/crafting/CraftingGrid.php b/src/crafting/CraftingGrid.php index 8812866bf..cec88d966 100644 --- a/src/crafting/CraftingGrid.php +++ b/src/crafting/CraftingGrid.php @@ -105,11 +105,6 @@ class CraftingGrid extends BaseInventory{ /** * Returns the item at offset x,y, offset by where the starts of the recipe rectangle are. - * - * @param int $x - * @param int $y - * - * @return Item */ public function getIngredient(int $x, int $y) : Item{ if($this->startX !== null and $this->startY !== null){ @@ -121,8 +116,6 @@ class CraftingGrid extends BaseInventory{ /** * Returns the width of the recipe we're trying to craft, based on items currently in the grid. - * - * @return int */ public function getRecipeWidth() : int{ return $this->xLen ?? 0; @@ -130,7 +123,6 @@ class CraftingGrid extends BaseInventory{ /** * Returns the height of the recipe we're trying to craft, based on items currently in the grid. - * @return int */ public function getRecipeHeight() : int{ return $this->yLen ?? 0; diff --git a/src/crafting/CraftingManager.php b/src/crafting/CraftingManager.php index b35e6b42c..cdd740ba7 100644 --- a/src/crafting/CraftingManager.php +++ b/src/crafting/CraftingManager.php @@ -124,8 +124,6 @@ class CraftingManager{ /** * Returns a pre-compressed CraftingDataPacket for sending to players. Rebuilds the cache if it is not found. - * - * @return CompressBatchPromise */ public function getCraftingDataPacket() : CompressBatchPromise{ if($this->craftingDataCache === null){ @@ -137,11 +135,6 @@ class CraftingManager{ /** * Function used to arrange Shapeless Recipe ingredient lists into a consistent order. - * - * @param Item $i1 - * @param Item $i2 - * - * @return int */ public static function sort(Item $i1, Item $i2) : int{ //Use spaceship operator to compare each property, then try the next one if they are equivalent. @@ -206,27 +199,18 @@ class CraftingManager{ return $this->furnaceRecipes; } - /** - * @param ShapedRecipe $recipe - */ public function registerShapedRecipe(ShapedRecipe $recipe) : void{ $this->shapedRecipes[self::hashOutputs($recipe->getResults())][] = $recipe; $this->craftingDataCache = null; } - /** - * @param ShapelessRecipe $recipe - */ public function registerShapelessRecipe(ShapelessRecipe $recipe) : void{ $this->shapelessRecipes[self::hashOutputs($recipe->getResults())][] = $recipe; $this->craftingDataCache = null; } - /** - * @param FurnaceRecipe $recipe - */ public function registerFurnaceRecipe(FurnaceRecipe $recipe) : void{ $input = $recipe->getInput(); $this->furnaceRecipes[$input->getId() . ":" . ($input->hasAnyDamageValue() ? "?" : $input->getMeta())] = $recipe; @@ -234,10 +218,7 @@ class CraftingManager{ } /** - * @param CraftingGrid $grid * @param Item[] $outputs - * - * @return CraftingRecipe|null */ public function matchRecipe(CraftingGrid $grid, array $outputs) : ?CraftingRecipe{ //TODO: try to match special recipes before anything else (first they need to be implemented!) @@ -286,11 +267,6 @@ class CraftingManager{ } } - /** - * @param Item $input - * - * @return FurnaceRecipe|null - */ public function matchFurnaceRecipe(Item $input) : ?FurnaceRecipe{ return $this->furnaceRecipes[$input->getId() . ":" . $input->getMeta()] ?? $this->furnaceRecipes[$input->getId() . ":?"] ?? null; } diff --git a/src/crafting/CraftingRecipe.php b/src/crafting/CraftingRecipe.php index 5a64c4309..44c387eff 100644 --- a/src/crafting/CraftingRecipe.php +++ b/src/crafting/CraftingRecipe.php @@ -36,18 +36,12 @@ interface CraftingRecipe{ /** * Returns a list of results this recipe will produce when the inputs in the given crafting grid are consumed. * - * @param CraftingGrid $grid - * * @return Item[] */ public function getResultsFor(CraftingGrid $grid) : array; /** * Returns whether the given crafting grid meets the requirements to craft this recipe. - * - * @param CraftingGrid $grid - * - * @return bool */ public function matchesCraftingGrid(CraftingGrid $grid) : bool; } diff --git a/src/crafting/FurnaceRecipe.php b/src/crafting/FurnaceRecipe.php index cc1a4bf6e..55a6104fe 100644 --- a/src/crafting/FurnaceRecipe.php +++ b/src/crafting/FurnaceRecipe.php @@ -33,25 +33,15 @@ class FurnaceRecipe{ /** @var Item */ private $ingredient; - /** - * @param Item $result - * @param Item $ingredient - */ public function __construct(Item $result, Item $ingredient){ $this->output = clone $result; $this->ingredient = clone $ingredient; } - /** - * @return Item - */ public function getInput() : Item{ return clone $this->ingredient; } - /** - * @return Item - */ public function getResult() : Item{ return clone $this->output; } diff --git a/src/crafting/ShapedRecipe.php b/src/crafting/ShapedRecipe.php index 278f725f8..1511224e0 100644 --- a/src/crafting/ShapedRecipe.php +++ b/src/crafting/ShapedRecipe.php @@ -114,8 +114,6 @@ class ShapedRecipe implements CraftingRecipe{ } /** - * @param CraftingGrid $grid - * * @return Item[] */ public function getResultsFor(CraftingGrid $grid) : array{ @@ -155,12 +153,6 @@ class ShapedRecipe implements CraftingRecipe{ return $ingredients; } - /** - * @param int $x - * @param int $y - * - * @return Item - */ public function getIngredient(int $x, int $y) : Item{ $exists = $this->ingredientList[$this->shape[$y]{$x}] ?? null; return $exists !== null ? clone $exists : ItemFactory::air(); @@ -174,12 +166,6 @@ class ShapedRecipe implements CraftingRecipe{ return $this->shape; } - /** - * @param CraftingGrid $grid - * @param bool $reverse - * - * @return bool - */ private function matchInputMap(CraftingGrid $grid, bool $reverse) : bool{ for($y = 0; $y < $this->height; ++$y){ for($x = 0; $x < $this->width; ++$x){ @@ -195,11 +181,6 @@ class ShapedRecipe implements CraftingRecipe{ return true; } - /** - * @param CraftingGrid $grid - * - * @return bool - */ public function matchesCraftingGrid(CraftingGrid $grid) : bool{ if($this->width !== $grid->getRecipeWidth() or $this->height !== $grid->getRecipeHeight()){ return false; diff --git a/src/crafting/ShapelessRecipe.php b/src/crafting/ShapelessRecipe.php index e772ee197..53f20f55d 100644 --- a/src/crafting/ShapelessRecipe.php +++ b/src/crafting/ShapelessRecipe.php @@ -67,9 +67,6 @@ class ShapelessRecipe implements CraftingRecipe{ return Utils::cloneObjectArray($this->ingredients); } - /** - * @return int - */ public function getIngredientCount() : int{ $count = 0; foreach($this->ingredients as $ingredient){ @@ -79,11 +76,6 @@ class ShapelessRecipe implements CraftingRecipe{ return $count; } - /** - * @param CraftingGrid $grid - * - * @return bool - */ public function matchesCraftingGrid(CraftingGrid $grid) : bool{ //don't pack the ingredients - shapeless recipes require that each ingredient be in a separate slot $input = $grid->getContents(); diff --git a/src/entity/Attribute.php b/src/entity/Attribute.php index 8778596ee..38f22547f 100644 --- a/src/entity/Attribute.php +++ b/src/entity/Attribute.php @@ -86,14 +86,6 @@ class Attribute{ } /** - * @param string $id - * @param float $minValue - * @param float $maxValue - * @param float $defaultValue - * @param bool $shouldSend - * - * @return Attribute - * * @throws \InvalidArgumentException */ public static function register(string $id, float $minValue, float $maxValue, float $defaultValue, bool $shouldSend = true) : Attribute{ @@ -104,11 +96,6 @@ class Attribute{ return self::$attributes[$id] = new Attribute($id, $minValue, $maxValue, $defaultValue, $shouldSend); } - /** - * @param string $id - * - * @return Attribute|null - */ public static function get(string $id) : ?Attribute{ return isset(self::$attributes[$id]) ? clone self::$attributes[$id] : null; } @@ -128,8 +115,6 @@ class Attribute{ } /** - * @param float $minValue - * * @return $this */ public function setMinValue(float $minValue){ @@ -149,8 +134,6 @@ class Attribute{ } /** - * @param float $maxValue - * * @return $this */ public function setMaxValue(float $maxValue){ @@ -170,8 +153,6 @@ class Attribute{ } /** - * @param float $defaultValue - * * @return $this */ public function setDefaultValue(float $defaultValue){ @@ -195,10 +176,6 @@ class Attribute{ } /** - * @param float $value - * @param bool $fit - * @param bool $forceSend - * * @return $this */ public function setValue(float $value, bool $fit = false, bool $forceSend = false){ diff --git a/src/entity/AttributeMap.php b/src/entity/AttributeMap.php index 70575c869..60318f3bd 100644 --- a/src/entity/AttributeMap.php +++ b/src/entity/AttributeMap.php @@ -33,11 +33,6 @@ class AttributeMap{ $this->attributes[$attribute->getId()] = $attribute; } - /** - * @param string $id - * - * @return Attribute|null - */ public function get(string $id) : ?Attribute{ return $this->attributes[$id] ?? null; } diff --git a/src/entity/Entity.php b/src/entity/Entity.php index daa095d02..067b135d5 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -281,72 +281,42 @@ abstract class Entity{ } - /** - * @return string - */ public function getNameTag() : string{ return $this->nameTag; } - /** - * @return bool - */ public function isNameTagVisible() : bool{ return $this->nameTagVisible; } - /** - * @return bool - */ public function isNameTagAlwaysVisible() : bool{ return $this->alwaysShowNameTag; } - /** - * @param string $name - */ public function setNameTag(string $name) : void{ $this->nameTag = $name; } - /** - * @param bool $value - */ public function setNameTagVisible(bool $value = true) : void{ $this->nameTagVisible = $value; } - /** - * @param bool $value - */ public function setNameTagAlwaysVisible(bool $value = true) : void{ $this->alwaysShowNameTag = $value; } - /** - * @return string|null - */ public function getScoreTag() : ?string{ return $this->scoreTag; //TODO: maybe this shouldn't be nullable? } - /** - * @param string $score - */ public function setScoreTag(string $score) : void{ $this->scoreTag = $score; } - /** - * @return float - */ public function getScale() : float{ return $this->scale; } - /** - * @param float $value - */ public function setScale(float $value) : void{ if($value <= 0){ throw new \InvalidArgumentException("Scale must be greater than 0"); @@ -417,7 +387,6 @@ abstract class Entity{ /** * Returns whether the entity is able to climb blocks such as ladders or vines. - * @return bool */ public function canClimb() : bool{ return $this->canClimb; @@ -425,8 +394,6 @@ abstract class Entity{ /** * Sets whether the entity is able to climb climbable blocks. - * - * @param bool $value */ public function setCanClimb(bool $value = true) : void{ $this->canClimb = $value; @@ -434,8 +401,6 @@ abstract class Entity{ /** * Returns whether this entity is climbing a block. By default this is only true if the entity is climbing a ladder or vine or similar block. - * - * @return bool */ public function canClimbWalls() : bool{ return $this->canClimbWalls; @@ -443,8 +408,6 @@ abstract class Entity{ /** * Sets whether the entity is climbing a block. If true, the entity can climb anything. - * - * @param bool $value */ public function setCanClimbWalls(bool $value = true) : void{ $this->canClimbWalls = $value; @@ -452,7 +415,6 @@ abstract class Entity{ /** * Returns the entity ID of the owning entity, or null if the entity doesn't have an owner. - * @return int|null */ public function getOwningEntityId() : ?int{ return $this->ownerId; @@ -460,7 +422,6 @@ abstract class Entity{ /** * Returns the owning entity, or null if the entity was not found. - * @return Entity|null */ public function getOwningEntity() : ?Entity{ return $this->ownerId !== null ? $this->server->getWorldManager()->findEntity($this->ownerId) : null; @@ -469,8 +430,6 @@ abstract class Entity{ /** * Sets the owner of the entity. Passing null will remove the current owner. * - * @param Entity|null $owner - * * @throws \InvalidArgumentException if the supplied entity is not valid */ public function setOwningEntity(?Entity $owner) : void{ @@ -485,7 +444,6 @@ abstract class Entity{ /** * Returns the entity ID of the entity's target, or null if it doesn't have a target. - * @return int|null */ public function getTargetEntityId() : ?int{ return $this->targetId; @@ -494,8 +452,6 @@ abstract class Entity{ /** * Returns the entity's target entity, or null if not found. * This is used for things like hostile mobs attacking entities, and for fishing rods reeling hit entities in. - * - * @return Entity|null */ public function getTargetEntity() : ?Entity{ return $this->targetId !== null ? $this->server->getWorldManager()->findEntity($this->targetId) : null; @@ -504,8 +460,6 @@ abstract class Entity{ /** * Sets the entity's target entity. Passing null will remove the current target. * - * @param Entity|null $target - * * @throws \InvalidArgumentException if the target entity is not valid */ public function setTargetEntity(?Entity $target) : void{ @@ -520,7 +474,6 @@ abstract class Entity{ /** * Returns whether this entity will be saved when its chunk is unloaded. - * @return bool */ public function canSaveWithChunk() : bool{ return $this->savedWithChunk; @@ -529,8 +482,6 @@ abstract class Entity{ /** * Sets whether this entity will be saved when its chunk is unloaded. This can be used to prevent the entity being * saved to disk. - * - * @param bool $value */ public function setCanSaveWithChunk(bool $value) : void{ $this->savedWithChunk = $value; @@ -596,9 +547,6 @@ abstract class Entity{ } - /** - * @param EntityDamageEvent $source - */ public function attack(EntityDamageEvent $source) : void{ $source->call(); if($source->isCancelled()){ @@ -610,9 +558,6 @@ abstract class Entity{ $this->setHealth($this->getHealth() - $source->getFinalDamage()); } - /** - * @param EntityRegainHealthEvent $source - */ public function heal(EntityRegainHealthEvent $source) : void{ $source->call(); if($source->isCancelled()){ @@ -639,10 +584,6 @@ abstract class Entity{ /** * Called to tick entities while dead. Returns whether the entity should be flagged for despawn yet. - * - * @param int $tickDiff - * - * @return bool */ protected function onDeathUpdate(int $tickDiff) : bool{ return true; @@ -652,17 +593,12 @@ abstract class Entity{ return $this->health > 0; } - /** - * @return float - */ public function getHealth() : float{ return $this->health; } /** * Sets the health of the Entity. This won't send any update to the players - * - * @param float $amount */ public function setHealth(float $amount) : void{ if($amount == $this->health){ @@ -680,30 +616,18 @@ abstract class Entity{ } } - /** - * @return int - */ public function getMaxHealth() : int{ return $this->maxHealth; } - /** - * @param int $amount - */ public function setMaxHealth(int $amount) : void{ $this->maxHealth = $amount; } - /** - * @param EntityDamageEvent $type - */ public function setLastDamageCause(EntityDamageEvent $type) : void{ $this->lastDamageCause = $type; } - /** - * @return EntityDamageEvent|null - */ public function getLastDamageCause() : ?EntityDamageEvent{ return $this->lastDamageCause; } @@ -764,15 +688,11 @@ abstract class Entity{ } } - /** - * @return int - */ public function getFireTicks() : int{ return $this->fireTicks; } /** - * @param int $fireTicks * @throws \InvalidArgumentException */ public function setFireTicks(int $fireTicks) : void{ @@ -1033,9 +953,6 @@ abstract class Entity{ return Facing::EAST; } - /** - * @return Vector3 - */ public function getDirectionVector() : Vector3{ $y = -sin(deg2rad($this->location->pitch)); $xz = cos(deg2rad($this->location->pitch)); @@ -1125,8 +1042,6 @@ abstract class Entity{ /** * Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the * entity's motion is zero. Used to trigger movement updates when blocks change near entities. - * - * @param bool $value */ final public function setForceMovementUpdate(bool $value = true) : void{ $this->forceMovementUpdate = $value; @@ -1136,7 +1051,6 @@ abstract class Entity{ /** * Returns whether the entity needs a movement update on the next tick. - * @return bool */ public function hasMovementUpdate() : bool{ return ( @@ -1152,10 +1066,6 @@ abstract class Entity{ $this->fallDistance = 0.0; } - /** - * @param float $distanceThisTick - * @param bool $onGround - */ protected function updateFallState(float $distanceThisTick, bool $onGround) : void{ if($onGround){ if($this->fallDistance > 0){ @@ -1169,8 +1079,6 @@ abstract class Entity{ /** * Called when a falling entity hits the ground. - * - * @param float $fallDistance */ public function fall(float $fallDistance) : void{ @@ -1397,8 +1305,6 @@ abstract class Entity{ /** * Returns whether this entity can be moved by currents in liquids. - * - * @return bool */ public function canBeMovedByCurrents() : bool{ return true; @@ -1533,10 +1439,6 @@ abstract class Entity{ /** * Adds the given values to the entity's motion vector. - * - * @param float $x - * @param float $y - * @param float $z */ public function addMotion(float $x, float $y, float $z) : void{ $this->motion->x += $x; @@ -1550,10 +1452,6 @@ abstract class Entity{ /** * @param Vector3|Position|Location $pos - * @param float|null $yaw - * @param float|null $pitch - * - * @return bool */ public function teleport(Vector3 $pos, ?float $yaw = null, ?float $pitch = null) : bool{ if($pos instanceof Location){ @@ -1615,8 +1513,6 @@ abstract class Entity{ /** * Called by spawnTo() to send whatever packets needed to spawn the entity to the client. - * - * @param Player $player */ protected function sendSpawnPacket(Player $player) : void{ $pk = new AddActorPacket(); @@ -1633,9 +1529,6 @@ abstract class Entity{ $player->getNetworkSession()->sendDataPacket($pk); } - /** - * @param Player $player - */ public function spawnTo(Player $player) : void{ $id = spl_object_id($player); if(!isset($this->hasSpawned[$id]) and $player->isUsingChunk($this->location->getFloorX() >> 4, $this->location->getFloorZ() >> 4)){ @@ -1664,9 +1557,6 @@ abstract class Entity{ /** * @deprecated WARNING: This function DOES NOT permanently hide the entity from the player. As soon as the entity or * player moves, the player will once again be able to see the entity. - * - * @param Player $player - * @param bool $send */ public function despawnFrom(Player $player, bool $send = true) : void{ $id = spl_object_id($player); @@ -1702,7 +1592,6 @@ abstract class Entity{ /** * Returns whether the entity has been "closed". - * @return bool */ public function isClosed() : bool{ return $this->closed; @@ -1773,8 +1662,6 @@ abstract class Entity{ } /** - * @param bool $dirtyOnly - * * @return MetadataProperty[] */ final protected function getSyncedNetworkData(bool $dirtyOnly) : array{ diff --git a/src/entity/EntityFactory.php b/src/entity/EntityFactory.php index a4de128fd..51ba2176a 100644 --- a/src/entity/EntityFactory.php +++ b/src/entity/EntityFactory.php @@ -163,8 +163,6 @@ final class EntityFactory{ /** * Returns a new runtime entity ID for a new entity. - * - * @return int */ public static function nextRuntimeId() : int{ return self::$entityCount++; @@ -176,9 +174,6 @@ final class EntityFactory{ * * TODO: make this NBT-independent * - * @param string $baseClass - * @param World $world - * @param CompoundTag $nbt * @param mixed ...$args * * @return Entity instanceof $baseClass @@ -203,10 +198,6 @@ final class EntityFactory{ /** * Creates an entity from data stored on a chunk. * - * @param World $world - * @param CompoundTag $nbt - * - * @return Entity|null * @throws \RuntimeException *@internal * @@ -243,13 +234,6 @@ final class EntityFactory{ /** * Helper function which creates minimal NBT needed to spawn an entity. - * - * @param Vector3 $pos - * @param Vector3|null $motion - * @param float $yaw - * @param float $pitch - * - * @return CompoundTag */ public static function createBaseNBT(Vector3 $pos, ?Vector3 $motion = null, float $yaw = 0.0, float $pitch = 0.0) : CompoundTag{ return CompoundTag::create() diff --git a/src/entity/ExperienceManager.php b/src/entity/ExperienceManager.php index 1d280812d..49aea2c27 100644 --- a/src/entity/ExperienceManager.php +++ b/src/entity/ExperienceManager.php @@ -64,7 +64,6 @@ class ExperienceManager{ /** * Returns the player's experience level. - * @return int */ public function getXpLevel() : int{ return (int) $this->levelAttr->getValue(); @@ -72,10 +71,6 @@ class ExperienceManager{ /** * Sets the player's experience level. This does not affect their total XP or their XP progress. - * - * @param int $level - * - * @return bool */ public function setXpLevel(int $level) : bool{ return $this->setXpAndProgress($level, null); @@ -83,11 +78,6 @@ class ExperienceManager{ /** * Adds a number of XP levels to the player. - * - * @param int $amount - * @param bool $playSound - * - * @return bool */ public function addXpLevels(int $amount, bool $playSound = true) : bool{ $oldLevel = $this->getXpLevel(); @@ -107,10 +97,6 @@ class ExperienceManager{ /** * Subtracts a number of XP levels from the player. - * - * @param int $amount - * - * @return bool */ public function subtractXpLevels(int $amount) : bool{ return $this->addXpLevels(-$amount); @@ -118,7 +104,6 @@ class ExperienceManager{ /** * Returns a value between 0.0 and 1.0 to indicate how far through the current level the player is. - * @return float */ public function getXpProgress() : float{ return $this->progressAttr->getValue(); @@ -126,10 +111,6 @@ class ExperienceManager{ /** * Sets the player's progress through the current level to a value between 0.0 and 1.0. - * - * @param float $progress - * - * @return bool */ public function setXpProgress(float $progress) : bool{ return $this->setXpAndProgress(null, $progress); @@ -137,7 +118,6 @@ class ExperienceManager{ /** * Returns the number of XP points the player has progressed into their current level. - * @return int */ public function getRemainderXp() : int{ return (int) (ExperienceUtils::getXpToCompleteLevel($this->getXpLevel()) * $this->getXpProgress()); @@ -147,8 +127,6 @@ class ExperienceManager{ * Returns the amount of XP points the player currently has, calculated from their current level and progress * through their current level. This will be reduced by enchanting deducting levels and is used to calculate the * amount of XP the player drops on death. - * - * @return int */ public function getCurrentTotalXp() : int{ return ExperienceUtils::getXpToReachLevel($this->getXpLevel()) + $this->getRemainderXp(); @@ -157,10 +135,6 @@ class ExperienceManager{ /** * Sets the current total of XP the player has, recalculating their XP level and progress. * Note that this DOES NOT update the player's lifetime total XP. - * - * @param int $amount - * - * @return bool */ public function setCurrentTotalXp(int $amount) : bool{ $newLevel = ExperienceUtils::getLevelFromXp($amount); @@ -172,10 +146,7 @@ class ExperienceManager{ * Adds an amount of XP to the player, recalculating their XP level and progress. XP amount will be added to the * player's lifetime XP. * - * @param int $amount * @param bool $playSound Whether to play level-up and XP gained sounds. - * - * @return bool */ public function addXp(int $amount, bool $playSound = true) : bool{ $this->totalXp += $amount; @@ -201,10 +172,6 @@ class ExperienceManager{ /** * Takes an amount of XP from the player, recalculating their XP level and progress. - * - * @param int $amount - * - * @return bool */ public function subtractXp(int $amount) : bool{ return $this->addXp(-$amount); @@ -234,9 +201,6 @@ class ExperienceManager{ /** * @internal - * - * @param int $level - * @param float $progress */ public function setXpAndProgressNoEvent(int $level, float $progress) : void{ $this->levelAttr->setValue($level); @@ -246,8 +210,6 @@ class ExperienceManager{ /** * Returns the total XP the player has collected in their lifetime. Resets when the player dies. * XP levels being removed in enchanting do not reduce this number. - * - * @return int */ public function getLifetimeTotalXp() : int{ return $this->totalXp; @@ -256,8 +218,6 @@ class ExperienceManager{ /** * Sets the lifetime total XP of the player. This does not recalculate their level or progress. Used for player * score when they die. (TODO: add this when MCPE supports it) - * - * @param int $amount */ public function setLifetimeTotalXp(int $amount) : void{ if($amount < 0){ @@ -270,7 +230,6 @@ class ExperienceManager{ /** * Returns whether the human can pickup XP orbs (checks cooldown time) - * @return bool */ public function canPickupXp() : bool{ return $this->xpCooldown === 0; @@ -314,8 +273,6 @@ class ExperienceManager{ /** * Sets the duration in ticks until the human can pick up another XP orb. - * - * @param int $value */ public function resetXpCooldown(int $value = 2) : void{ $this->xpCooldown = $value; diff --git a/src/entity/Human.php b/src/entity/Human.php index bdf7969e0..3cdc13d66 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -112,25 +112,17 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ * @deprecated * * Checks the length of a supplied skin bitmap and returns whether the length is valid. - * - * @param string $skin - * - * @return bool */ public static function isValidSkin(string $skin) : bool{ return in_array(strlen($skin), Skin::ACCEPTED_SKIN_SIZES, true); } - /** - * @return UUID - */ public function getUniqueId() : UUID{ return $this->uuid; } /** * Returns a Skin object containing information about this human's skin. - * @return Skin */ public function getSkin() : Skin{ return $this->skin; @@ -139,8 +131,6 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ /** * Sets the human's skin. This will not send any update to viewers, you need to do that manually using * {@link sendSkin}. - * - * @param Skin $skin */ public function setSkin(Skin $skin) : void{ $this->skin = $skin; @@ -168,9 +158,6 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ } } - /** - * @return HungerManager - */ public function getHungerManager() : HungerManager{ return $this->hungerManager; } @@ -188,9 +175,6 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ return parent::consumeObject($consumable); } - /** - * @return ExperienceManager - */ public function getXpManager() : ExperienceManager{ return $this->xpManager; } @@ -214,8 +198,6 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ /** * For Human entities which are not players, sets their properties such as nametag, skin and UUID from NBT. - * - * @param CompoundTag $nbt */ protected function initHumanData(CompoundTag $nbt) : void{ if($nbt->hasTag("NameTag", StringTag::class)){ diff --git a/src/entity/HungerManager.php b/src/entity/HungerManager.php index 77e162c9b..8f8be0abd 100644 --- a/src/entity/HungerManager.php +++ b/src/entity/HungerManager.php @@ -69,8 +69,6 @@ class HungerManager{ * WARNING: This method does not check if full and may throw an exception if out of bounds. * @see HungerManager::addFood() * - * @param float $new - * * @throws \InvalidArgumentException */ public function setFood(float $new) : void{ @@ -98,8 +96,6 @@ class HungerManager{ /** * Returns whether this Human may consume objects requiring hunger. - * - * @return bool */ public function isHungry() : bool{ return $this->getFood() < $this->getMaxFood(); @@ -113,8 +109,6 @@ class HungerManager{ * WARNING: This method does not check if saturated and may throw an exception if out of bounds. * @see HungerManager::addSaturation() * - * @param float $saturation - * * @throws \InvalidArgumentException */ public function setSaturation(float $saturation) : void{ @@ -132,8 +126,6 @@ class HungerManager{ /** * WARNING: This method does not check if exhausted and does not consume saturation/food. * @see HungerManager::exhaust() - * - * @param float $exhaustion */ public function setExhaustion(float $exhaustion) : void{ $this->exhaustionAttr->setValue($exhaustion); @@ -142,9 +134,6 @@ class HungerManager{ /** * Increases exhaustion level. * - * @param float $amount - * @param int $cause - * * @return float the amount of exhaustion level increased */ public function exhaust(float $amount, int $cause = PlayerExhaustEvent::CAUSE_CUSTOM) : float{ @@ -180,16 +169,10 @@ class HungerManager{ return $ev->getAmount(); } - /** - * @return int - */ public function getFoodTickTimer() : int{ return $this->foodTickTimer; } - /** - * @param int $foodTickTimer - */ public function setFoodTickTimer(int $foodTickTimer) : void{ if($foodTickTimer < 0){ throw new \InvalidArgumentException("Expected a non-negative value"); @@ -238,16 +221,10 @@ class HungerManager{ } } - /** - * @return bool - */ public function isEnabled() : bool{ return $this->enabled; } - /** - * @param bool $enabled - */ public function setEnabled(bool $enabled) : void{ $this->enabled = $enabled; } diff --git a/src/entity/Living.php b/src/entity/Living.php index afe021cd7..0f741ff0f 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -217,10 +217,6 @@ abstract class Living extends Entity{ /** * Causes the mob to consume the given Consumable object, applying applicable effects, health bonuses, food bonuses, * etc. - * - * @param Consumable $consumable - * - * @return bool */ public function consumeObject(Consumable $consumable) : bool{ foreach($consumable->getAdditionalEffects() as $effect){ @@ -234,7 +230,6 @@ abstract class Living extends Entity{ /** * Returns the initial upwards velocity of a jumping entity in blocks/tick, including additional velocity due to effects. - * @return float */ public function getJumpVelocity() : float{ return $this->jumpVelocity + ($this->effectManager->has(VanillaEffects::JUMP_BOOST()) ? ($this->effectManager->get(VanillaEffects::JUMP_BOOST())->getEffectLevel() / 10) : 0); @@ -261,8 +256,6 @@ abstract class Living extends Entity{ * Returns how many armour points this mob has. Armour points provide a percentage reduction to damage. * For mobs which can wear armour, this should return the sum total of the armour points provided by their * equipment. - * - * @return int */ public function getArmorPoints() : int{ $total = 0; @@ -275,10 +268,6 @@ abstract class Living extends Entity{ /** * Returns the highest level of the specified enchantment on any armour piece that the entity is currently wearing. - * - * @param Enchantment $enchantment - * - * @return int */ public function getHighestArmorEnchantmentLevel(Enchantment $enchantment) : int{ $result = 0; @@ -289,9 +278,6 @@ abstract class Living extends Entity{ return $result; } - /** - * @return ArmorInventory - */ public function getArmorInventory() : ArmorInventory{ return $this->armorInventory; } @@ -303,8 +289,6 @@ abstract class Living extends Entity{ /** * Called prior to EntityDamageEvent execution to apply modifications to the event's damage, such as reduction due * to effects or armour. - * - * @param EntityDamageEvent $source */ public function applyDamageModifiers(EntityDamageEvent $source) : void{ if($source->canBeReducedByArmor()){ @@ -332,8 +316,6 @@ abstract class Living extends Entity{ * Called after EntityDamageEvent execution to apply post-hurt effects, such as reducing absorption or modifying * armour durability. * This will not be called by damage sources causing death. - * - * @param EntityDamageEvent $source */ protected function applyPostDamageEffects(EntityDamageEvent $source) : void{ $this->setAbsorption(max(0, $this->getAbsorption() + $source->getModifier(EntityDamageEvent::MODIFIER_ABSORPTION))); @@ -363,8 +345,6 @@ abstract class Living extends Entity{ /** * Damages the worn armour according to the amount of damage given. Each 4 points (rounded down) deals 1 damage * point to each armour piece, but never less than 1 total. - * - * @param float $damage */ public function damageArmor(float $damage) : void{ $durabilityRemoved = (int) max(floor($damage / 4), 1); @@ -544,10 +524,6 @@ abstract class Living extends Entity{ /** * Ticks the entity's air supply, consuming it when underwater and regenerating it when out of water. - * - * @param int $tickDiff - * - * @return bool */ protected function doAirSupplyTick(int $tickDiff) : bool{ $ticks = $this->getAirSupplyTicks(); @@ -583,7 +559,6 @@ abstract class Living extends Entity{ /** * Returns whether the entity can currently breathe. - * @return bool */ public function canBreathe() : bool{ return $this->effectManager->has(VanillaEffects::WATER_BREATHING()) or $this->effectManager->has(VanillaEffects::CONDUIT_POWER()) or !$this->isUnderwater(); @@ -591,7 +566,6 @@ abstract class Living extends Entity{ /** * Returns whether the entity is currently breathing or not. If this is false, the entity's air supply will be used. - * @return bool */ public function isBreathing() : bool{ return $this->breathing; @@ -600,8 +574,6 @@ abstract class Living extends Entity{ /** * Sets whether the entity is currently breathing. If false, it will cause the entity's air supply to be used. * For players, this also shows the oxygen bar. - * - * @param bool $value */ public function setBreathing(bool $value = true) : void{ $this->breathing = $value; @@ -610,8 +582,6 @@ abstract class Living extends Entity{ /** * Returns the number of ticks remaining in the entity's air supply. Note that the entity may survive longer than * this amount of time without damage due to enchantments such as Respiration. - * - * @return int */ public function getAirSupplyTicks() : int{ return $this->breathTicks; @@ -619,8 +589,6 @@ abstract class Living extends Entity{ /** * Sets the number of air ticks left in the entity's air supply. - * - * @param int $ticks */ public function setAirSupplyTicks(int $ticks) : void{ $this->breathTicks = $ticks; @@ -628,7 +596,6 @@ abstract class Living extends Entity{ /** * Returns the maximum amount of air ticks the entity's air supply can contain. - * @return int */ public function getMaxAirSupplyTicks() : int{ return $this->maxBreathTicks; @@ -636,8 +603,6 @@ abstract class Living extends Entity{ /** * Sets the maximum amount of air ticks the air supply can hold. - * - * @param int $ticks */ public function setMaxAirSupplyTicks(int $ticks) : void{ $this->maxBreathTicks = $ticks; @@ -661,17 +626,12 @@ abstract class Living extends Entity{ /** * Returns the amount of XP this mob will drop on death. - * @return int */ public function getXpDropAmount() : int{ return 0; } /** - * @param int $maxDistance - * @param int $maxLength - * @param array $transparent - * * @return Block[] */ public function getLineOfSight(int $maxDistance, int $maxLength = 0, array $transparent = []) : array{ @@ -711,12 +671,6 @@ abstract class Living extends Entity{ return $blocks; } - /** - * @param int $maxDistance - * @param array $transparent - * - * @return Block|null - */ public function getTargetBlock(int $maxDistance, array $transparent = []) : ?Block{ $line = $this->getLineOfSight($maxDistance, 1, $transparent); if(count($line) > 0){ @@ -729,8 +683,6 @@ abstract class Living extends Entity{ /** * Changes the entity's yaw and pitch to make it look at the specified Vector3 position. For mobs, this will cause * their heads to turn. - * - * @param Vector3 $target */ public function lookAt(Vector3 $target) : void{ $horizontal = sqrt(($target->x - $this->location->x) ** 2 + ($target->z - $this->location->z) ** 2); diff --git a/src/entity/Location.php b/src/entity/Location.php index 6bb6f76fd..8d7cf84ec 100644 --- a/src/entity/Location.php +++ b/src/entity/Location.php @@ -38,8 +38,6 @@ class Location extends Position{ * @param float|int $x * @param float|int $y * @param float|int $z - * @param float $yaw - * @param float $pitch * @param World $world */ public function __construct($x = 0, $y = 0, $z = 0, float $yaw = 0.0, float $pitch = 0.0, ?World $world = null){ @@ -49,7 +47,6 @@ class Location extends Position{ } /** - * @param Vector3 $pos * @param World|null $world default null * @param float $yaw default 0.0 * @param float $pitch default 0.0 @@ -62,8 +59,6 @@ class Location extends Position{ /** * Return a Location instance - * - * @return Location */ public function asLocation() : Location{ return new Location($this->x, $this->y, $this->z, $this->yaw, $this->pitch, $this->world); diff --git a/src/entity/Skin.php b/src/entity/Skin.php index af26dbbac..625f9f109 100644 --- a/src/entity/Skin.php +++ b/src/entity/Skin.php @@ -83,37 +83,22 @@ final class Skin{ $this->geometryData = $geometryData; } - /** - * @return string - */ public function getSkinId() : string{ return $this->skinId; } - /** - * @return string - */ public function getSkinData() : string{ return $this->skinData; } - /** - * @return string - */ public function getCapeData() : string{ return $this->capeData; } - /** - * @return string - */ public function getGeometryName() : string{ return $this->geometryName; } - /** - * @return string - */ public function getGeometryData() : string{ return $this->geometryData; } diff --git a/src/entity/Villager.php b/src/entity/Villager.php index cfe07247d..b76ff57fd 100644 --- a/src/entity/Villager.php +++ b/src/entity/Villager.php @@ -71,8 +71,6 @@ class Villager extends Living implements Ageable{ /** * Sets the villager profession - * - * @param int $profession */ public function setProfession(int $profession) : void{ $this->profession = $profession; //TODO: validation diff --git a/src/entity/effect/Effect.php b/src/entity/effect/Effect.php index fe2f80bd1..bcc347cf6 100644 --- a/src/entity/effect/Effect.php +++ b/src/entity/effect/Effect.php @@ -57,7 +57,6 @@ class Effect{ /** * Returns the effect ID as per Minecraft PE - * @return int */ public function getId() : int{ return $this->id; @@ -65,7 +64,6 @@ class Effect{ /** * Returns the translation key used to translate this effect's name. - * @return string */ public function getName() : string{ return $this->name; @@ -73,7 +71,6 @@ class Effect{ /** * Returns a Color object representing this effect's particle colour. - * @return Color */ public function getColor() : Color{ return $this->color; @@ -82,8 +79,6 @@ class Effect{ /** * Returns whether this effect is harmful. * TODO: implement inverse effect results for undead mobs - * - * @return bool */ public function isBad() : bool{ return $this->bad; @@ -91,7 +86,6 @@ class Effect{ /** * Returns the default duration (in ticks) this effect will apply for if a duration is not specified. - * @return int */ public function getDefaultDuration() : int{ return 600; @@ -99,7 +93,6 @@ class Effect{ /** * Returns whether this effect will give the subject potion bubbles. - * @return bool */ public function hasBubbles() : bool{ return $this->hasBubbles; @@ -107,10 +100,6 @@ class Effect{ /** * Returns whether the effect will do something on the current tick. - * - * @param EffectInstance $instance - * - * @return bool */ public function canTick(EffectInstance $instance) : bool{ return false; @@ -118,11 +107,6 @@ class Effect{ /** * Applies effect results to an entity. This will not be called unless canTick() returns true. - * - * @param Living $entity - * @param EffectInstance $instance - * @param float $potency - * @param null|Entity $source */ public function applyEffect(Living $entity, EffectInstance $instance, float $potency = 1.0, ?Entity $source = null) : void{ @@ -130,9 +114,6 @@ class Effect{ /** * Applies effects to the entity when the effect is first added. - * - * @param Living $entity - * @param EffectInstance $instance */ public function add(Living $entity, EffectInstance $instance) : void{ @@ -140,9 +121,6 @@ class Effect{ /** * Removes the effect from the entity, resetting any changed values back to their original defaults. - * - * @param Living $entity - * @param EffectInstance $instance */ public function remove(Living $entity, EffectInstance $instance) : void{ diff --git a/src/entity/effect/EffectInstance.php b/src/entity/effect/EffectInstance.php index 1af2e5b6e..65f4c8ebb 100644 --- a/src/entity/effect/EffectInstance.php +++ b/src/entity/effect/EffectInstance.php @@ -47,12 +47,7 @@ class EffectInstance{ private $color; /** - * @param Effect $effectType * @param int|null $duration Passing null will use the effect type's default duration - * @param int $amplifier - * @param bool $visible - * @param bool $ambient - * @param null|Color $overrideColor */ public function __construct(Effect $effectType, ?int $duration = null, int $amplifier = 0, bool $visible = true, bool $ambient = false, ?Color $overrideColor = null){ $this->effectType = $effectType; @@ -67,17 +62,12 @@ class EffectInstance{ return $this->effectType->getId(); } - /** - * @return Effect - */ public function getType() : Effect{ return $this->effectType; } /** * Returns the number of ticks remaining until the effect expires. - * - * @return int */ public function getDuration() : int{ return $this->duration; @@ -86,8 +76,6 @@ class EffectInstance{ /** * Sets the number of ticks remaining until the effect expires. * - * @param int $duration - * * @throws \InvalidArgumentException * * @return $this @@ -104,8 +92,6 @@ class EffectInstance{ /** * Decreases the duration by the given number of ticks, without dropping below zero. * - * @param int $ticks - * * @return $this */ public function decreaseDuration(int $ticks) : EffectInstance{ @@ -116,32 +102,23 @@ class EffectInstance{ /** * Returns whether the duration has run out. - * - * @return bool */ public function hasExpired() : bool{ return $this->duration <= 0; } - /** - * @return int - */ public function getAmplifier() : int{ return $this->amplifier; } /** * Returns the level of this effect, which is always one higher than the amplifier. - * - * @return int */ public function getEffectLevel() : int{ return $this->amplifier + 1; } /** - * @param int $amplifier - * * @return $this */ public function setAmplifier(int $amplifier) : EffectInstance{ @@ -155,16 +132,12 @@ class EffectInstance{ /** * Returns whether this effect will produce some visible effect, such as bubbles or particles. - * - * @return bool */ public function isVisible() : bool{ return $this->visible; } /** - * @param bool $visible - * * @return $this */ public function setVisible(bool $visible = true) : EffectInstance{ @@ -177,16 +150,12 @@ class EffectInstance{ * Returns whether the effect originated from the ambient environment. * Ambient effects can originate from things such as a Beacon's area of effect radius. * If this flag is set, the amount of visible particles will be reduced by a factor of 5. - * - * @return bool */ public function isAmbient() : bool{ return $this->ambient; } /** - * @param bool $ambient - * * @return $this */ public function setAmbient(bool $ambient = true) : EffectInstance{ @@ -198,8 +167,6 @@ class EffectInstance{ /** * Returns the particle colour of this effect instance. This can be overridden on a per-EffectInstance basis, so it * is not reflective of the default colour of the effect. - * - * @return Color */ public function getColor() : Color{ return $this->color; @@ -207,10 +174,6 @@ class EffectInstance{ /** * Sets the colour of this EffectInstance. - * - * @param Color $color - * - * @return EffectInstance */ public function setColor(Color $color) : EffectInstance{ $this->color = $color; @@ -220,8 +183,6 @@ class EffectInstance{ /** * Resets the colour of this EffectInstance to the default specified by its type. - * - * @return EffectInstance */ public function resetColor() : EffectInstance{ $this->color = $this->effectType->getColor(); diff --git a/src/entity/effect/EffectManager.php b/src/entity/effect/EffectManager.php index ab3cef656..7cead7f74 100644 --- a/src/entity/effect/EffectManager.php +++ b/src/entity/effect/EffectManager.php @@ -73,8 +73,6 @@ class EffectManager{ /** * Removes the effect with the specified ID from the mob. - * - * @param Effect $effectType */ public function remove(Effect $effectType) : void{ $index = $effectType->getId(); @@ -105,10 +103,6 @@ class EffectManager{ /** * Returns the effect instance active on this entity with the specified ID, or null if the mob does not have the * effect. - * - * @param Effect $effect - * - * @return EffectInstance|null */ public function get(Effect $effect) : ?EffectInstance{ return $this->effects[$effect->getId()] ?? null; @@ -116,10 +110,6 @@ class EffectManager{ /** * Returns whether the specified effect is active on the mob. - * - * @param Effect $effect - * - * @return bool */ public function has(Effect $effect) : bool{ return isset($this->effects[$effect->getId()]); @@ -130,8 +120,6 @@ class EffectManager{ * If a weaker effect of the same type is already applied, it will be replaced. * If a weaker or equal-strength effect is already applied but has a shorter duration, it will be replaced. * - * @param EffectInstance $effect - * * @return bool whether the effect has been successfully applied. */ public function add(EffectInstance $effect) : bool{ @@ -203,16 +191,10 @@ class EffectManager{ } } - /** - * @return Color - */ public function getBubbleColor() : Color{ return $this->bubbleColor; } - /** - * @return bool - */ public function hasOnlyAmbientEffects() : bool{ return $this->onlyAmbientEffects; } diff --git a/src/entity/effect/VanillaEffects.php b/src/entity/effect/VanillaEffects.php index 1f82926c5..a20b4ebb6 100644 --- a/src/entity/effect/VanillaEffects.php +++ b/src/entity/effect/VanillaEffects.php @@ -104,11 +104,6 @@ final class VanillaEffects{ self::$mcpeIdMap[$member->getId()] = $member; } - /** - * @param int $id - * - * @return Effect|null - */ public static function byMcpeId(int $id) : ?Effect{ self::checkInit(); return self::$mcpeIdMap[$id] ?? null; @@ -121,11 +116,6 @@ final class VanillaEffects{ return self::_registryGetAll(); } - /** - * @param string $name - * - * @return Effect - */ public static function fromString(string $name) : Effect{ $result = self::_registryFromString($name); assert($result instanceof Effect); diff --git a/src/entity/object/ExperienceOrb.php b/src/entity/object/ExperienceOrb.php index 31528fbb1..a1059ca94 100644 --- a/src/entity/object/ExperienceOrb.php +++ b/src/entity/object/ExperienceOrb.php @@ -52,10 +52,6 @@ class ExperienceOrb extends Entity{ /** * Returns the largest size of normal XP orb that will be spawned for the specified amount of XP. Used to split XP * up into multiple orbs when an amount of XP is dropped. - * - * @param int $amount - * - * @return int */ public static function getMaxOrbSize(int $amount) : int{ foreach(self::ORB_SPLIT_SIZES as $split){ @@ -70,8 +66,6 @@ class ExperienceOrb extends Entity{ /** * Splits the specified amount of XP into an array of acceptable XP orb sizes. * - * @param int $amount - * * @return int[] */ public static function splitIntoOrbSizes(int $amount) : array{ diff --git a/src/entity/object/ItemEntity.php b/src/entity/object/ItemEntity.php index 698c21d90..092bfe85c 100644 --- a/src/entity/object/ItemEntity.php +++ b/src/entity/object/ItemEntity.php @@ -154,9 +154,6 @@ class ItemEntity extends Entity{ return $nbt; } - /** - * @return Item - */ public function getItem() : Item{ return $this->item; } @@ -169,32 +166,22 @@ class ItemEntity extends Entity{ return false; } - /** - * @return int - */ public function getPickupDelay() : int{ return $this->pickupDelay; } - /** - * @param int $delay - */ public function setPickupDelay(int $delay) : void{ $this->pickupDelay = $delay; } /** * Returns the number of ticks left before this item will despawn. If -1, the item will never despawn. - * - * @return int */ public function getDespawnDelay() : int{ return $this->despawnDelay; } /** - * @param int $despawnDelay - * * @throws \InvalidArgumentException */ public function setDespawnDelay(int $despawnDelay) : void{ @@ -204,30 +191,18 @@ class ItemEntity extends Entity{ $this->despawnDelay = $despawnDelay; } - /** - * @return string - */ public function getOwner() : string{ return $this->owner; } - /** - * @param string $owner - */ public function setOwner(string $owner) : void{ $this->owner = $owner; } - /** - * @return string - */ public function getThrower() : string{ return $this->thrower; } - /** - * @param string $thrower - */ public function setThrower(string $thrower) : void{ $this->thrower = $thrower; } diff --git a/src/entity/object/Painting.php b/src/entity/object/Painting.php index b9276755b..7a5e34102 100644 --- a/src/entity/object/Painting.php +++ b/src/entity/object/Painting.php @@ -164,7 +164,6 @@ class Painting extends Entity{ /** * Returns the painting motive (which image is displayed on the painting) - * @return PaintingMotive */ public function getMotive() : PaintingMotive{ return PaintingMotive::getMotiveByName($this->motive); @@ -176,11 +175,6 @@ class Painting extends Entity{ /** * Returns the bounding-box a painting with the specified motive would have at the given position and direction. - * - * @param int $facing - * @param PaintingMotive $motive - * - * @return AxisAlignedBB */ private static function getPaintingBB(int $facing, PaintingMotive $motive) : AxisAlignedBB{ $width = $motive->getWidth(); @@ -199,14 +193,6 @@ class Painting extends Entity{ /** * Returns whether a painting with the specified motive can be placed at the given position. - * - * @param World $world - * @param Vector3 $blockIn - * @param int $facing - * @param bool $checkOverlap - * @param PaintingMotive $motive - * - * @return bool */ public static function canFit(World $world, Vector3 $blockIn, int $facing, bool $checkOverlap, PaintingMotive $motive) : bool{ $width = $motive->getWidth(); diff --git a/src/entity/object/PaintingMotive.php b/src/entity/object/PaintingMotive.php index c0f0cabc8..1ae1deb17 100644 --- a/src/entity/object/PaintingMotive.php +++ b/src/entity/object/PaintingMotive.php @@ -64,18 +64,10 @@ class PaintingMotive{ } } - /** - * @param PaintingMotive $motive - */ public static function registerMotive(PaintingMotive $motive) : void{ self::$motives[$motive->getName()] = $motive; } - /** - * @param string $name - * - * @return PaintingMotive|null - */ public static function getMotiveByName(string $name) : ?PaintingMotive{ return self::$motives[$name] ?? null; } @@ -101,23 +93,14 @@ class PaintingMotive{ $this->height = $height; } - /** - * @return string - */ public function getName() : string{ return $this->name; } - /** - * @return int - */ public function getWidth() : int{ return $this->width; } - /** - * @return int - */ public function getHeight() : int{ return $this->height; } diff --git a/src/entity/projectile/Arrow.php b/src/entity/projectile/Arrow.php index f5bfeeabf..9a2bae08c 100644 --- a/src/entity/projectile/Arrow.php +++ b/src/entity/projectile/Arrow.php @@ -106,16 +106,10 @@ class Arrow extends Projectile{ } } - /** - * @return float - */ public function getPunchKnockback() : float{ return $this->punchKnockback; } - /** - * @param float $punchKnockback - */ public function setPunchKnockback(float $punchKnockback) : void{ $this->punchKnockback = $punchKnockback; } @@ -161,16 +155,10 @@ class Arrow extends Projectile{ } } - /** - * @return int - */ public function getPickupMode() : int{ return $this->pickupMode; } - /** - * @param int $pickupMode - */ public function setPickupMode(int $pickupMode) : void{ $this->pickupMode = $pickupMode; } diff --git a/src/entity/projectile/Projectile.php b/src/entity/projectile/Projectile.php index 62b00af9c..db2b5bcce 100644 --- a/src/entity/projectile/Projectile.php +++ b/src/entity/projectile/Projectile.php @@ -116,8 +116,6 @@ abstract class Projectile extends Entity{ /** * Returns the base damage applied on collision. This is multiplied by the projectile's speed to give a result * damage. - * - * @return float */ public function getBaseDamage() : float{ return $this->damage; @@ -125,8 +123,6 @@ abstract class Projectile extends Entity{ /** * Sets the base amount of damage applied by the projectile. - * - * @param float $damage */ public function setBaseDamage(float $damage) : void{ $this->damage = $damage; @@ -134,7 +130,6 @@ abstract class Projectile extends Entity{ /** * Returns the amount of damage this projectile will deal to the entity it hits. - * @return int */ public function getResultDamage() : int{ return (int) ceil($this->motion->length() * $this->damage); @@ -275,10 +270,6 @@ abstract class Projectile extends Entity{ * This can be overridden by other projectiles to allow altering the blocks which are collided with (for example * some projectiles collide with any non-air block). * - * @param Block $block - * @param Vector3 $start - * @param Vector3 $end - * * @return RayTraceResult|null the result of the ray trace if successful, or null if no interception is found. */ protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{ @@ -288,8 +279,6 @@ abstract class Projectile extends Entity{ /** * Called when the projectile hits something. Override this to perform non-target-specific effects when the * projectile hits something. - * - * @param ProjectileHitEvent $event */ protected function onHit(ProjectileHitEvent $event) : void{ @@ -297,9 +286,6 @@ abstract class Projectile extends Entity{ /** * Called when the projectile collides with an Entity. - * - * @param Entity $entityHit - * @param RayTraceResult $hitResult */ protected function onHitEntity(Entity $entityHit, RayTraceResult $hitResult) : void{ $damage = $this->getResultDamage(); @@ -327,9 +313,6 @@ abstract class Projectile extends Entity{ /** * Called when the projectile collides with a Block. - * - * @param Block $blockHit - * @param RayTraceResult $hitResult */ protected function onHitBlock(Block $blockHit, RayTraceResult $hitResult) : void{ $this->blockHit = clone $blockHit; diff --git a/src/entity/projectile/SplashPotion.php b/src/entity/projectile/SplashPotion.php index 30b7a023c..4c2336524 100644 --- a/src/entity/projectile/SplashPotion.php +++ b/src/entity/projectile/SplashPotion.php @@ -142,22 +142,17 @@ class SplashPotion extends Throwable{ /** * Returns the meta value of the potion item that this splash potion corresponds to. This decides what effects will be applied to the entity when it collides with its target. - * @return int */ public function getPotionId() : int{ return $this->potionId; } - /** - * @param int $id - */ public function setPotionId(int $id) : void{ $this->potionId = $id; //TODO: validation } /** * Returns whether this splash potion will create an area-effect cloud when it lands. - * @return bool */ public function willLinger() : bool{ return $this->linger; @@ -165,8 +160,6 @@ class SplashPotion extends Throwable{ /** * Sets whether this splash potion will create an area-effect-cloud when it lands. - * - * @param bool $value */ public function setLinger(bool $value = true) : void{ $this->linger = $value; diff --git a/src/entity/utils/ExperienceUtils.php b/src/entity/utils/ExperienceUtils.php index 38c0ab991..3e4f4f74e 100644 --- a/src/entity/utils/ExperienceUtils.php +++ b/src/entity/utils/ExperienceUtils.php @@ -30,10 +30,6 @@ abstract class ExperienceUtils{ /** * Calculates and returns the amount of XP needed to get from level 0 to level $level - * - * @param int $level - * - * @return int */ public static function getXpToReachLevel(int $level) : int{ if($level <= 16){ @@ -47,10 +43,6 @@ abstract class ExperienceUtils{ /** * Returns the amount of XP needed to reach $level + 1. - * - * @param int $level - * - * @return int */ public static function getXpToCompleteLevel(int $level) : int{ if($level <= 15){ @@ -65,10 +57,6 @@ abstract class ExperienceUtils{ /** * Calculates and returns the number of XP levels the specified amount of XP points are worth. * This returns a floating-point number, the decimal part being the progress through the resulting level. - * - * @param int $xp - * - * @return float */ public static function getLevelFromXp(int $xp) : float{ if($xp <= self::getXpToReachLevel(16)){ diff --git a/src/event/Cancellable.php b/src/event/Cancellable.php index 63e4a3f1e..1e439ad31 100644 --- a/src/event/Cancellable.php +++ b/src/event/Cancellable.php @@ -28,13 +28,7 @@ namespace pocketmine\event; * Events that can be cancelled must use the interface Cancellable */ interface Cancellable{ - /** - * @return bool - */ public function isCancelled() : bool; - /** - * @param bool $value - */ public function setCancelled(bool $value = true) : void; } diff --git a/src/event/CancellableTrait.php b/src/event/CancellableTrait.php index 740f24a4e..0fe5186ed 100644 --- a/src/event/CancellableTrait.php +++ b/src/event/CancellableTrait.php @@ -31,16 +31,10 @@ trait CancellableTrait{ /** @var bool */ private $isCancelled = false; - /** - * @return bool - */ public function isCancelled() : bool{ return $this->isCancelled; } - /** - * @param bool $value - */ public function setCancelled(bool $value = true) : void{ $this->isCancelled = $value; } diff --git a/src/event/Event.php b/src/event/Event.php index 5977516f3..b9a8f9828 100644 --- a/src/event/Event.php +++ b/src/event/Event.php @@ -36,9 +36,6 @@ abstract class Event{ /** @var string|null */ protected $eventName = null; - /** - * @return string - */ final public function getEventName() : string{ return $this->eventName ?? get_class($this); } diff --git a/src/event/EventPriority.php b/src/event/EventPriority.php index c7a788518..bcb914324 100644 --- a/src/event/EventPriority.php +++ b/src/event/EventPriority.php @@ -81,10 +81,6 @@ final class EventPriority{ public const MONITOR = 0; /** - * @param string $name - * - * @return int - * * @throws \InvalidArgumentException */ public static function fromString(string $name) : int{ diff --git a/src/event/HandlerList.php b/src/event/HandlerList.php index 80bc84448..b452a382c 100644 --- a/src/event/HandlerList.php +++ b/src/event/HandlerList.php @@ -43,8 +43,6 @@ class HandlerList{ } /** - * @param RegisteredListener $listener - * * @throws \Exception */ public function register(RegisteredListener $listener) : void{ @@ -89,17 +87,12 @@ class HandlerList{ } /** - * @param int $priority - * * @return RegisteredListener[] */ public function getListenersByPriority(int $priority) : array{ return $this->handlerSlots[$priority]; } - /** - * @return null|HandlerList - */ public function getParent() : ?HandlerList{ return $this->parentList; } diff --git a/src/event/HandlerListManager.php b/src/event/HandlerListManager.php index ed1c2713b..bf4cff143 100644 --- a/src/event/HandlerListManager.php +++ b/src/event/HandlerListManager.php @@ -61,8 +61,6 @@ class HandlerListManager{ /** * @param ReflectionClass $class * @phpstan-param \ReflectionClass $class - * - * @return bool */ private static function isValidClass(\ReflectionClass $class) : bool{ $tags = Utils::parseDocComment((string) $class->getDocComment()); @@ -70,10 +68,8 @@ class HandlerListManager{ } /** - * @param \ReflectionClass $class * @phpstan-param \ReflectionClass $class * - * @return \ReflectionClass|null * @phpstan-return \ReflectionClass|null */ private static function resolveNearestHandleableParent(\ReflectionClass $class) : ?\ReflectionClass{ @@ -88,9 +84,6 @@ class HandlerListManager{ * * Calling this method also lazily initializes the $classMap inheritance tree of handler lists. * - * @param string $event - * - * @return HandlerList * @throws \ReflectionException * @throws \InvalidArgumentException */ diff --git a/src/event/RegisteredListener.php b/src/event/RegisteredListener.php index ac06cd652..6d95660e7 100644 --- a/src/event/RegisteredListener.php +++ b/src/event/RegisteredListener.php @@ -44,14 +44,6 @@ class RegisteredListener{ /** @var TimingsHandler */ private $timings; - - /** - * @param \Closure $handler - * @param int $priority - * @param Plugin $plugin - * @param bool $handleCancelled - * @param TimingsHandler $timings - */ public function __construct(\Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled, TimingsHandler $timings){ if(!in_array($priority, EventPriority::ALL, true)){ throw new \InvalidArgumentException("Invalid priority number $priority"); @@ -67,23 +59,14 @@ class RegisteredListener{ return $this->handler; } - /** - * @return Plugin - */ public function getPlugin() : Plugin{ return $this->plugin; } - /** - * @return int - */ public function getPriority() : int{ return $this->priority; } - /** - * @param Event $event - */ public function callEvent(Event $event) : void{ if($event instanceof Cancellable and $event->isCancelled() and !$this->isHandlingCancelled()){ return; @@ -97,9 +80,6 @@ class RegisteredListener{ $this->timings->remove(); } - /** - * @return bool - */ public function isHandlingCancelled() : bool{ return $this->handleCancelled; } diff --git a/src/event/block/BlockBreakEvent.php b/src/event/block/BlockBreakEvent.php index a01fc6ccb..68f3fae18 100644 --- a/src/event/block/BlockBreakEvent.php +++ b/src/event/block/BlockBreakEvent.php @@ -49,12 +49,7 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ protected $xpDrops; /** - * @param Player $player - * @param Block $block - * @param Item $item - * @param bool $instaBreak * @param Item[] $drops - * @param int $xpDrops */ public function __construct(Player $player, Block $block, Item $item, bool $instaBreak = false, array $drops, int $xpDrops = 0){ parent::__construct($block); @@ -68,7 +63,6 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ /** * Returns the player who is destroying the block. - * @return Player */ public function getPlayer() : Player{ return $this->player; @@ -76,7 +70,6 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ /** * Returns the item used to destroy the block. - * @return Item */ public function getItem() : Item{ return $this->item; @@ -85,16 +78,11 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ /** * Returns whether the block may be broken in less than the amount of time calculated. This is usually true for * creative players. - * - * @return bool */ public function getInstaBreak() : bool{ return $this->instaBreak; } - /** - * @param bool $instaBreak - */ public function setInstaBreak(bool $instaBreak) : void{ $this->instaBreak = $instaBreak; } @@ -125,8 +113,6 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ /** * Returns how much XP will be dropped by breaking this block. - * - * @return int */ public function getXpDropAmount() : int{ return $this->xpDrops; @@ -134,8 +120,6 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{ /** * Sets how much XP will be dropped by breaking this block. - * - * @param int $amount */ public function setXpDropAmount(int $amount) : void{ if($amount < 0){ diff --git a/src/event/block/BlockBurnEvent.php b/src/event/block/BlockBurnEvent.php index d50f96953..96ddb6234 100644 --- a/src/event/block/BlockBurnEvent.php +++ b/src/event/block/BlockBurnEvent.php @@ -43,7 +43,6 @@ class BlockBurnEvent extends BlockEvent implements Cancellable{ /** * Returns the block (usually Fire) which caused the target block to be burned away. - * @return Block */ public function getCausingBlock() : Block{ return $this->causingBlock; diff --git a/src/event/block/BlockEvent.php b/src/event/block/BlockEvent.php index ec7077932..d506529ba 100644 --- a/src/event/block/BlockEvent.php +++ b/src/event/block/BlockEvent.php @@ -33,16 +33,10 @@ abstract class BlockEvent extends Event{ /** @var Block */ protected $block; - /** - * @param Block $block - */ public function __construct(Block $block){ $this->block = $block; } - /** - * @return Block - */ public function getBlock() : Block{ return $this->block; } diff --git a/src/event/block/BlockGrowEvent.php b/src/event/block/BlockGrowEvent.php index 49cac65d7..8786fd452 100644 --- a/src/event/block/BlockGrowEvent.php +++ b/src/event/block/BlockGrowEvent.php @@ -41,9 +41,6 @@ class BlockGrowEvent extends BlockEvent implements Cancellable{ $this->newState = $newState; } - /** - * @return Block - */ public function getNewState() : Block{ return $this->newState; } diff --git a/src/event/block/BlockPlaceEvent.php b/src/event/block/BlockPlaceEvent.php index 57aaacc37..955b90134 100644 --- a/src/event/block/BlockPlaceEvent.php +++ b/src/event/block/BlockPlaceEvent.php @@ -56,7 +56,6 @@ class BlockPlaceEvent extends BlockEvent implements Cancellable{ /** * Returns the player who is placing the block. - * @return Player */ public function getPlayer() : Player{ return $this->player; @@ -64,22 +63,15 @@ class BlockPlaceEvent extends BlockEvent implements Cancellable{ /** * Gets the item in hand - * @return Item */ public function getItem() : Item{ return $this->item; } - /** - * @return Block - */ public function getBlockReplaced() : Block{ return $this->blockReplace; } - /** - * @return Block - */ public function getBlockAgainst() : Block{ return $this->blockAgainst; } diff --git a/src/event/block/BlockSpreadEvent.php b/src/event/block/BlockSpreadEvent.php index d68fdb2ce..098e2d6d9 100644 --- a/src/event/block/BlockSpreadEvent.php +++ b/src/event/block/BlockSpreadEvent.php @@ -37,9 +37,6 @@ class BlockSpreadEvent extends BlockFormEvent{ $this->source = $source; } - /** - * @return Block - */ public function getSource() : Block{ return $this->source; } diff --git a/src/event/block/BlockTeleportEvent.php b/src/event/block/BlockTeleportEvent.php index ac4d6ae51..3dcd041ae 100644 --- a/src/event/block/BlockTeleportEvent.php +++ b/src/event/block/BlockTeleportEvent.php @@ -34,25 +34,15 @@ class BlockTeleportEvent extends BlockEvent implements Cancellable{ /** @var Vector3 */ private $to; - /** - * @param Block $block - * @param Vector3 $to - */ public function __construct(Block $block, Vector3 $to){ parent::__construct($block); $this->to = $to; } - /** - * @return Vector3 - */ public function getTo() : Vector3{ return $this->to; } - /** - * @param Vector3 $to - */ public function setTo(Vector3 $to) : void{ $this->to = $to; } diff --git a/src/event/block/SignChangeEvent.php b/src/event/block/SignChangeEvent.php index 70c7a789c..63357c238 100644 --- a/src/event/block/SignChangeEvent.php +++ b/src/event/block/SignChangeEvent.php @@ -44,11 +44,6 @@ class SignChangeEvent extends BlockEvent implements Cancellable{ /** @var SignText */ private $text; - /** - * @param Sign $sign - * @param Player $player - * @param SignText $text - */ public function __construct(Sign $sign, Player $player, SignText $text){ parent::__construct($sign); $this->sign = $sign; @@ -56,24 +51,16 @@ class SignChangeEvent extends BlockEvent implements Cancellable{ $this->text = $text; } - /** - * @return Sign - */ public function getSign() : Sign{ return $this->sign; } - /** - * @return Player - */ public function getPlayer() : Player{ return $this->player; } /** * Returns the text currently on the sign. - * - * @return SignText */ public function getOldText() : SignText{ return $this->sign->getText(); @@ -81,8 +68,6 @@ class SignChangeEvent extends BlockEvent implements Cancellable{ /** * Returns the text which will be on the sign after the event. - * - * @return SignText */ public function getNewText() : SignText{ return $this->text; @@ -90,8 +75,6 @@ class SignChangeEvent extends BlockEvent implements Cancellable{ /** * Sets the text to be written on the sign after the event. - * - * @param SignText $text */ public function setNewText(SignText $text) : void{ $this->text = $text; diff --git a/src/event/entity/EntityBlockChangeEvent.php b/src/event/entity/EntityBlockChangeEvent.php index 1655dc8d7..b6c28fd07 100644 --- a/src/event/entity/EntityBlockChangeEvent.php +++ b/src/event/entity/EntityBlockChangeEvent.php @@ -45,16 +45,10 @@ class EntityBlockChangeEvent extends EntityEvent implements Cancellable{ $this->to = $to; } - /** - * @return Block - */ public function getBlock() : Block{ return $this->from; } - /** - * @return Block - */ public function getTo() : Block{ return $this->to; } diff --git a/src/event/entity/EntityCombustByBlockEvent.php b/src/event/entity/EntityCombustByBlockEvent.php index 85f524a94..9b1d56f5a 100644 --- a/src/event/entity/EntityCombustByBlockEvent.php +++ b/src/event/entity/EntityCombustByBlockEvent.php @@ -30,19 +30,11 @@ class EntityCombustByBlockEvent extends EntityCombustEvent{ /** @var Block */ protected $combuster; - /** - * @param Block $combuster - * @param Entity $combustee - * @param int $duration - */ public function __construct(Block $combuster, Entity $combustee, int $duration){ parent::__construct($combustee, $duration); $this->combuster = $combuster; } - /** - * @return Block - */ public function getCombuster() : Block{ return $this->combuster; } diff --git a/src/event/entity/EntityCombustByEntityEvent.php b/src/event/entity/EntityCombustByEntityEvent.php index cfa448de2..435ab670a 100644 --- a/src/event/entity/EntityCombustByEntityEvent.php +++ b/src/event/entity/EntityCombustByEntityEvent.php @@ -29,19 +29,11 @@ class EntityCombustByEntityEvent extends EntityCombustEvent{ /** @var Entity */ protected $combuster; - /** - * @param Entity $combuster - * @param Entity $combustee - * @param int $duration - */ public function __construct(Entity $combuster, Entity $combustee, int $duration){ parent::__construct($combustee, $duration); $this->combuster = $combuster; } - /** - * @return Entity - */ public function getCombuster() : Entity{ return $this->combuster; } diff --git a/src/event/entity/EntityCombustEvent.php b/src/event/entity/EntityCombustEvent.php index 6bee08a8c..d45296ca7 100644 --- a/src/event/entity/EntityCombustEvent.php +++ b/src/event/entity/EntityCombustEvent.php @@ -33,10 +33,6 @@ class EntityCombustEvent extends EntityEvent implements Cancellable{ /** @var int */ protected $duration; - /** - * @param Entity $combustee - * @param int $duration - */ public function __construct(Entity $combustee, int $duration){ $this->entity = $combustee; $this->duration = $duration; @@ -44,7 +40,6 @@ class EntityCombustEvent extends EntityEvent implements Cancellable{ /** * Returns the duration in seconds the entity will burn for. - * @return int */ public function getDuration() : int{ return $this->duration; diff --git a/src/event/entity/EntityDamageByBlockEvent.php b/src/event/entity/EntityDamageByBlockEvent.php index 044e679ed..d6699ea13 100644 --- a/src/event/entity/EntityDamageByBlockEvent.php +++ b/src/event/entity/EntityDamageByBlockEvent.php @@ -34,10 +34,6 @@ class EntityDamageByBlockEvent extends EntityDamageEvent{ private $damager; /** - * @param Block $damager - * @param Entity $entity - * @param int $cause - * @param float $damage * @param float[] $modifiers */ public function __construct(Block $damager, Entity $entity, int $cause, float $damage, array $modifiers = []){ @@ -45,9 +41,6 @@ class EntityDamageByBlockEvent extends EntityDamageEvent{ parent::__construct($entity, $cause, $damage, $modifiers); } - /** - * @return Block - */ public function getDamager() : Block{ return $this->damager; } diff --git a/src/event/entity/EntityDamageByChildEntityEvent.php b/src/event/entity/EntityDamageByChildEntityEvent.php index ab994ad63..e3e28ab0d 100644 --- a/src/event/entity/EntityDamageByChildEntityEvent.php +++ b/src/event/entity/EntityDamageByChildEntityEvent.php @@ -33,11 +33,6 @@ class EntityDamageByChildEntityEvent extends EntityDamageByEntityEvent{ private $childEntityEid; /** - * @param Entity $damager - * @param Entity $childEntity - * @param Entity $entity - * @param int $cause - * @param float $damage * @param float[] $modifiers */ public function __construct(Entity $damager, Entity $childEntity, Entity $entity, int $cause, float $damage, array $modifiers = []){ @@ -47,8 +42,6 @@ class EntityDamageByChildEntityEvent extends EntityDamageByEntityEvent{ /** * Returns the entity which caused the damage, or null if the entity has been killed or closed. - * - * @return Entity|null */ public function getChild() : ?Entity{ return $this->getEntity()->getWorld()->getServer()->getWorldManager()->findEntity($this->childEntityEid); diff --git a/src/event/entity/EntityDamageByEntityEvent.php b/src/event/entity/EntityDamageByEntityEvent.php index 755e4e088..6774e808e 100644 --- a/src/event/entity/EntityDamageByEntityEvent.php +++ b/src/event/entity/EntityDamageByEntityEvent.php @@ -37,12 +37,7 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{ private $knockBack; /** - * @param Entity $damager - * @param Entity $entity - * @param int $cause - * @param float $damage * @param float[] $modifiers - * @param float $knockBack */ public function __construct(Entity $damager, Entity $entity, int $cause, float $damage, array $modifiers = [], float $knockBack = 0.4){ $this->damagerEntityId = $damager->getId(); @@ -66,23 +61,15 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{ /** * Returns the attacking entity, or null if the attacker has been killed or closed. - * - * @return Entity|null */ public function getDamager() : ?Entity{ return $this->getEntity()->getWorld()->getServer()->getWorldManager()->findEntity($this->damagerEntityId); } - /** - * @return float - */ public function getKnockBack() : float{ return $this->knockBack; } - /** - * @param float $knockBack - */ public function setKnockBack(float $knockBack) : void{ $this->knockBack = $knockBack; } diff --git a/src/event/entity/EntityDamageEvent.php b/src/event/entity/EntityDamageEvent.php index 2fc305977..e9390e785 100644 --- a/src/event/entity/EntityDamageEvent.php +++ b/src/event/entity/EntityDamageEvent.php @@ -76,11 +76,7 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ /** @var int */ private $attackCooldown = 10; - /** - * @param Entity $entity - * @param int $cause - * @param float $damage * @param float[] $modifiers */ public function __construct(Entity $entity, int $cause, float $damage, array $modifiers = []){ @@ -92,17 +88,12 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ $this->originals = $this->modifiers; } - /** - * @return int - */ public function getCause() : int{ return $this->cause; } /** * Returns the base amount of damage applied, before modifiers. - * - * @return float */ public function getBaseDamage() : float{ return $this->baseDamage; @@ -112,8 +103,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ * Sets the base amount of damage applied, optionally recalculating modifiers. * * TODO: add ability to recalculate modifiers when this is set - * - * @param float $damage */ public function setBaseDamage(float $damage) : void{ $this->baseDamage = $damage; @@ -121,8 +110,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ /** * Returns the original base amount of damage applied, before alterations by plugins. - * - * @return float */ public function getOriginalBaseDamage() : float{ return $this->originalBase; @@ -135,11 +122,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ return $this->originals; } - /** - * @param int $type - * - * @return float - */ public function getOriginalModifier(int $type) : float{ return $this->originals[$type] ?? 0.0; } @@ -151,42 +133,24 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ return $this->modifiers; } - /** - * @param int $type - * - * @return float - */ public function getModifier(int $type) : float{ return $this->modifiers[$type] ?? 0.0; } - /** - * @param float $damage - * @param int $type - */ public function setModifier(float $damage, int $type) : void{ $this->modifiers[$type] = $damage; } - /** - * @param int $type - * - * @return bool - */ public function isApplicable(int $type) : bool{ return isset($this->modifiers[$type]); } - /** - * @return float - */ public function getFinalDamage() : float{ return $this->baseDamage + array_sum($this->modifiers); } /** * Returns whether an entity can use armour points to reduce this type of damage. - * @return bool */ public function canBeReducedByArmor() : bool{ switch($this->cause){ @@ -207,8 +171,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ /** * Returns the cooldown in ticks before the target entity can be attacked again. - * - * @return int */ public function getAttackCooldown() : int{ return $this->attackCooldown; @@ -218,8 +180,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{ * Sets the cooldown in ticks before the target entity can be attacked again. * * NOTE: This value is not used in non-Living entities - * - * @param int $attackCooldown */ public function setAttackCooldown(int $attackCooldown) : void{ $this->attackCooldown = $attackCooldown; diff --git a/src/event/entity/EntityDeathEvent.php b/src/event/entity/EntityDeathEvent.php index aeb7e5574..4eb9953ab 100644 --- a/src/event/entity/EntityDeathEvent.php +++ b/src/event/entity/EntityDeathEvent.php @@ -33,9 +33,7 @@ class EntityDeathEvent extends EntityEvent{ private $xp; /** - * @param Living $entity * @param Item[] $drops - * @param int $xp */ public function __construct(Living $entity, array $drops = [], int $xp = 0){ $this->entity = $entity; @@ -66,15 +64,12 @@ class EntityDeathEvent extends EntityEvent{ /** * Returns how much experience is dropped due to this entity's death. - * @return int */ public function getXpDropAmount() : int{ return $this->xp; } /** - * @param int $xp - * * @throws \InvalidArgumentException */ public function setXpDropAmount(int $xp) : void{ diff --git a/src/event/entity/EntityDespawnEvent.php b/src/event/entity/EntityDespawnEvent.php index 1978f6079..7e5272575 100644 --- a/src/event/entity/EntityDespawnEvent.php +++ b/src/event/entity/EntityDespawnEvent.php @@ -30,9 +30,6 @@ use pocketmine\entity\Entity; */ class EntityDespawnEvent extends EntityEvent{ - /** - * @param Entity $entity - */ public function __construct(Entity $entity){ $this->entity = $entity; } diff --git a/src/event/entity/EntityEffectAddEvent.php b/src/event/entity/EntityEffectAddEvent.php index d8f563357..43cbb2671 100644 --- a/src/event/entity/EntityEffectAddEvent.php +++ b/src/event/entity/EntityEffectAddEvent.php @@ -34,8 +34,6 @@ class EntityEffectAddEvent extends EntityEffectEvent{ private $oldEffect; /** - * @param Entity $entity - * @param EffectInstance $effect * @param EffectInstance $oldEffect */ public function __construct(Entity $entity, EffectInstance $effect, ?EffectInstance $oldEffect = null){ @@ -45,23 +43,15 @@ class EntityEffectAddEvent extends EntityEffectEvent{ /** * Returns whether the effect addition will replace an existing effect already applied to the entity. - * - * @return bool */ public function willModify() : bool{ return $this->hasOldEffect(); } - /** - * @return bool - */ public function hasOldEffect() : bool{ return $this->oldEffect instanceof EffectInstance; } - /** - * @return EffectInstance|null - */ public function getOldEffect() : ?EffectInstance{ return $this->oldEffect; } diff --git a/src/event/entity/EntityExplodeEvent.php b/src/event/entity/EntityExplodeEvent.php index 106a6f679..a48bd8646 100644 --- a/src/event/entity/EntityExplodeEvent.php +++ b/src/event/entity/EntityExplodeEvent.php @@ -47,10 +47,7 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{ protected $yield; /** - * @param Entity $entity - * @param Position $position * @param Block[] $blocks - * @param float $yield */ public function __construct(Entity $entity, Position $position, array $blocks, float $yield){ $this->entity = $entity; @@ -59,9 +56,6 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{ $this->yield = $yield; } - /** - * @return Position - */ public function getPosition() : Position{ return $this->position; } @@ -80,16 +74,10 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{ $this->blocks = $blocks; } - /** - * @return float - */ public function getYield() : float{ return $this->yield; } - /** - * @param float $yield - */ public function setYield(float $yield) : void{ $this->yield = $yield; } diff --git a/src/event/entity/EntityMotionEvent.php b/src/event/entity/EntityMotionEvent.php index c917e0cac..1519fcf16 100644 --- a/src/event/entity/EntityMotionEvent.php +++ b/src/event/entity/EntityMotionEvent.php @@ -39,9 +39,6 @@ class EntityMotionEvent extends EntityEvent implements Cancellable{ $this->mot = $mot; } - /** - * @return Vector3 - */ public function getVector() : Vector3{ return $this->mot; } diff --git a/src/event/entity/EntityRegainHealthEvent.php b/src/event/entity/EntityRegainHealthEvent.php index 153b0fd8a..c063ea196 100644 --- a/src/event/entity/EntityRegainHealthEvent.php +++ b/src/event/entity/EntityRegainHealthEvent.php @@ -41,35 +41,22 @@ class EntityRegainHealthEvent extends EntityEvent implements Cancellable{ /** @var int */ private $reason; - - /** - * @param Entity $entity - * @param float $amount - * @param int $regainReason - */ public function __construct(Entity $entity, float $amount, int $regainReason){ $this->entity = $entity; $this->amount = $amount; $this->reason = $regainReason; } - /** - * @return float - */ public function getAmount() : float{ return $this->amount; } - /** - * @param float $amount - */ public function setAmount(float $amount) : void{ $this->amount = $amount; } /** * Returns one of the CAUSE_* constants to indicate why this regeneration occurred. - * @return int */ public function getRegainReason() : int{ return $this->reason; diff --git a/src/event/entity/EntityShootBowEvent.php b/src/event/entity/EntityShootBowEvent.php index eeded9615..d4da02e7f 100644 --- a/src/event/entity/EntityShootBowEvent.php +++ b/src/event/entity/EntityShootBowEvent.php @@ -41,12 +41,6 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{ /** @var float */ private $force; - /** - * @param Living $shooter - * @param Item $bow - * @param Projectile $projectile - * @param float $force - */ public function __construct(Living $shooter, Item $bow, Projectile $projectile, float $force){ $this->entity = $shooter; $this->bow = $bow; @@ -61,9 +55,6 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{ return $this->entity; } - /** - * @return Item - */ public function getBow() : Item{ return $this->bow; } @@ -72,16 +63,11 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{ * Returns the entity considered as the projectile in this event. * * NOTE: This might not return a Projectile if a plugin modified the target entity. - * - * @return Entity */ public function getProjectile() : Entity{ return $this->projectile; } - /** - * @param Entity $projectile - */ public function setProjectile(Entity $projectile) : void{ if($projectile !== $this->projectile){ if(count($this->projectile->getViewers()) === 0){ @@ -91,16 +77,10 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{ } } - /** - * @return float - */ public function getForce() : float{ return $this->force; } - /** - * @param float $force - */ public function setForce(float $force) : void{ $this->force = $force; } diff --git a/src/event/entity/EntitySpawnEvent.php b/src/event/entity/EntitySpawnEvent.php index e20b98dbc..7a21a5346 100644 --- a/src/event/entity/EntitySpawnEvent.php +++ b/src/event/entity/EntitySpawnEvent.php @@ -30,9 +30,6 @@ use pocketmine\entity\Entity; */ class EntitySpawnEvent extends EntityEvent{ - /** - * @param Entity $entity - */ public function __construct(Entity $entity){ $this->entity = $entity; } diff --git a/src/event/entity/EntityTeleportEvent.php b/src/event/entity/EntityTeleportEvent.php index 160b5f9b7..3c7eee6fd 100644 --- a/src/event/entity/EntityTeleportEvent.php +++ b/src/event/entity/EntityTeleportEvent.php @@ -42,23 +42,14 @@ class EntityTeleportEvent extends EntityEvent implements Cancellable{ $this->to = $to; } - /** - * @return Position - */ public function getFrom() : Position{ return $this->from; } - /** - * @return Position - */ public function getTo() : Position{ return $this->to; } - /** - * @param Position $to - */ public function setTo(Position $to) : void{ $this->to = $to; } diff --git a/src/event/entity/ExplosionPrimeEvent.php b/src/event/entity/ExplosionPrimeEvent.php index c2ecb2cf8..a37aec131 100644 --- a/src/event/entity/ExplosionPrimeEvent.php +++ b/src/event/entity/ExplosionPrimeEvent.php @@ -38,19 +38,12 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{ /** @var bool */ private $blockBreaking; - /** - * @param Entity $entity - * @param float $force - */ public function __construct(Entity $entity, float $force){ $this->entity = $entity; $this->force = $force; $this->blockBreaking = true; } - /** - * @return float - */ public function getForce() : float{ return $this->force; } @@ -59,16 +52,10 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{ $this->force = $force; } - /** - * @return bool - */ public function isBlockBreaking() : bool{ return $this->blockBreaking; } - /** - * @param bool $affectsBlocks - */ public function setBlockBreaking(bool $affectsBlocks) : void{ $this->blockBreaking = $affectsBlocks; } diff --git a/src/event/entity/ItemDespawnEvent.php b/src/event/entity/ItemDespawnEvent.php index 628c56cc8..3e3965706 100644 --- a/src/event/entity/ItemDespawnEvent.php +++ b/src/event/entity/ItemDespawnEvent.php @@ -30,9 +30,6 @@ use pocketmine\event\CancellableTrait; class ItemDespawnEvent extends EntityEvent implements Cancellable{ use CancellableTrait; - /** - * @param ItemEntity $item - */ public function __construct(ItemEntity $item){ $this->entity = $item; } diff --git a/src/event/entity/ItemSpawnEvent.php b/src/event/entity/ItemSpawnEvent.php index ed76cd062..367555037 100644 --- a/src/event/entity/ItemSpawnEvent.php +++ b/src/event/entity/ItemSpawnEvent.php @@ -27,9 +27,6 @@ use pocketmine\entity\object\ItemEntity; class ItemSpawnEvent extends EntityEvent{ - /** - * @param ItemEntity $item - */ public function __construct(ItemEntity $item){ $this->entity = $item; diff --git a/src/event/entity/ProjectileHitBlockEvent.php b/src/event/entity/ProjectileHitBlockEvent.php index 25cd856a4..d1929ed91 100644 --- a/src/event/entity/ProjectileHitBlockEvent.php +++ b/src/event/entity/ProjectileHitBlockEvent.php @@ -39,8 +39,6 @@ class ProjectileHitBlockEvent extends ProjectileHitEvent{ /** * Returns the Block struck by the projectile. * Hint: to get the block face hit, look at the RayTraceResult. - * - * @return Block */ public function getBlockHit() : Block{ return $this->blockHit; diff --git a/src/event/entity/ProjectileHitEntityEvent.php b/src/event/entity/ProjectileHitEntityEvent.php index e8508e3e5..3fe8b42b4 100644 --- a/src/event/entity/ProjectileHitEntityEvent.php +++ b/src/event/entity/ProjectileHitEntityEvent.php @@ -38,8 +38,6 @@ class ProjectileHitEntityEvent extends ProjectileHitEvent{ /** * Returns the Entity struck by the projectile. - * - * @return Entity */ public function getEntityHit() : Entity{ return $this->entityHit; diff --git a/src/event/entity/ProjectileHitEvent.php b/src/event/entity/ProjectileHitEvent.php index 17025c61b..b5a800d1c 100644 --- a/src/event/entity/ProjectileHitEvent.php +++ b/src/event/entity/ProjectileHitEvent.php @@ -33,10 +33,6 @@ abstract class ProjectileHitEvent extends EntityEvent{ /** @var RayTraceResult */ private $rayTraceResult; - /** - * @param Projectile $entity - * @param RayTraceResult $rayTraceResult - */ public function __construct(Projectile $entity, RayTraceResult $rayTraceResult){ $this->entity = $entity; $this->rayTraceResult = $rayTraceResult; @@ -52,8 +48,6 @@ abstract class ProjectileHitEvent extends EntityEvent{ /** * Returns a RayTraceResult object containing information such as the exact position struck, the AABB it hit, and * the face of the AABB that it hit. - * - * @return RayTraceResult */ public function getRayTraceResult() : RayTraceResult{ return $this->rayTraceResult; diff --git a/src/event/entity/ProjectileLaunchEvent.php b/src/event/entity/ProjectileLaunchEvent.php index f7355131d..eaf2dcef3 100644 --- a/src/event/entity/ProjectileLaunchEvent.php +++ b/src/event/entity/ProjectileLaunchEvent.php @@ -30,9 +30,6 @@ use pocketmine\event\CancellableTrait; class ProjectileLaunchEvent extends EntityEvent implements Cancellable{ use CancellableTrait; - /** - * @param Projectile $entity - */ public function __construct(Projectile $entity){ $this->entity = $entity; } diff --git a/src/event/inventory/CraftItemEvent.php b/src/event/inventory/CraftItemEvent.php index 54c6cb5e1..63773158a 100644 --- a/src/event/inventory/CraftItemEvent.php +++ b/src/event/inventory/CraftItemEvent.php @@ -46,9 +46,6 @@ class CraftItemEvent extends Event implements Cancellable{ private $outputs; /** - * @param CraftingTransaction $transaction - * @param CraftingRecipe $recipe - * @param int $repetitions * @param Item[] $inputs * @param Item[] $outputs */ @@ -62,8 +59,6 @@ class CraftItemEvent extends Event implements Cancellable{ /** * Returns the inventory transaction involved in this crafting event. - * - * @return CraftingTransaction */ public function getTransaction() : CraftingTransaction{ return $this->transaction; @@ -71,8 +66,6 @@ class CraftItemEvent extends Event implements Cancellable{ /** * Returns the recipe crafted. - * - * @return CraftingRecipe */ public function getRecipe() : CraftingRecipe{ return $this->recipe; @@ -81,8 +74,6 @@ class CraftItemEvent extends Event implements Cancellable{ /** * Returns the number of times the recipe was crafted. This is usually 1, but might be more in the case of recipe * book shift-clicks (which craft lots of items in a batch). - * - * @return int */ public function getRepetitions() : int{ return $this->repetitions; @@ -106,9 +97,6 @@ class CraftItemEvent extends Event implements Cancellable{ return $this->outputs; } - /** - * @return Player - */ public function getPlayer() : Player{ return $this->transaction->getSource(); } diff --git a/src/event/inventory/FurnaceBurnEvent.php b/src/event/inventory/FurnaceBurnEvent.php index 31d69f895..32cc7efb8 100644 --- a/src/event/inventory/FurnaceBurnEvent.php +++ b/src/event/inventory/FurnaceBurnEvent.php @@ -41,11 +41,6 @@ class FurnaceBurnEvent extends BlockEvent implements Cancellable{ /** @var bool */ private $burning = true; - /** - * @param Furnace $furnace - * @param Item $fuel - * @param int $burnTime - */ public function __construct(Furnace $furnace, Item $fuel, int $burnTime){ parent::__construct($furnace->getBlock()); $this->fuel = $fuel; @@ -53,44 +48,26 @@ class FurnaceBurnEvent extends BlockEvent implements Cancellable{ $this->furnace = $furnace; } - /** - * @return Furnace - */ public function getFurnace() : Furnace{ return $this->furnace; } - /** - * @return Item - */ public function getFuel() : Item{ return $this->fuel; } - /** - * @return int - */ public function getBurnTime() : int{ return $this->burnTime; } - /** - * @param int $burnTime - */ public function setBurnTime(int $burnTime) : void{ $this->burnTime = $burnTime; } - /** - * @return bool - */ public function isBurning() : bool{ return $this->burning; } - /** - * @param bool $burning - */ public function setBurning(bool $burning) : void{ $this->burning = $burning; } diff --git a/src/event/inventory/FurnaceSmeltEvent.php b/src/event/inventory/FurnaceSmeltEvent.php index 5fb1f8be9..cb2b5d828 100644 --- a/src/event/inventory/FurnaceSmeltEvent.php +++ b/src/event/inventory/FurnaceSmeltEvent.php @@ -39,11 +39,6 @@ class FurnaceSmeltEvent extends BlockEvent implements Cancellable{ /** @var Item */ private $result; - /** - * @param Furnace $furnace - * @param Item $source - * @param Item $result - */ public function __construct(Furnace $furnace, Item $source, Item $result){ parent::__construct($furnace->getBlock()); $this->source = clone $source; @@ -52,30 +47,18 @@ class FurnaceSmeltEvent extends BlockEvent implements Cancellable{ $this->furnace = $furnace; } - /** - * @return Furnace - */ public function getFurnace() : Furnace{ return $this->furnace; } - /** - * @return Item - */ public function getSource() : Item{ return $this->source; } - /** - * @return Item - */ public function getResult() : Item{ return $this->result; } - /** - * @param Item $result - */ public function setResult(Item $result) : void{ $this->result = $result; } diff --git a/src/event/inventory/InventoryCloseEvent.php b/src/event/inventory/InventoryCloseEvent.php index f123fc497..1ea65234d 100644 --- a/src/event/inventory/InventoryCloseEvent.php +++ b/src/event/inventory/InventoryCloseEvent.php @@ -30,18 +30,11 @@ class InventoryCloseEvent extends InventoryEvent{ /** @var Player */ private $who; - /** - * @param Inventory $inventory - * @param Player $who - */ public function __construct(Inventory $inventory, Player $who){ $this->who = $who; parent::__construct($inventory); } - /** - * @return Player - */ public function getPlayer() : Player{ return $this->who; } diff --git a/src/event/inventory/InventoryEvent.php b/src/event/inventory/InventoryEvent.php index 7c103e1a8..7c00c35fe 100644 --- a/src/event/inventory/InventoryEvent.php +++ b/src/event/inventory/InventoryEvent.php @@ -38,9 +38,6 @@ abstract class InventoryEvent extends Event{ $this->inventory = $inventory; } - /** - * @return Inventory - */ public function getInventory() : Inventory{ return $this->inventory; } diff --git a/src/event/inventory/InventoryOpenEvent.php b/src/event/inventory/InventoryOpenEvent.php index 1eb43eb74..ee5c13eb5 100644 --- a/src/event/inventory/InventoryOpenEvent.php +++ b/src/event/inventory/InventoryOpenEvent.php @@ -34,18 +34,11 @@ class InventoryOpenEvent extends InventoryEvent implements Cancellable{ /** @var Player */ private $who; - /** - * @param Inventory $inventory - * @param Player $who - */ public function __construct(Inventory $inventory, Player $who){ $this->who = $who; parent::__construct($inventory); } - /** - * @return Player - */ public function getPlayer() : Player{ return $this->who; } diff --git a/src/event/inventory/InventoryPickupArrowEvent.php b/src/event/inventory/InventoryPickupArrowEvent.php index 058c6be92..1c4d2772d 100644 --- a/src/event/inventory/InventoryPickupArrowEvent.php +++ b/src/event/inventory/InventoryPickupArrowEvent.php @@ -34,18 +34,11 @@ class InventoryPickupArrowEvent extends InventoryEvent implements Cancellable{ /** @var Arrow */ private $arrow; - /** - * @param Inventory $inventory - * @param Arrow $arrow - */ public function __construct(Inventory $inventory, Arrow $arrow){ $this->arrow = $arrow; parent::__construct($inventory); } - /** - * @return Arrow - */ public function getArrow() : Arrow{ return $this->arrow; } diff --git a/src/event/inventory/InventoryPickupItemEvent.php b/src/event/inventory/InventoryPickupItemEvent.php index 60ead87c7..ed15bbbe1 100644 --- a/src/event/inventory/InventoryPickupItemEvent.php +++ b/src/event/inventory/InventoryPickupItemEvent.php @@ -34,18 +34,11 @@ class InventoryPickupItemEvent extends InventoryEvent implements Cancellable{ /** @var ItemEntity */ private $item; - /** - * @param Inventory $inventory - * @param ItemEntity $item - */ public function __construct(Inventory $inventory, ItemEntity $item){ $this->item = $item; parent::__construct($inventory); } - /** - * @return ItemEntity - */ public function getItem() : ItemEntity{ return $this->item; } diff --git a/src/event/inventory/InventoryTransactionEvent.php b/src/event/inventory/InventoryTransactionEvent.php index 34f02ee24..7ec8c9023 100644 --- a/src/event/inventory/InventoryTransactionEvent.php +++ b/src/event/inventory/InventoryTransactionEvent.php @@ -38,16 +38,10 @@ class InventoryTransactionEvent extends Event implements Cancellable{ /** @var InventoryTransaction */ private $transaction; - /** - * @param InventoryTransaction $transaction - */ public function __construct(InventoryTransaction $transaction){ $this->transaction = $transaction; } - /** - * @return InventoryTransaction - */ public function getTransaction() : InventoryTransaction{ return $this->transaction; } diff --git a/src/event/player/PlayerBedEnterEvent.php b/src/event/player/PlayerBedEnterEvent.php index c25c28e26..a9e571c6f 100644 --- a/src/event/player/PlayerBedEnterEvent.php +++ b/src/event/player/PlayerBedEnterEvent.php @@ -39,9 +39,6 @@ class PlayerBedEnterEvent extends PlayerEvent implements Cancellable{ $this->bed = $bed; } - /** - * @return Block - */ public function getBed() : Block{ return $this->bed; } diff --git a/src/event/player/PlayerBedLeaveEvent.php b/src/event/player/PlayerBedLeaveEvent.php index 0231edd36..7efe02673 100644 --- a/src/event/player/PlayerBedLeaveEvent.php +++ b/src/event/player/PlayerBedLeaveEvent.php @@ -35,9 +35,6 @@ class PlayerBedLeaveEvent extends PlayerEvent{ $this->bed = $bed; } - /** - * @return Block - */ public function getBed() : Block{ return $this->bed; } diff --git a/src/event/player/PlayerBucketEvent.php b/src/event/player/PlayerBucketEvent.php index 1080b533f..3cea82242 100644 --- a/src/event/player/PlayerBucketEvent.php +++ b/src/event/player/PlayerBucketEvent.php @@ -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; } diff --git a/src/event/player/PlayerChangeSkinEvent.php b/src/event/player/PlayerChangeSkinEvent.php index 0aa380244..51fde74a3 100644 --- a/src/event/player/PlayerChangeSkinEvent.php +++ b/src/event/player/PlayerChangeSkinEvent.php @@ -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{ diff --git a/src/event/player/PlayerChatEvent.php b/src/event/player/PlayerChatEvent.php index b5ee99ac4..a7b7162f2 100644 --- a/src/event/player/PlayerChatEvent.php +++ b/src/event/player/PlayerChatEvent.php @@ -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; } diff --git a/src/event/player/PlayerCommandPreprocessEvent.php b/src/event/player/PlayerCommandPreprocessEvent.php index 1831e1d19..f1fae9665 100644 --- a/src/event/player/PlayerCommandPreprocessEvent.php +++ b/src/event/player/PlayerCommandPreprocessEvent.php @@ -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; } diff --git a/src/event/player/PlayerCreationEvent.php b/src/event/player/PlayerCreationEvent.php index 28f8290be..f9ed28807 100644 --- a/src/event/player/PlayerCreationEvent.php +++ b/src/event/player/PlayerCreationEvent.php @@ -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(); } diff --git a/src/event/player/PlayerDataSaveEvent.php b/src/event/player/PlayerDataSaveEvent.php index 5f08d4fb4..ad49aba2b 100644 --- a/src/event/player/PlayerDataSaveEvent.php +++ b/src/event/player/PlayerDataSaveEvent.php @@ -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; diff --git a/src/event/player/PlayerDeathEvent.php b/src/event/player/PlayerDeathEvent.php index 303591777..e28c643d1 100644 --- a/src/event/player/PlayerDeathEvent.php +++ b/src/event/player/PlayerDeathEvent.php @@ -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"; diff --git a/src/event/player/PlayerDropItemEvent.php b/src/event/player/PlayerDropItemEvent.php index 46a88ec9e..a97a6f5fa 100644 --- a/src/event/player/PlayerDropItemEvent.php +++ b/src/event/player/PlayerDropItemEvent.php @@ -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; } diff --git a/src/event/player/PlayerDuplicateLoginEvent.php b/src/event/player/PlayerDuplicateLoginEvent.php index d77f6fc4c..92fc34547 100644 --- a/src/event/player/PlayerDuplicateLoginEvent.php +++ b/src/event/player/PlayerDuplicateLoginEvent.php @@ -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; } diff --git a/src/event/player/PlayerEditBookEvent.php b/src/event/player/PlayerEditBookEvent.php index 074bf3f13..ed5c03706 100644 --- a/src/event/player/PlayerEditBookEvent.php +++ b/src/event/player/PlayerEditBookEvent.php @@ -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; diff --git a/src/event/player/PlayerExhaustEvent.php b/src/event/player/PlayerExhaustEvent.php index 91ab4caea..0002d8d82 100644 --- a/src/event/player/PlayerExhaustEvent.php +++ b/src/event/player/PlayerExhaustEvent.php @@ -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; diff --git a/src/event/player/PlayerExperienceChangeEvent.php b/src/event/player/PlayerExperienceChangeEvent.php index 56197678c..86d0b085b 100644 --- a/src/event/player/PlayerExperienceChangeEvent.php +++ b/src/event/player/PlayerExperienceChangeEvent.php @@ -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; } diff --git a/src/event/player/PlayerInteractEvent.php b/src/event/player/PlayerInteractEvent.php index 3d01955fc..f67b72d9c 100644 --- a/src/event/player/PlayerInteractEvent.php +++ b/src/event/player/PlayerInteractEvent.php @@ -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; } diff --git a/src/event/player/PlayerItemConsumeEvent.php b/src/event/player/PlayerItemConsumeEvent.php index f08a5847f..52bb5e243 100644 --- a/src/event/player/PlayerItemConsumeEvent.php +++ b/src/event/player/PlayerItemConsumeEvent.php @@ -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; } diff --git a/src/event/player/PlayerItemHeldEvent.php b/src/event/player/PlayerItemHeldEvent.php index 7fbd3f4cc..71f55fc53 100644 --- a/src/event/player/PlayerItemHeldEvent.php +++ b/src/event/player/PlayerItemHeldEvent.php @@ -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; diff --git a/src/event/player/PlayerItemUseEvent.php b/src/event/player/PlayerItemUseEvent.php index ec804115a..b9216d528 100644 --- a/src/event/player/PlayerItemUseEvent.php +++ b/src/event/player/PlayerItemUseEvent.php @@ -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; diff --git a/src/event/player/PlayerJoinEvent.php b/src/event/player/PlayerJoinEvent.php index 64b7a6c2d..57e77ccdb 100644 --- a/src/event/player/PlayerJoinEvent.php +++ b/src/event/player/PlayerJoinEvent.php @@ -40,7 +40,6 @@ class PlayerJoinEvent extends PlayerEvent{ /** * PlayerJoinEvent constructor. * - * @param Player $player * @param TextContainer|string $joinMessage */ public function __construct(Player $player, $joinMessage){ diff --git a/src/event/player/PlayerJumpEvent.php b/src/event/player/PlayerJumpEvent.php index e3e67da38..3d9b6d167 100644 --- a/src/event/player/PlayerJumpEvent.php +++ b/src/event/player/PlayerJumpEvent.php @@ -32,8 +32,6 @@ class PlayerJumpEvent extends PlayerEvent{ /** * PlayerJumpEvent constructor. - * - * @param Player $player */ public function __construct(Player $player){ $this->player = $player; diff --git a/src/event/player/PlayerKickEvent.php b/src/event/player/PlayerKickEvent.php index 971269c2c..dd78ba63a 100644 --- a/src/event/player/PlayerKickEvent.php +++ b/src/event/player/PlayerKickEvent.php @@ -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; } diff --git a/src/event/player/PlayerLoginEvent.php b/src/event/player/PlayerLoginEvent.php index 979750090..8c418f703 100644 --- a/src/event/player/PlayerLoginEvent.php +++ b/src/event/player/PlayerLoginEvent.php @@ -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; } diff --git a/src/event/player/PlayerMoveEvent.php b/src/event/player/PlayerMoveEvent.php index dbcf92bcf..d9f258a3c 100644 --- a/src/event/player/PlayerMoveEvent.php +++ b/src/event/player/PlayerMoveEvent.php @@ -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; } diff --git a/src/event/player/PlayerPreLoginEvent.php b/src/event/player/PlayerPreLoginEvent.php index 9a566813e..03a6d2b85 100644 --- a/src/event/player/PlayerPreLoginEvent.php +++ b/src/event/player/PlayerPreLoginEvent.php @@ -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){ diff --git a/src/event/player/PlayerQuitEvent.php b/src/event/player/PlayerQuitEvent.php index 028548b15..4fe6bf71f 100644 --- a/src/event/player/PlayerQuitEvent.php +++ b/src/event/player/PlayerQuitEvent.php @@ -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; } diff --git a/src/event/player/PlayerRespawnEvent.php b/src/event/player/PlayerRespawnEvent.php index 926da5e17..8933aaeb5 100644 --- a/src/event/player/PlayerRespawnEvent.php +++ b/src/event/player/PlayerRespawnEvent.php @@ -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; } diff --git a/src/event/player/PlayerToggleFlightEvent.php b/src/event/player/PlayerToggleFlightEvent.php index 1547e7ed2..b8c0f93d9 100644 --- a/src/event/player/PlayerToggleFlightEvent.php +++ b/src/event/player/PlayerToggleFlightEvent.php @@ -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; } diff --git a/src/event/player/PlayerToggleSneakEvent.php b/src/event/player/PlayerToggleSneakEvent.php index 14dd0d4fe..0b7538975 100644 --- a/src/event/player/PlayerToggleSneakEvent.php +++ b/src/event/player/PlayerToggleSneakEvent.php @@ -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; } diff --git a/src/event/player/PlayerToggleSprintEvent.php b/src/event/player/PlayerToggleSprintEvent.php index 67bae1424..2da14d7b7 100644 --- a/src/event/player/PlayerToggleSprintEvent.php +++ b/src/event/player/PlayerToggleSprintEvent.php @@ -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; } diff --git a/src/event/player/PlayerTransferEvent.php b/src/event/player/PlayerTransferEvent.php index 082dd619b..9e6669893 100644 --- a/src/event/player/PlayerTransferEvent.php +++ b/src/event/player/PlayerTransferEvent.php @@ -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; } diff --git a/src/event/plugin/PluginEvent.php b/src/event/plugin/PluginEvent.php index 2263d78f5..82faa0638 100644 --- a/src/event/plugin/PluginEvent.php +++ b/src/event/plugin/PluginEvent.php @@ -37,9 +37,6 @@ abstract class PluginEvent extends Event{ $this->plugin = $plugin; } - /** - * @return Plugin - */ public function getPlugin() : Plugin{ return $this->plugin; } diff --git a/src/event/server/CommandEvent.php b/src/event/server/CommandEvent.php index 95f1cca6a..818a465cb 100644 --- a/src/event/server/CommandEvent.php +++ b/src/event/server/CommandEvent.php @@ -44,32 +44,19 @@ class CommandEvent extends ServerEvent implements Cancellable{ /** @var CommandSender */ protected $sender; - /** - * @param CommandSender $sender - * @param string $command - */ public function __construct(CommandSender $sender, string $command){ $this->sender = $sender; $this->command = $command; } - /** - * @return CommandSender - */ public function getSender() : CommandSender{ return $this->sender; } - /** - * @return string - */ public function getCommand() : string{ return $this->command; } - /** - * @param string $command - */ public function setCommand(string $command) : void{ $this->command = $command; } diff --git a/src/event/server/DataPacketReceiveEvent.php b/src/event/server/DataPacketReceiveEvent.php index 7b25a28c7..c3443d206 100644 --- a/src/event/server/DataPacketReceiveEvent.php +++ b/src/event/server/DataPacketReceiveEvent.php @@ -36,25 +36,15 @@ class DataPacketReceiveEvent extends ServerEvent implements Cancellable{ /** @var NetworkSession */ private $origin; - /** - * @param NetworkSession $origin - * @param ServerboundPacket $packet - */ public function __construct(NetworkSession $origin, ServerboundPacket $packet){ $this->packet = $packet; $this->origin = $origin; } - /** - * @return ServerboundPacket - */ public function getPacket() : ServerboundPacket{ return $this->packet; } - /** - * @return NetworkSession - */ public function getOrigin() : NetworkSession{ return $this->origin; } diff --git a/src/event/server/LowMemoryEvent.php b/src/event/server/LowMemoryEvent.php index aaaaded62..ecdfb2f46 100644 --- a/src/event/server/LowMemoryEvent.php +++ b/src/event/server/LowMemoryEvent.php @@ -49,8 +49,6 @@ class LowMemoryEvent extends ServerEvent{ /** * Returns the memory usage at the time of the event call (in bytes) - * - * @return int */ public function getMemory() : int{ return $this->memory; @@ -58,8 +56,6 @@ class LowMemoryEvent extends ServerEvent{ /** * Returns the memory limit defined (in bytes) - * - * @return int */ public function getMemoryLimit() : int{ return $this->memoryLimit; @@ -67,24 +63,17 @@ class LowMemoryEvent extends ServerEvent{ /** * Returns the times this event has been called in the current low-memory state - * - * @return int */ public function getTriggerCount() : int{ return $this->triggerCount; } - /** - * @return bool - */ public function isGlobal() : bool{ return $this->global; } /** * Amount of memory already freed - * - * @return int */ public function getMemoryFreed() : int{ return $this->getMemory() - ($this->isGlobal() ? Process::getMemoryUsage(true)[1] : Process::getMemoryUsage(true)[0]); diff --git a/src/event/server/NetworkInterfaceEvent.php b/src/event/server/NetworkInterfaceEvent.php index f6ed969c6..98f48f07d 100644 --- a/src/event/server/NetworkInterfaceEvent.php +++ b/src/event/server/NetworkInterfaceEvent.php @@ -29,16 +29,10 @@ class NetworkInterfaceEvent extends ServerEvent{ /** @var NetworkInterface */ protected $interface; - /** - * @param NetworkInterface $interface - */ public function __construct(NetworkInterface $interface){ $this->interface = $interface; } - /** - * @return NetworkInterface - */ public function getInterface() : NetworkInterface{ return $this->interface; } diff --git a/src/event/server/QueryRegenerateEvent.php b/src/event/server/QueryRegenerateEvent.php index fc007edca..d86101da5 100644 --- a/src/event/server/QueryRegenerateEvent.php +++ b/src/event/server/QueryRegenerateEvent.php @@ -71,10 +71,6 @@ class QueryRegenerateEvent extends ServerEvent{ /** @var string|null */ private $shortQueryCache = null; - - /** - * @param Server $server - */ public function __construct(Server $server){ $this->serverName = $server->getMotd(); $this->listPlugins = $server->getProperty("settings.query-plugins", true); @@ -99,31 +95,19 @@ class QueryRegenerateEvent extends ServerEvent{ $this->shortQueryCache = null; } - /** - * @return string - */ public function getServerName() : string{ return $this->serverName; } - /** - * @param string $serverName - */ public function setServerName(string $serverName) : void{ $this->serverName = $serverName; $this->destroyCache(); } - /** - * @return bool - */ public function canListPlugins() : bool{ return $this->listPlugins; } - /** - * @param bool $value - */ public function setListPlugins(bool $value) : void{ $this->listPlugins = $value; $this->destroyCache(); @@ -159,46 +143,28 @@ class QueryRegenerateEvent extends ServerEvent{ $this->destroyCache(); } - /** - * @return int - */ public function getPlayerCount() : int{ return $this->numPlayers; } - /** - * @param int $count - */ public function setPlayerCount(int $count) : void{ $this->numPlayers = $count; $this->destroyCache(); } - /** - * @return int - */ public function getMaxPlayerCount() : int{ return $this->maxPlayers; } - /** - * @param int $count - */ public function setMaxPlayerCount(int $count) : void{ $this->maxPlayers = $count; $this->destroyCache(); } - /** - * @return string - */ public function getWorld() : string{ return $this->map; } - /** - * @param string $world - */ public function setWorld(string $world) : void{ $this->map = $world; $this->destroyCache(); @@ -206,24 +172,16 @@ class QueryRegenerateEvent extends ServerEvent{ /** * Returns the extra Query data in key => value form - * - * @return array */ public function getExtraData() : array{ return $this->extraData; } - /** - * @param array $extraData - */ public function setExtraData(array $extraData) : void{ $this->extraData = $extraData; $this->destroyCache(); } - /** - * @return string - */ public function getLongQuery() : string{ if($this->longQueryCache !== null){ return $this->longQueryCache; @@ -273,9 +231,6 @@ class QueryRegenerateEvent extends ServerEvent{ return $this->longQueryCache = $query; } - /** - * @return string - */ public function getShortQuery() : string{ return $this->shortQueryCache ?? ($this->shortQueryCache = $this->serverName . "\x00" . $this->gametype . "\x00" . $this->map . "\x00" . $this->numPlayers . "\x00" . $this->maxPlayers . "\x00" . Binary::writeLShort($this->port) . $this->ip . "\x00"); } diff --git a/src/event/world/ChunkEvent.php b/src/event/world/ChunkEvent.php index 993e77d25..02db808e2 100644 --- a/src/event/world/ChunkEvent.php +++ b/src/event/world/ChunkEvent.php @@ -34,18 +34,11 @@ abstract class ChunkEvent extends WorldEvent{ /** @var Chunk */ private $chunk; - /** - * @param World $world - * @param Chunk $chunk - */ public function __construct(World $world, Chunk $chunk){ parent::__construct($world); $this->chunk = $chunk; } - /** - * @return Chunk - */ public function getChunk() : Chunk{ return $this->chunk; } diff --git a/src/event/world/ChunkLoadEvent.php b/src/event/world/ChunkLoadEvent.php index 575bf74cf..3e6dad408 100644 --- a/src/event/world/ChunkLoadEvent.php +++ b/src/event/world/ChunkLoadEvent.php @@ -39,9 +39,6 @@ class ChunkLoadEvent extends ChunkEvent{ $this->newChunk = $newChunk; } - /** - * @return bool - */ public function isNewChunk() : bool{ return $this->newChunk; } diff --git a/src/event/world/SpawnChangeEvent.php b/src/event/world/SpawnChangeEvent.php index 208856859..dba959a64 100644 --- a/src/event/world/SpawnChangeEvent.php +++ b/src/event/world/SpawnChangeEvent.php @@ -34,18 +34,11 @@ class SpawnChangeEvent extends WorldEvent{ /** @var Position */ private $previousSpawn; - /** - * @param World $world - * @param Position $previousSpawn - */ public function __construct(World $world, Position $previousSpawn){ parent::__construct($world); $this->previousSpawn = $previousSpawn; } - /** - * @return Position - */ public function getPreviousSpawn() : Position{ return $this->previousSpawn; } diff --git a/src/event/world/WorldEvent.php b/src/event/world/WorldEvent.php index 193a0d8e1..c842825ae 100644 --- a/src/event/world/WorldEvent.php +++ b/src/event/world/WorldEvent.php @@ -33,16 +33,10 @@ abstract class WorldEvent extends Event{ /** @var World */ private $world; - /** - * @param World $world - */ public function __construct(World $world){ $this->world = $world; } - /** - * @return World - */ public function getWorld() : World{ return $this->world; } diff --git a/src/form/Form.php b/src/form/Form.php index 1e6b43dd7..2598349f6 100644 --- a/src/form/Form.php +++ b/src/form/Form.php @@ -34,7 +34,6 @@ interface Form extends \JsonSerializable{ /** * Handles a form response from a player. * - * @param Player $player * @param mixed $data * * @throws FormValidationException if the data could not be processed diff --git a/src/inventory/BaseInventory.php b/src/inventory/BaseInventory.php index 888d4a7b3..e03415e9c 100644 --- a/src/inventory/BaseInventory.php +++ b/src/inventory/BaseInventory.php @@ -43,16 +43,12 @@ abstract class BaseInventory implements Inventory{ /** @var InventoryChangeListener[] */ protected $listeners = []; - /** - * @param int $size - */ public function __construct(int $size){ $this->slots = new \SplFixedArray($size); } /** * Returns the size of the inventory. - * @return int */ public function getSize() : int{ return $this->slots->getSize(); @@ -67,8 +63,6 @@ abstract class BaseInventory implements Inventory{ } /** - * @param bool $includeEmpty - * * @return Item[] */ public function getContents(bool $includeEmpty = false) : array{ @@ -87,7 +81,6 @@ abstract class BaseInventory implements Inventory{ /** * @param Item[] $items - * @param bool $send */ public function setContents(array $items, bool $send = true) : void{ if(count($items) > $this->getSize()){ diff --git a/src/inventory/ChestInventory.php b/src/inventory/ChestInventory.php index 49235d444..bf1d3fed4 100644 --- a/src/inventory/ChestInventory.php +++ b/src/inventory/ChestInventory.php @@ -33,9 +33,6 @@ use function count; class ChestInventory extends BlockInventory{ - /** - * @param Position $holder - */ public function __construct(Position $holder){ parent::__construct($holder, 27); } diff --git a/src/inventory/CreativeInventory.php b/src/inventory/CreativeInventory.php index d157d79fb..45bee9f97 100644 --- a/src/inventory/CreativeInventory.php +++ b/src/inventory/CreativeInventory.php @@ -67,11 +67,6 @@ final class CreativeInventory{ return self::$creative; } - /** - * @param int $index - * - * @return Item|null - */ public static function getItem(int $index) : ?Item{ return self::$creative[$index] ?? null; } @@ -89,8 +84,6 @@ final class CreativeInventory{ /** * Adds an item to the creative menu. * Note: Players who are already online when this is called will not see this change. - * - * @param Item $item */ public static function add(Item $item) : void{ self::$creative[] = clone $item; @@ -99,8 +92,6 @@ final class CreativeInventory{ /** * Removes an item from the creative menu. * Note: Players who are already online when this is called will not see this change. - * - * @param Item $item */ public static function remove(Item $item) : void{ $index = self::getItemIndex($item); diff --git a/src/inventory/DoubleChestInventory.php b/src/inventory/DoubleChestInventory.php index 273e04c2a..2f607f06a 100644 --- a/src/inventory/DoubleChestInventory.php +++ b/src/inventory/DoubleChestInventory.php @@ -87,16 +87,10 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{ parent::onClose($who); } - /** - * @return ChestInventory - */ public function getLeftSide() : ChestInventory{ return $this->left; } - /** - * @return ChestInventory - */ public function getRightSide() : ChestInventory{ return $this->right; } diff --git a/src/inventory/EnderChestInventory.php b/src/inventory/EnderChestInventory.php index 935ee7fe7..bd9a448f2 100644 --- a/src/inventory/EnderChestInventory.php +++ b/src/inventory/EnderChestInventory.php @@ -34,9 +34,6 @@ class EnderChestInventory extends ChestInventory{ parent::__construct(new Position(0, 0, 0, null)); } - /** - * @param Position $pos - */ public function setHolderPosition(Position $pos) : void{ $this->holder = $pos->asPosition(); } diff --git a/src/inventory/FurnaceInventory.php b/src/inventory/FurnaceInventory.php index b04620dd9..c68111120 100644 --- a/src/inventory/FurnaceInventory.php +++ b/src/inventory/FurnaceInventory.php @@ -32,44 +32,26 @@ class FurnaceInventory extends BlockInventory{ parent::__construct($holder, 3); } - /** - * @return Item - */ public function getResult() : Item{ return $this->getItem(2); } - /** - * @return Item - */ public function getFuel() : Item{ return $this->getItem(1); } - /** - * @return Item - */ public function getSmelting() : Item{ return $this->getItem(0); } - /** - * @param Item $item - */ public function setResult(Item $item) : void{ $this->setItem(2, $item); } - /** - * @param Item $item - */ public function setFuel(Item $item) : void{ $this->setItem(1, $item); } - /** - * @param Item $item - */ public function setSmelting(Item $item) : void{ $this->setItem(0, $item); } diff --git a/src/inventory/Inventory.php b/src/inventory/Inventory.php index 0224ba4cf..f8bdd9f1d 100644 --- a/src/inventory/Inventory.php +++ b/src/inventory/Inventory.php @@ -32,34 +32,16 @@ use pocketmine\player\Player; interface Inventory{ public const MAX_STACK = 64; - /** - * @return int - */ public function getSize() : int; - /** - * @return int - */ public function getMaxStackSize() : int; - /** - * @param int $size - */ public function setMaxStackSize(int $size) : void; - /** - * @param int $index - * - * @return Item - */ public function getItem(int $index) : Item; /** * Puts an Item in a slot. - * - * @param int $index - * @param Item $item - * @param bool $send */ public function setItem(int $index, Item $item, bool $send = true) : void; @@ -77,10 +59,6 @@ interface Inventory{ /** * Checks if a given Item can be added to the inventory - * - * @param Item $item - * - * @return bool */ public function canAddItem(Item $item) : bool; @@ -95,25 +73,18 @@ interface Inventory{ public function removeItem(Item ...$slots) : array; /** - * @param bool $includeEmpty - * * @return Item[] */ public function getContents(bool $includeEmpty = false) : array; /** * @param Item[] $items - * @param bool $send */ public function setContents(array $items, bool $send = true) : void; /** * Checks if the inventory contains any Item with the same material data. * It will check id, amount, and metadata (if not null) - * - * @param Item $item - * - * @return bool */ public function contains(Item $item) : bool; @@ -121,8 +92,6 @@ interface Inventory{ * Will return all the Items that has the same id and metadata (if not null). * Won't check amount * - * @param Item $item - * * @return Item[] */ public function all(Item $item) : array; @@ -132,57 +101,36 @@ interface Inventory{ * and count >= to the count of the specified item stack. * * If $exact is true, only items with equal ID, damage, NBT and count will match. - * - * @param Item $item - * @param bool $exact - * - * @return int */ public function first(Item $item, bool $exact = false) : int; /** * Returns the first empty slot, or -1 if not found - * - * @return int */ public function firstEmpty() : int; /** * Returns whether the given slot is empty. - * - * @param int $index - * - * @return bool */ public function isSlotEmpty(int $index) : bool; /** * Will remove all the Items that has the same id and metadata (if not null) - * - * @param Item $item */ public function remove(Item $item) : void; /** * Will clear a specific slot - * - * @param int $index - * @param bool $send */ public function clear(int $index, bool $send = true) : void; /** * Clears all the slots - * - * @param bool $send */ public function clearAll(bool $send = true) : void; /** * Swaps the specified slots. - * - * @param int $slot1 - * @param int $slot2 */ public function swap(int $slot1, int $slot2) : void; @@ -196,8 +144,6 @@ interface Inventory{ /** * Called when a player opens this inventory. - * - * @param Player $who */ public function onOpen(Player $who) : void; @@ -205,10 +151,6 @@ interface Inventory{ /** * Returns whether the specified slot exists in the inventory. - * - * @param int $slot - * - * @return bool */ public function slotExists(int $slot) : bool; diff --git a/src/inventory/PlayerInventory.php b/src/inventory/PlayerInventory.php index 493d4d8a9..50d929673 100644 --- a/src/inventory/PlayerInventory.php +++ b/src/inventory/PlayerInventory.php @@ -35,9 +35,6 @@ class PlayerInventory extends BaseInventory{ /** @var int */ protected $itemInHandIndex = 0; - /** - * @param Human $player - */ public function __construct(Human $player){ $this->holder = $player; parent::__construct(36); @@ -48,8 +45,6 @@ class PlayerInventory extends BaseInventory{ } /** - * @param int $slot - * * @throws \InvalidArgumentException */ private function throwIfNotHotbarSlot(int $slot) : void{ @@ -61,10 +56,6 @@ class PlayerInventory extends BaseInventory{ /** * Returns the item in the specified hotbar slot. * - * @param int $hotbarSlot - * - * @return Item - * * @throws \InvalidArgumentException if the hotbar slot index is out of range */ public function getHotbarSlotItem(int $hotbarSlot) : Item{ @@ -74,7 +65,6 @@ class PlayerInventory extends BaseInventory{ /** * Returns the hotbar slot number the holder is currently holding. - * @return int */ public function getHeldItemIndex() : int{ return $this->itemInHandIndex; @@ -104,8 +94,6 @@ class PlayerInventory extends BaseInventory{ /** * Returns the currently-held item. - * - * @return Item */ public function getItemInHand() : Item{ return $this->getHotbarSlotItem($this->itemInHandIndex); @@ -113,8 +101,6 @@ class PlayerInventory extends BaseInventory{ /** * Sets the item in the currently-held slot to the specified item. - * - * @param Item $item */ public function setItemInHand(Item $item) : void{ $this->setItem($this->getHeldItemIndex(), $item); @@ -125,7 +111,6 @@ class PlayerInventory extends BaseInventory{ /** * Returns the number of slots in the hotbar. - * @return int */ public function getHotbarSize() : int{ return 9; diff --git a/src/inventory/transaction/CraftingTransaction.php b/src/inventory/transaction/CraftingTransaction.php index 5a19fcd61..da7178ee9 100644 --- a/src/inventory/transaction/CraftingTransaction.php +++ b/src/inventory/transaction/CraftingTransaction.php @@ -61,10 +61,7 @@ class CraftingTransaction extends InventoryTransaction{ /** * @param Item[] $txItems * @param Item[] $recipeItems - * @param bool $wildcards - * @param int $iterations * - * @return int * @throws TransactionValidationException */ protected function matchRecipeItems(array $txItems, array $recipeItems, bool $wildcards, int $iterations = 0) : int{ diff --git a/src/inventory/transaction/InventoryTransaction.php b/src/inventory/transaction/InventoryTransaction.php index 31bb9dc9e..43b247261 100644 --- a/src/inventory/transaction/InventoryTransaction.php +++ b/src/inventory/transaction/InventoryTransaction.php @@ -66,7 +66,6 @@ class InventoryTransaction{ protected $actions = []; /** - * @param Player $source * @param InventoryAction[] $actions */ public function __construct(Player $source, array $actions = []){ @@ -76,9 +75,6 @@ class InventoryTransaction{ } } - /** - * @return Player - */ public function getSource() : Player{ return $this->source; } @@ -102,9 +98,6 @@ class InventoryTransaction{ return $this->actions; } - /** - * @param InventoryAction $action - */ public function addAction(InventoryAction $action) : void{ if(!isset($this->actions[$hash = spl_object_id($action)])){ $this->actions[$hash] = $action; @@ -130,8 +123,6 @@ class InventoryTransaction{ /** * @internal This method should not be used by plugins, it's used to add tracked inventories for InventoryActions * involving inventories. - * - * @param Inventory $inventory */ public function addInventory(Inventory $inventory) : void{ if(!isset($this->inventories[$hash = spl_object_id($inventory)])){ @@ -233,10 +224,7 @@ class InventoryTransaction{ } /** - * @param Item $needOrigin * @param SlotChangeAction[] $possibleActions - * - * @return null|Item */ protected function findResultItem(Item $needOrigin, array $possibleActions) : ?Item{ assert(count($possibleActions) > 0); @@ -295,7 +283,6 @@ class InventoryTransaction{ /** * Executes the group of actions, returning whether the transaction executed successfully or not. - * @return bool * * @throws TransactionValidationException */ @@ -330,9 +317,6 @@ class InventoryTransaction{ return true; } - /** - * @return bool - */ public function hasExecuted() : bool{ return $this->hasExecuted; } diff --git a/src/inventory/transaction/action/DropItemAction.php b/src/inventory/transaction/action/DropItemAction.php index 6c8db64a0..a15e3fdd0 100644 --- a/src/inventory/transaction/action/DropItemAction.php +++ b/src/inventory/transaction/action/DropItemAction.php @@ -53,8 +53,6 @@ class DropItemAction extends InventoryAction{ /** * Drops the target item in front of the player. - * - * @param Player $source */ public function execute(Player $source) : void{ $source->dropItem($this->targetItem); diff --git a/src/inventory/transaction/action/InventoryAction.php b/src/inventory/transaction/action/InventoryAction.php index e5b9c2dad..5b1e8db5d 100644 --- a/src/inventory/transaction/action/InventoryAction.php +++ b/src/inventory/transaction/action/InventoryAction.php @@ -43,7 +43,6 @@ abstract class InventoryAction{ /** * Returns the item that was present before the action took place. - * @return Item */ public function getSourceItem() : Item{ return clone $this->sourceItem; @@ -51,7 +50,6 @@ abstract class InventoryAction{ /** * Returns the item that the action attempted to replace the source item with. - * @return Item */ public function getTargetItem() : Item{ return clone $this->targetItem; @@ -59,17 +57,11 @@ abstract class InventoryAction{ /** * Returns whether this action is currently valid. This should perform any necessary sanity checks. - * - * @param Player $source - * - * @return bool */ abstract public function isValid(Player $source) : bool; /** * Called when the action is added to the specified InventoryTransaction. - * - * @param InventoryTransaction $transaction */ public function onAddToTransaction(InventoryTransaction $transaction) : void{ @@ -78,10 +70,6 @@ abstract class InventoryAction{ /** * Called by inventory transactions before any actions are processed. If this returns false, the transaction will * be cancelled. - * - * @param Player $source - * - * @return bool */ public function onPreExecute(Player $source) : bool{ return true; @@ -90,8 +78,6 @@ abstract class InventoryAction{ /** * Performs actions needed to complete the inventory-action server-side. This will only be called if the transaction * which it is part of is considered valid. - * - * @param Player $source */ abstract public function execute(Player $source) : void; } diff --git a/src/inventory/transaction/action/SlotChangeAction.php b/src/inventory/transaction/action/SlotChangeAction.php index e1145022f..fe2b6d9b0 100644 --- a/src/inventory/transaction/action/SlotChangeAction.php +++ b/src/inventory/transaction/action/SlotChangeAction.php @@ -38,12 +38,6 @@ class SlotChangeAction extends InventoryAction{ /** @var int */ private $inventorySlot; - /** - * @param Inventory $inventory - * @param int $inventorySlot - * @param Item $sourceItem - * @param Item $targetItem - */ public function __construct(Inventory $inventory, int $inventorySlot, Item $sourceItem, Item $targetItem){ parent::__construct($sourceItem, $targetItem); $this->inventory = $inventory; @@ -52,8 +46,6 @@ class SlotChangeAction extends InventoryAction{ /** * Returns the inventory involved in this action. - * - * @return Inventory */ public function getInventory() : Inventory{ return $this->inventory; @@ -61,7 +53,6 @@ class SlotChangeAction extends InventoryAction{ /** * Returns the slot in the inventory which this action modified. - * @return int */ public function getSlot() : int{ return $this->inventorySlot; @@ -69,10 +60,6 @@ class SlotChangeAction extends InventoryAction{ /** * Checks if the item in the inventory at the specified slot is the same as this action's source item. - * - * @param Player $source - * - * @return bool */ public function isValid(Player $source) : bool{ return ( @@ -83,9 +70,6 @@ class SlotChangeAction extends InventoryAction{ /** * Adds this action's target inventory to the transaction's inventory list. - * - * @param InventoryTransaction $transaction - * */ public function onAddToTransaction(InventoryTransaction $transaction) : void{ $transaction->addInventory($this->inventory); @@ -93,8 +77,6 @@ class SlotChangeAction extends InventoryAction{ /** * Sets the item into the target inventory. - * - * @param Player $source */ public function execute(Player $source) : void{ $this->inventory->setItem($this->inventorySlot, $this->targetItem, false); diff --git a/src/item/Armor.php b/src/item/Armor.php index d2b5759ea..3b64f6b08 100644 --- a/src/item/Armor.php +++ b/src/item/Armor.php @@ -63,7 +63,6 @@ class Armor extends Durable{ /** * @see ArmorInventory - * @return int */ public function getArmorSlot() : int{ return $this->armorInfo->getArmorSlot(); @@ -75,7 +74,6 @@ class Armor extends Durable{ /** * Returns the dyed colour of this armour piece. This generally only applies to leather armour. - * @return Color|null */ public function getCustomColor() : ?Color{ return $this->customColor; @@ -84,8 +82,6 @@ class Armor extends Durable{ /** * Sets the dyed colour of this armour piece. This generally only applies to leather armour. * - * @param Color $color - * * @return $this */ public function setCustomColor(Color $color) : self{ @@ -96,10 +92,6 @@ class Armor extends Durable{ /** * Returns the total enchantment protection factor this armour piece offers from all applicable protection * enchantments on the item. - * - * @param EntityDamageEvent $event - * - * @return int */ public function getEnchantmentProtectionFactor(EntityDamageEvent $event) : int{ $epf = 0; diff --git a/src/item/ArmorTypeInfo.php b/src/item/ArmorTypeInfo.php index 172a590b8..3542a554e 100644 --- a/src/item/ArmorTypeInfo.php +++ b/src/item/ArmorTypeInfo.php @@ -38,23 +38,14 @@ class ArmorTypeInfo{ $this->armorSlot = $armorSlot; } - /** - * @return int - */ public function getDefensePoints() : int{ return $this->defensePoints; } - /** - * @return int - */ public function getMaxDurability() : int{ return $this->maxDurability; } - /** - * @return int - */ public function getArmorSlot() : int{ return $this->armorSlot; } diff --git a/src/item/Banner.php b/src/item/Banner.php index 7b0950c64..db566f7de 100644 --- a/src/item/Banner.php +++ b/src/item/Banner.php @@ -53,9 +53,6 @@ class Banner extends Item{ $this->patterns = new Deque(); } - /** - * @return DyeColor - */ public function getColor() : DyeColor{ return $this->color; } diff --git a/src/item/Bed.php b/src/item/Bed.php index 9212b80b0..a061129f9 100644 --- a/src/item/Bed.php +++ b/src/item/Bed.php @@ -37,9 +37,6 @@ class Bed extends Item{ $this->color = $color; } - /** - * @return DyeColor - */ public function getColor() : DyeColor{ return $this->color; } diff --git a/src/item/Boat.php b/src/item/Boat.php index 55a521423..3f75abd4f 100644 --- a/src/item/Boat.php +++ b/src/item/Boat.php @@ -34,9 +34,6 @@ class Boat extends Item{ $this->woodType = $woodType; } - /** - * @return TreeType - */ public function getWoodType() : TreeType{ return $this->woodType; } diff --git a/src/item/Consumable.php b/src/item/Consumable.php index b9f0c1c3c..c4b809adc 100644 --- a/src/item/Consumable.php +++ b/src/item/Consumable.php @@ -47,8 +47,6 @@ interface Consumable{ /** * Called when this Consumable is consumed by mob, after standard resulting effects have been applied. - * - * @param Living $consumer */ public function onConsume(Living $consumer) : void; } diff --git a/src/item/Durable.php b/src/item/Durable.php index 8462e25b2..a84956d0b 100644 --- a/src/item/Durable.php +++ b/src/item/Durable.php @@ -41,7 +41,6 @@ abstract class Durable extends Item{ /** * Returns whether this item will take damage when used. - * @return bool */ public function isUnbreakable() : bool{ return $this->unbreakable; @@ -50,8 +49,6 @@ abstract class Durable extends Item{ /** * Sets whether the item will take damage when used. * - * @param bool $value - * * @return $this */ public function setUnbreakable(bool $value = true) : self{ @@ -62,8 +59,6 @@ abstract class Durable extends Item{ /** * Applies damage to the item. * - * @param int $amount - * * @return bool if any damage was applied to the item */ public function applyDamage(int $amount) : bool{ @@ -119,14 +114,11 @@ abstract class Durable extends Item{ /** * Returns the maximum amount of damage this item can take before it breaks. - * - * @return int */ abstract public function getMaxDurability() : int; /** * Returns whether the item is broken. - * @return bool */ public function isBroken() : bool{ return $this->damage >= $this->getMaxDurability(); diff --git a/src/item/Dye.php b/src/item/Dye.php index ba103b519..0df19d715 100644 --- a/src/item/Dye.php +++ b/src/item/Dye.php @@ -35,9 +35,6 @@ class Dye extends Item{ $this->color = $color; } - /** - * @return DyeColor - */ public function getColor() : DyeColor{ return $this->color; } diff --git a/src/item/FoodSource.php b/src/item/FoodSource.php index 0e5b55335..ddddb4a94 100644 --- a/src/item/FoodSource.php +++ b/src/item/FoodSource.php @@ -34,7 +34,6 @@ interface FoodSource extends Consumable{ /** * Returns whether a Human eating this FoodSource must have a non-full hunger bar. - * @return bool */ public function requiresHunger() : bool; } diff --git a/src/item/Item.php b/src/item/Item.php index 3b4443c67..0714dc67c 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -103,10 +103,6 @@ class Item implements \JsonSerializable{ * * NOTE: This should NOT BE USED for creating items to set into an inventory. Use {@link ItemFactory#get} for that * purpose. - * - * @param int $id - * @param int $variant - * @param string $name */ public function __construct(int $id, int $variant = 0, string $name = "Unknown"){ if($id < -0x8000 or $id > 0x7fff){ //signed short range @@ -120,9 +116,6 @@ class Item implements \JsonSerializable{ $this->canDestroy = new Set(); } - /** - * @return bool - */ public function hasCustomBlockData() : bool{ return $this->blockEntityTag !== null; } @@ -136,8 +129,6 @@ class Item implements \JsonSerializable{ } /** - * @param CompoundTag $compound - * * @return $this */ public function setCustomBlockData(CompoundTag $compound) : Item{ @@ -146,30 +137,19 @@ class Item implements \JsonSerializable{ return $this; } - /** - * @return CompoundTag|null - */ public function getCustomBlockData() : ?CompoundTag{ return $this->blockEntityTag; } - /** - * @return bool - */ public function hasCustomName() : bool{ return $this->customName !== ""; } - /** - * @return string - */ public function getCustomName() : string{ return $this->customName; } /** - * @param string $name - * * @return $this */ public function setCustomName(string $name) : Item{ @@ -243,7 +223,6 @@ class Item implements \JsonSerializable{ /** * Returns whether this Item has a non-empty NBT. - * @return bool */ public function hasNamedTag() : bool{ return $this->getNamedTag()->count() > 0; @@ -252,8 +231,6 @@ class Item implements \JsonSerializable{ /** * Returns a tree of Tag objects representing the Item's NBT. If the item does not have any NBT, an empty CompoundTag * object is returned to allow the caller to manipulate and apply back to the item. - * - * @return CompoundTag */ public function getNamedTag() : CompoundTag{ if($this->nbt === null){ @@ -266,8 +243,6 @@ class Item implements \JsonSerializable{ /** * Sets the Item's NBT from the supplied CompoundTag object. * - * @param CompoundTag $tag - * * @return $this */ public function setNamedTag(CompoundTag $tag) : Item{ @@ -401,16 +376,11 @@ class Item implements \JsonSerializable{ } } - /** - * @return int - */ public function getCount() : int{ return $this->count; } /** - * @param int $count - * * @return $this */ public function setCount(int $count) : Item{ @@ -422,8 +392,6 @@ class Item implements \JsonSerializable{ /** * Pops an item from the stack and returns it, decreasing the stack count of this item stack by one. * - * @param int $count - * * @return $this * @throws \InvalidArgumentException if trying to pop more items than are on the stack */ @@ -446,7 +414,6 @@ class Item implements \JsonSerializable{ /** * Returns the name of the item, or the custom name if it is set. - * @return string */ final public function getName() : string{ return $this->hasCustomName() ? $this->getCustomName() : $this->getVanillaName(); @@ -454,37 +421,26 @@ class Item implements \JsonSerializable{ /** * Returns the vanilla name of the item, disregarding custom names. - * @return string */ public function getVanillaName() : string{ return $this->name; } - /** - * @return bool - */ final public function canBePlaced() : bool{ return $this->getBlock()->canBePlaced(); } /** * Returns the block corresponding to this Item. - * @return Block */ public function getBlock() : Block{ return VanillaBlocks::AIR(); } - /** - * @return int - */ final public function getId() : int{ return $this->id; } - /** - * @return int - */ public function getMeta() : int{ return $this->meta; } @@ -492,8 +448,6 @@ class Item implements \JsonSerializable{ /** * Returns whether this item can match any item with an equivalent ID with any meta value. * Used in crafting recipes which accept multiple variants of the same item, for example crafting tables recipes. - * - * @return bool */ public function hasAnyDamageValue() : bool{ return $this->meta === -1; @@ -501,7 +455,6 @@ class Item implements \JsonSerializable{ /** * Returns the highest amount of this item which will fit into one inventory slot. - * @return int */ public function getMaxStackSize() : int{ return 64; @@ -509,7 +462,6 @@ class Item implements \JsonSerializable{ /** * Returns the time in ticks which the item will fuel a furnace for. - * @return int */ public function getFuelTime() : int{ return 0; @@ -517,7 +469,6 @@ class Item implements \JsonSerializable{ /** * Returns how many points of damage this item will deal to an entity when used as a weapon. - * @return int */ public function getAttackPoints() : int{ return 1; @@ -525,7 +476,6 @@ class Item implements \JsonSerializable{ /** * Returns how many armor points can be gained by wearing this item. - * @return int */ public function getDefensePoints() : int{ return 0; @@ -534,8 +484,6 @@ class Item implements \JsonSerializable{ /** * Returns what type of block-breaking tool this is. Blocks requiring the same tool type as the item will break * faster (except for blocks requiring no tool, which break at the same speed regardless of the tool used) - * - * @return int */ public function getBlockToolType() : int{ return BlockToolType::NONE; @@ -547,8 +495,6 @@ class Item implements \JsonSerializable{ * This should return 1 for non-tiered tools, and the tool tier for tiered tools. * * @see BlockBreakInfo::getToolHarvestLevel() - * - * @return int */ public function getBlockToolHarvestLevel() : int{ return 0; @@ -560,14 +506,6 @@ class Item implements \JsonSerializable{ /** * Called when a player uses this item on a block. - * - * @param Player $player - * @param Block $blockReplace - * @param Block $blockClicked - * @param int $face - * @param Vector3 $clickVector - * - * @return ItemUseResult */ public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{ return ItemUseResult::NONE(); @@ -576,11 +514,6 @@ class Item implements \JsonSerializable{ /** * Called when a player uses the item on air, for example throwing a projectile. * Returns whether the item was changed, for example count decrease or durability change. - * - * @param Player $player - * @param Vector3 $directionVector - * - * @return ItemUseResult */ public function onClickAir(Player $player, Vector3 $directionVector) : ItemUseResult{ return ItemUseResult::NONE(); @@ -589,10 +522,6 @@ class Item implements \JsonSerializable{ /** * Called when a player is using this item and releases it. Used to handle bow shoot actions. * Returns whether the item was changed, for example count decrease or durability change. - * - * @param Player $player - * - * @return ItemUseResult */ public function onReleaseUsing(Player $player) : ItemUseResult{ return ItemUseResult::NONE(); @@ -600,10 +529,6 @@ class Item implements \JsonSerializable{ /** * Called when this item is used to destroy a block. Usually used to update durability. - * - * @param Block $block - * - * @return bool */ public function onDestroyBlock(Block $block) : bool{ return false; @@ -611,10 +536,6 @@ class Item implements \JsonSerializable{ /** * Called when this item is used to attack an entity. Usually used to update durability. - * - * @param Entity $victim - * - * @return bool */ public function onAttackEntity(Entity $victim) : bool{ return false; @@ -622,8 +543,6 @@ class Item implements \JsonSerializable{ /** * Returns the number of ticks a player must wait before activating this item again. - * - * @return int */ public function getCooldownTicks() : int{ return 0; @@ -632,11 +551,8 @@ class Item implements \JsonSerializable{ /** * Compares an Item to this Item and check if they match. * - * @param Item $item * @param bool $checkDamage Whether to verify that the damage values match. * @param bool $checkCompound Whether to verify that the items' NBT match. - * - * @return bool */ final public function equals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ return $this->id === $item->getId() and @@ -646,26 +562,17 @@ class Item implements \JsonSerializable{ /** * Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack. - * - * @param Item $other - * - * @return bool */ final public function equalsExact(Item $other) : bool{ return $this->equals($other, true, true) and $this->count === $other->count; } - /** - * @return string - */ final public function __toString() : string{ return "Item " . $this->name . " (" . $this->id . ":" . ($this->hasAnyDamageValue() ? "?" : $this->getMeta()) . ")x" . $this->count . ($this->hasNamedTag() ? " tags:0x" . base64_encode((new LittleEndianNbtSerializer())->write(new TreeRoot($this->getNamedTag()))) : ""); } /** * Returns an array of item stack properties that can be serialized to json. - * - * @return array */ final public function jsonSerialize() : array{ $data = [ @@ -690,9 +597,6 @@ class Item implements \JsonSerializable{ /** * Returns an Item from properties created in an array by {@link Item#jsonSerialize} * - * @param array $data - * - * @return Item * @throws NbtDataException * @throws \InvalidArgumentException */ @@ -716,8 +620,6 @@ class Item implements \JsonSerializable{ * Serializes the item to an NBT CompoundTag * * @param int $slot optional, the inventory slot of the item - * - * @return CompoundTag */ public function nbtSerialize(int $slot = -1) : CompoundTag{ $result = CompoundTag::create() @@ -738,10 +640,6 @@ class Item implements \JsonSerializable{ /** * Deserializes an Item from an NBT CompoundTag - * - * @param CompoundTag $tag - * - * @return Item */ public static function nbtDeserialize(CompoundTag $tag) : Item{ if(!$tag->hasTag("id") or !$tag->hasTag("Count")){ diff --git a/src/item/ItemBlock.php b/src/item/ItemBlock.php index e88576026..ca67e2a99 100644 --- a/src/item/ItemBlock.php +++ b/src/item/ItemBlock.php @@ -34,9 +34,7 @@ class ItemBlock extends Item{ protected $blockId; /** - * @param int $blockId * @param int $meta usually 0-15 (placed blocks may only have meta values 0-15) - * @param int|null $itemId */ public function __construct(int $blockId, int $meta = 0, ?int $itemId = null){ if($blockId < 0){ //extended blocks diff --git a/src/item/ItemEnchantmentHandlingTrait.php b/src/item/ItemEnchantmentHandlingTrait.php index 20fdb8372..23ca86b03 100644 --- a/src/item/ItemEnchantmentHandlingTrait.php +++ b/src/item/ItemEnchantmentHandlingTrait.php @@ -35,37 +35,20 @@ trait ItemEnchantmentHandlingTrait{ /** @var EnchantmentInstance[] */ protected $enchantments = []; - /** - * @return bool - */ public function hasEnchantments() : bool{ return !empty($this->enchantments); } - /** - * @param Enchantment $enchantment - * @param int $level - * - * @return bool - */ public function hasEnchantment(Enchantment $enchantment, int $level = -1) : bool{ $id = $enchantment->getId(); return isset($this->enchantments[$id]) and ($level === -1 or $this->enchantments[$id]->getLevel() === $level); } - /** - * @param Enchantment $enchantment - * - * @return EnchantmentInstance|null - */ public function getEnchantment(Enchantment $enchantment) : ?EnchantmentInstance{ return $this->enchantments[$enchantment->getId()] ?? null; } /** - * @param Enchantment $enchantment - * @param int $level - * * @return $this */ public function removeEnchantment(Enchantment $enchantment, int $level = -1) : self{ @@ -86,8 +69,6 @@ trait ItemEnchantmentHandlingTrait{ } /** - * @param EnchantmentInstance $enchantment - * * @return $this */ public function addEnchantment(EnchantmentInstance $enchantment) : self{ @@ -105,10 +86,6 @@ trait ItemEnchantmentHandlingTrait{ /** * Returns the level of the enchantment on this item with the specified ID, or 0 if the item does not have the * enchantment. - * - * @param Enchantment $enchantment - * - * @return int */ public function getEnchantmentLevel(Enchantment $enchantment) : int{ return ($instance = $this->getEnchantment($enchantment)) !== null ? $instance->getLevel() : 0; diff --git a/src/item/ItemFactory.php b/src/item/ItemFactory.php index eb64616c4..a526114ba 100644 --- a/src/item/ItemFactory.php +++ b/src/item/ItemFactory.php @@ -381,9 +381,6 @@ class ItemFactory{ * NOTE: If you are registering a new item type, you will need to add it to the creative inventory yourself - it * will not automatically appear there. * - * @param Item $item - * @param bool $override - * * @throws \RuntimeException if something attempted to override an already-registered item without specifying the * $override parameter. */ @@ -401,12 +398,6 @@ class ItemFactory{ /** * Returns an instance of the Item with the specified id, meta, count and NBT. * - * @param int $id - * @param int $meta - * @param int $count - * @param CompoundTag|null $tags - * - * @return Item * @throws \InvalidArgumentException */ public static function get(int $id, int $meta = 0, int $count = 1, ?CompoundTag $tags = null) : Item{ @@ -444,10 +435,6 @@ class ItemFactory{ * - `minecraft:string` * - `351:4 (lapis lazuli ID:meta)` * - * @param string $str - * - * @return Item - * * @throws \InvalidArgumentException if the given string cannot be parsed as an item identifier */ public static function fromString(string $str) : Item{ @@ -477,11 +464,6 @@ class ItemFactory{ /** * Returns whether the specified item ID is already registered in the item factory. - * - * @param int $id - * @param int $variant - * - * @return bool */ public static function isRegistered(int $id, int $variant = 0) : bool{ if($id < 256){ diff --git a/src/item/LiquidBucket.php b/src/item/LiquidBucket.php index 69e3e0ef3..ec759b291 100644 --- a/src/item/LiquidBucket.php +++ b/src/item/LiquidBucket.php @@ -75,9 +75,6 @@ class LiquidBucket extends Item{ return ItemUseResult::FAIL(); } - /** - * @return Liquid - */ public function getLiquid() : Liquid{ return $this->liquid; } diff --git a/src/item/Potion.php b/src/item/Potion.php index 619882a56..54806da72 100644 --- a/src/item/Potion.php +++ b/src/item/Potion.php @@ -110,8 +110,6 @@ class Potion extends Item implements Consumable{ /** * Returns a list of effects applied by potions with the specified ID. * - * @param int $id - * * @return EffectInstance[] */ public static function getPotionEffectsById(int $id) : array{ diff --git a/src/item/ProjectileItem.php b/src/item/ProjectileItem.php index cd3461bd1..cbae038b3 100644 --- a/src/item/ProjectileItem.php +++ b/src/item/ProjectileItem.php @@ -45,8 +45,6 @@ abstract class ProjectileItem extends Item{ /** * Helper function to apply extra NBT tags to pass to the created projectile. - * - * @param CompoundTag $tag */ protected function addExtraTags(CompoundTag $tag) : void{ diff --git a/src/item/SpawnEgg.php b/src/item/SpawnEgg.php index ac3fd5b3e..b9aa36165 100644 --- a/src/item/SpawnEgg.php +++ b/src/item/SpawnEgg.php @@ -37,10 +37,6 @@ class SpawnEgg extends Item{ private $entityClass; /** - * @param int $id - * @param int $variant - * @param string $name - * * @param string $entityClass instanceof Entity * * @throws \InvalidArgumentException diff --git a/src/item/ToolTier.php b/src/item/ToolTier.php index 129da6bb2..f15ba7c3a 100644 --- a/src/item/ToolTier.php +++ b/src/item/ToolTier.php @@ -69,30 +69,18 @@ final class ToolTier{ $this->baseEfficiency = $baseEfficiency; } - /** - * @return int - */ public function getHarvestLevel() : int{ return $this->harvestLevel; } - /** - * @return int - */ public function getMaxDurability() : int{ return $this->maxDurability; } - /** - * @return int - */ public function getBaseAttackPoints() : int{ return $this->baseAttackPoints; } - /** - * @return int - */ public function getBaseEfficiency() : int{ return $this->baseEfficiency; } diff --git a/src/item/VanillaItems.php b/src/item/VanillaItems.php index c0f8f1583..c5ee5cce2 100644 --- a/src/item/VanillaItems.php +++ b/src/item/VanillaItems.php @@ -302,11 +302,6 @@ final class VanillaItems{ self::_registryRegister($name, $item); } - /** - * @param string $name - * - * @return Item - */ public static function fromString(string $name) : Item{ $result = self::_registryFromString($name); assert($result instanceof Item); diff --git a/src/item/WritableBookBase.php b/src/item/WritableBookBase.php index b822ab032..75e997bf9 100644 --- a/src/item/WritableBookBase.php +++ b/src/item/WritableBookBase.php @@ -47,10 +47,6 @@ abstract class WritableBookBase extends Item{ /** * Returns whether the given page exists in this book. - * - * @param int $pageId - * - * @return bool */ public function pageExists(int $pageId) : bool{ return isset($this->pages[$pageId]); @@ -59,9 +55,6 @@ abstract class WritableBookBase extends Item{ /** * Returns a string containing the content of a page (which could be empty), or null if the page doesn't exist. * - * @param int $pageId - * - * @return string * @throws \OutOfRangeException if requesting a nonexisting page */ public function getPageText(int $pageId) : string{ @@ -71,9 +64,6 @@ abstract class WritableBookBase extends Item{ /** * Sets the text of a page in the book. Adds the page if the page does not yet exist. * - * @param int $pageId - * @param string $pageText - * * @return $this */ public function setPageText(int $pageId, string $pageText) : self{ @@ -89,8 +79,6 @@ abstract class WritableBookBase extends Item{ * Adds a new page with the given page ID. * Creates a new page for every page between the given ID and existing pages that doesn't yet exist. * - * @param int $pageId - * * @return $this */ public function addPage(int $pageId) : self{ @@ -107,8 +95,6 @@ abstract class WritableBookBase extends Item{ /** * Deletes an existing page with the given page ID. * - * @param int $pageId - * * @return $this */ public function deletePage(int $pageId) : self{ @@ -119,9 +105,6 @@ abstract class WritableBookBase extends Item{ /** * Inserts a new page with the given text and moves other pages upwards. * - * @param int $pageId - * @param string $pageText - * * @return $this */ public function insertPage(int $pageId, string $pageText = "") : self{ @@ -132,9 +115,6 @@ abstract class WritableBookBase extends Item{ /** * Switches the text of two pages with each other. * - * @param int $pageId1 - * @param int $pageId2 - * * @return bool indicating success * @throws \OutOfRangeException if either of the pages does not exist */ diff --git a/src/item/WritableBookPage.php b/src/item/WritableBookPage.php index 20ce682cb..62ebbcf50 100644 --- a/src/item/WritableBookPage.php +++ b/src/item/WritableBookPage.php @@ -39,16 +39,10 @@ class WritableBookPage{ $this->photoName = $photoName; } - /** - * @return string - */ public function getText() : string{ return $this->text; } - /** - * @return string - */ public function getPhotoName() : string{ return $this->photoName; } diff --git a/src/item/WrittenBook.php b/src/item/WrittenBook.php index e0d5c0fad..f356b1cd6 100644 --- a/src/item/WrittenBook.php +++ b/src/item/WrittenBook.php @@ -51,8 +51,6 @@ class WrittenBook extends WritableBookBase{ /** * Returns the generation of the book. * Generations higher than 1 can not be copied. - * - * @return int */ public function getGeneration() : int{ return $this->generation; @@ -61,8 +59,6 @@ class WrittenBook extends WritableBookBase{ /** * Sets the generation of a book. * - * @param int $generation - * * @return $this */ public function setGeneration(int $generation) : self{ @@ -78,8 +74,6 @@ class WrittenBook extends WritableBookBase{ * Returns the author of this book. * This is not a reliable way to get the name of the player who signed this book. * The author can be set to anything when signing a book. - * - * @return string */ public function getAuthor() : string{ return $this->author; @@ -88,8 +82,6 @@ class WrittenBook extends WritableBookBase{ /** * Sets the author of this book. * - * @param string $authorName - * * @return $this */ public function setAuthor(string $authorName) : self{ @@ -100,8 +92,6 @@ class WrittenBook extends WritableBookBase{ /** * Returns the title of this book. - * - * @return string */ public function getTitle() : string{ return $this->title; @@ -110,8 +100,6 @@ class WrittenBook extends WritableBookBase{ /** * Sets the author of this book. * - * @param string $title - * * @return $this */ public function setTitle(string $title) : self{ diff --git a/src/item/enchantment/Enchantment.php b/src/item/enchantment/Enchantment.php index e737c962a..d93c475de 100644 --- a/src/item/enchantment/Enchantment.php +++ b/src/item/enchantment/Enchantment.php @@ -220,27 +220,15 @@ class Enchantment{ /** * Registers an enchantment type. - * - * @param Enchantment $enchantment */ public static function register(Enchantment $enchantment) : void{ self::$enchantments[$enchantment->getId()] = clone $enchantment; } - /** - * @param int $id - * - * @return Enchantment|null - */ public static function get(int $id) : ?Enchantment{ return self::$enchantments[$id] ?? null; } - /** - * @param string $name - * - * @return Enchantment|null - */ public static function fromString(string $name) : ?Enchantment{ $const = Enchantment::class . "::" . strtoupper($name); if(defined($const)){ @@ -262,14 +250,6 @@ class Enchantment{ /** @var int */ private $maxLevel; - /** - * @param int $id - * @param string $name - * @param int $rarity - * @param int $primaryItemFlags - * @param int $secondaryItemFlags - * @param int $maxLevel - */ public function __construct(int $id, string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel){ $this->id = $id; $this->name = $name; @@ -281,7 +261,6 @@ class Enchantment{ /** * Returns the ID of this enchantment as per Minecraft PE - * @return int */ public function getId() : int{ return $this->id; @@ -289,7 +268,6 @@ class Enchantment{ /** * Returns a translation key for this enchantment's name. - * @return string */ public function getName() : string{ return $this->name; @@ -297,7 +275,6 @@ class Enchantment{ /** * Returns an int constant indicating how rare this enchantment type is. - * @return int */ public function getRarity() : int{ return $this->rarity; @@ -305,8 +282,6 @@ class Enchantment{ /** * Returns a bitset indicating what item types can have this item applied from an enchanting table. - * - * @return int */ public function getPrimaryItemFlags() : int{ return $this->primaryItemFlags; @@ -315,8 +290,6 @@ class Enchantment{ /** * Returns a bitset indicating what item types cannot have this item applied from an enchanting table, but can from * an anvil. - * - * @return int */ public function getSecondaryItemFlags() : int{ return $this->secondaryItemFlags; @@ -324,10 +297,6 @@ class Enchantment{ /** * Returns whether this enchantment can apply to the item type from an enchanting table. - * - * @param int $flag - * - * @return bool */ public function hasPrimaryItemType(int $flag) : bool{ return ($this->primaryItemFlags & $flag) !== 0; @@ -335,10 +304,6 @@ class Enchantment{ /** * Returns whether this enchantment can apply to the item type from an anvil, if it is not a primary item. - * - * @param int $flag - * - * @return bool */ public function hasSecondaryItemType(int $flag) : bool{ return ($this->secondaryItemFlags & $flag) !== 0; @@ -346,7 +311,6 @@ class Enchantment{ /** * Returns the maximum level of this enchantment that can be found on an enchantment table. - * @return int */ public function getMaxLevel() : int{ return $this->maxLevel; diff --git a/src/item/enchantment/EnchantmentEntry.php b/src/item/enchantment/EnchantmentEntry.php index edd2dffb8..287305aec 100644 --- a/src/item/enchantment/EnchantmentEntry.php +++ b/src/item/enchantment/EnchantmentEntry.php @@ -35,8 +35,6 @@ class EnchantmentEntry{ /** * @param Enchantment[] $enchantments - * @param int $cost - * @param string $randomName */ public function __construct(array $enchantments, int $cost, string $randomName){ $this->enchantments = $enchantments; diff --git a/src/item/enchantment/EnchantmentInstance.php b/src/item/enchantment/EnchantmentInstance.php index 4dadc77c1..f25c05d75 100644 --- a/src/item/enchantment/EnchantmentInstance.php +++ b/src/item/enchantment/EnchantmentInstance.php @@ -47,7 +47,6 @@ final class EnchantmentInstance{ /** * Returns the type of this enchantment. - * @return Enchantment */ public function getType() : Enchantment{ return $this->enchantment; @@ -55,7 +54,6 @@ final class EnchantmentInstance{ /** * Returns the type identifier of this enchantment instance. - * @return int */ public function getId() : int{ return $this->enchantment->getId(); @@ -63,7 +61,6 @@ final class EnchantmentInstance{ /** * Returns the level of the enchantment. - * @return int */ public function getLevel() : int{ return $this->level; diff --git a/src/item/enchantment/EnchantmentList.php b/src/item/enchantment/EnchantmentList.php index ebec0a3f4..90914e090 100644 --- a/src/item/enchantment/EnchantmentList.php +++ b/src/item/enchantment/EnchantmentList.php @@ -33,19 +33,10 @@ class EnchantmentList{ $this->enchantments = new \SplFixedArray($size); } - /** - * @param int $slot - * @param EnchantmentEntry $entry - */ public function setSlot(int $slot, EnchantmentEntry $entry) : void{ $this->enchantments[$slot] = $entry; } - /** - * @param int $slot - * - * @return EnchantmentEntry - */ public function getSlot(int $slot) : EnchantmentEntry{ return $this->enchantments[$slot]; } diff --git a/src/item/enchantment/MeleeWeaponEnchantment.php b/src/item/enchantment/MeleeWeaponEnchantment.php index 6d2c8a631..9b61b1664 100644 --- a/src/item/enchantment/MeleeWeaponEnchantment.php +++ b/src/item/enchantment/MeleeWeaponEnchantment.php @@ -34,28 +34,16 @@ abstract class MeleeWeaponEnchantment extends Enchantment{ /** * Returns whether this melee enchantment has an effect on the target entity. For example, Smite only applies to * undead mobs. - * - * @param Entity $victim - * - * @return bool */ abstract public function isApplicableTo(Entity $victim) : bool; /** * Returns the amount of additional damage caused by this enchantment to applicable targets. - * - * @param int $enchantmentLevel - * - * @return float */ abstract public function getDamageBonus(int $enchantmentLevel) : float; /** * Called after damaging the entity to apply any post damage effects to the target. - * - * @param Entity $attacker - * @param Entity $victim - * @param int $enchantmentLevel */ public function onPostAttack(Entity $attacker, Entity $victim, int $enchantmentLevel) : void{ diff --git a/src/item/enchantment/ProtectionEnchantment.php b/src/item/enchantment/ProtectionEnchantment.php index 9793f795c..8fc603aa9 100644 --- a/src/item/enchantment/ProtectionEnchantment.php +++ b/src/item/enchantment/ProtectionEnchantment.php @@ -36,13 +36,6 @@ class ProtectionEnchantment extends Enchantment{ /** * ProtectionEnchantment constructor. * - * @param int $id - * @param string $name - * @param int $rarity - * @param int $primaryItemFlags - * @param int $secondaryItemFlags - * @param int $maxLevel - * @param float $typeModifier * @param int[]|null $applicableDamageTypes EntityDamageEvent::CAUSE_* constants which this enchantment type applies to, or null if it applies to all types of damage. */ public function __construct(int $id, string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes){ @@ -56,7 +49,6 @@ class ProtectionEnchantment extends Enchantment{ /** * Returns the multiplier by which this enchantment type's EPF increases with each enchantment level. - * @return float */ public function getTypeModifier() : float{ return $this->typeModifier; @@ -64,10 +56,6 @@ class ProtectionEnchantment extends Enchantment{ /** * Returns the base EPF this enchantment type offers for the given enchantment level. - * - * @param int $level - * - * @return int */ public function getProtectionFactor(int $level) : int{ return (int) floor((6 + $level ** 2) * $this->typeModifier / 3); @@ -75,10 +63,6 @@ class ProtectionEnchantment extends Enchantment{ /** * Returns whether this enchantment type offers protection from the specified damage source's cause. - * - * @param EntityDamageEvent $event - * - * @return bool */ public function isApplicable(EntityDamageEvent $event) : bool{ return $this->applicableDamageTypes === null or isset($this->applicableDamageTypes[$event->getCause()]); diff --git a/src/lang/Language.php b/src/lang/Language.php index 4e8d7ff8b..e0de9dd00 100644 --- a/src/lang/Language.php +++ b/src/lang/Language.php @@ -44,9 +44,6 @@ class Language{ public const FALLBACK_LANGUAGE = "eng"; /** - * @param string $path - * - * @return array * @throws LanguageNotFoundException */ public static function getLanguageList(string $path = "") : array{ @@ -88,10 +85,6 @@ class Language{ protected $fallbackLang = []; /** - * @param string $lang - * @param string|null $path - * @param string $fallback - * * @throws LanguageNotFoundException */ public function __construct(string $lang, ?string $path = null, string $fallback = self::FALLBACK_LANGUAGE){ @@ -123,11 +116,7 @@ class Language{ } /** - * @param string $str * @param (float|int|string)[] $params - * @param string|null $onlyPrefix - * - * @return string */ public function translateString(string $str, array $params = [], ?string $onlyPrefix = null) : string{ $baseText = $this->get($str); @@ -155,30 +144,14 @@ class Language{ return $baseText; } - /** - * @param string $id - * - * @return string|null - */ protected function internalGet(string $id) : ?string{ return $this->lang[$id] ?? $this->fallbackLang[$id] ?? null; } - /** - * @param string $id - * - * @return string - */ public function get(string $id) : string{ return $this->internalGet($id) ?? $id; } - /** - * @param string $text - * @param string|null $onlyPrefix - * - * @return string - */ protected function parseTranslation(string $text, ?string $onlyPrefix = null) : string{ $newString = ""; diff --git a/src/lang/TextContainer.php b/src/lang/TextContainer.php index 557fa2f5e..e2265bc82 100644 --- a/src/lang/TextContainer.php +++ b/src/lang/TextContainer.php @@ -28,30 +28,18 @@ class TextContainer{ /** @var string $text */ protected $text; - /** - * @param string $text - */ public function __construct(string $text){ $this->text = $text; } - /** - * @param string $text - */ public function setText(string $text) : void{ $this->text = $text; } - /** - * @return string - */ public function getText() : string{ return $this->text; } - /** - * @return string - */ public function __toString() : string{ return $this->getText(); } diff --git a/src/lang/TranslationContainer.php b/src/lang/TranslationContainer.php index 7091d6d85..ccbb7f1b8 100644 --- a/src/lang/TranslationContainer.php +++ b/src/lang/TranslationContainer.php @@ -29,7 +29,6 @@ class TranslationContainer extends TextContainer{ protected $params = []; /** - * @param string $text * @param (float|int|string)[] $params */ public function __construct(string $text, array $params = []){ @@ -50,11 +49,6 @@ class TranslationContainer extends TextContainer{ return $this->params; } - /** - * @param int $i - * - * @return string|null - */ public function getParameter(int $i) : ?string{ return $this->params[$i] ?? null; } diff --git a/src/network/AdvancedNetworkInterface.php b/src/network/AdvancedNetworkInterface.php index 42c1ef62d..db18361b3 100644 --- a/src/network/AdvancedNetworkInterface.php +++ b/src/network/AdvancedNetworkInterface.php @@ -35,37 +35,25 @@ interface AdvancedNetworkInterface extends NetworkInterface{ /** * Prevents packets received from the IP address getting processed for the given timeout. * - * @param string $address * @param int $timeout Seconds */ public function blockAddress(string $address, int $timeout = 300) : void; /** * Unblocks a previously-blocked address. - * - * @param string $address */ public function unblockAddress(string $address) : void; - /** - * @param Network $network - */ public function setNetwork(Network $network) : void; /** * Sends a raw payload to the network interface, bypassing any sessions. - * - * @param string $address - * @param int $port - * @param string $payload */ public function sendRawPacket(string $address, int $port, string $payload) : void; /** * Adds a regex filter for raw packets to this network interface. This filter should be used to check validity of * raw packets before relaying them to the main thread. - * - * @param string $regex */ public function addRawPacketFilter(string $regex) : void; } diff --git a/src/network/Network.php b/src/network/Network.php index 7f14e8149..320d45be5 100644 --- a/src/network/Network.php +++ b/src/network/Network.php @@ -94,9 +94,6 @@ class Network{ return $this->interfaces; } - /** - * @return NetworkSessionManager - */ public function getSessionManager() : NetworkSessionManager{ return $this->sessionManager; } @@ -113,9 +110,6 @@ class Network{ $this->sessionManager->tick(); } - /** - * @param NetworkInterface $interface - */ public function registerInterface(NetworkInterface $interface) : void{ $ev = new NetworkInterfaceRegisterEvent($interface); $ev->call(); @@ -134,7 +128,6 @@ class Network{ } /** - * @param NetworkInterface $interface * @throws \InvalidArgumentException */ public function unregisterInterface(NetworkInterface $interface) : void{ @@ -148,8 +141,6 @@ class Network{ /** * Sets the server name shown on each interface Query - * - * @param string $name */ public function setName(string $name) : void{ $this->name = $name; @@ -158,9 +149,6 @@ class Network{ } } - /** - * @return string - */ public function getName() : string{ return $this->name; } @@ -171,11 +159,6 @@ class Network{ } } - /** - * @param string $address - * @param int $port - * @param string $payload - */ public function sendPacket(string $address, int $port, string $payload) : void{ foreach($this->advancedInterfaces as $interface){ $interface->sendRawPacket($address, $port, $payload); @@ -184,9 +167,6 @@ class Network{ /** * Blocks an IP address from the main interface. Setting timeout to -1 will block it forever - * - * @param string $address - * @param int $timeout */ public function blockAddress(string $address, int $timeout = 300) : void{ $this->bannedIps[$address] = $timeout > 0 ? time() + $timeout : PHP_INT_MAX; @@ -204,8 +184,6 @@ class Network{ /** * Registers a raw packet handler on the network. - * - * @param RawPacketHandler $handler */ public function registerRawPacketHandler(RawPacketHandler $handler) : void{ $this->rawPacketHandlers[spl_object_id($handler)] = $handler; @@ -218,19 +196,11 @@ class Network{ /** * Unregisters a previously-registered raw packet handler. - * - * @param RawPacketHandler $handler */ public function unregisterRawPacketHandler(RawPacketHandler $handler) : void{ unset($this->rawPacketHandlers[spl_object_id($handler)]); } - /** - * @param AdvancedNetworkInterface $interface - * @param string $address - * @param int $port - * @param string $packet - */ public function processRawPacket(AdvancedNetworkInterface $interface, string $address, int $port, string $packet) : void{ if(isset($this->bannedIps[$address]) and time() < $this->bannedIps[$address]){ $this->logger->debug("Dropped raw packet from banned address $address $port"); diff --git a/src/network/NetworkInterface.php b/src/network/NetworkInterface.php index 47241c341..146a7351c 100644 --- a/src/network/NetworkInterface.php +++ b/src/network/NetworkInterface.php @@ -36,9 +36,6 @@ interface NetworkInterface{ */ public function start() : void; - /** - * @param string $name - */ public function setName(string $name) : void; /** diff --git a/src/network/NetworkSessionManager.php b/src/network/NetworkSessionManager.php index 179ba38db..9024ba41f 100644 --- a/src/network/NetworkSessionManager.php +++ b/src/network/NetworkSessionManager.php @@ -37,8 +37,6 @@ class NetworkSessionManager{ /** * Adds a network session to the manager. This should only be called on session creation. - * - * @param NetworkSession $session */ public function add(NetworkSession $session) : void{ $idx = spl_object_id($session); @@ -48,8 +46,6 @@ class NetworkSessionManager{ /** * Removes the given network session, due to disconnect. This should only be called by a network session on * disconnection. - * - * @param NetworkSession $session */ public function remove(NetworkSession $session) : void{ $idx = spl_object_id($session); @@ -58,8 +54,6 @@ class NetworkSessionManager{ /** * Requests an update to be scheduled on the given network session at the next tick. - * - * @param NetworkSession $session */ public function scheduleUpdate(NetworkSession $session) : void{ $this->updateSessions[spl_object_id($session)] = $session; @@ -69,8 +63,6 @@ class NetworkSessionManager{ * Checks whether this network session is a duplicate of an already-connected session (same player connecting from * 2 locations). * - * @param NetworkSession $connectingSession - * * @return bool if the network session is still connected. */ public function kickDuplicates(NetworkSession $connectingSession) : bool{ @@ -96,8 +88,6 @@ class NetworkSessionManager{ /** * Returns the number of known connected sessions. - * - * @return int */ public function getSessionCount() : int{ return count($this->sessions); @@ -116,8 +106,6 @@ class NetworkSessionManager{ /** * Terminates all connected sessions with the given reason. - * - * @param string $reason */ public function close(string $reason = "") : void{ foreach($this->sessions as $session){ diff --git a/src/network/RawPacketHandler.php b/src/network/RawPacketHandler.php index e73d1f30e..5ee01672c 100644 --- a/src/network/RawPacketHandler.php +++ b/src/network/RawPacketHandler.php @@ -28,18 +28,10 @@ interface RawPacketHandler{ /** * Returns a preg_match() compatible regex pattern used to filter packets on this handler. Only packets matching * this pattern will be delivered to the handler. - * - * @return string */ public function getPattern() : string; /** - * @param AdvancedNetworkInterface $interface - * @param string $address - * @param int $port - * @param string $packet - * - * @return bool * @throws BadPacketException */ public function handle(AdvancedNetworkInterface $interface, string $address, int $port, string $packet) : bool; diff --git a/src/network/mcpe/ChunkCache.php b/src/network/mcpe/ChunkCache.php index e204b1b28..7ca9cde57 100644 --- a/src/network/mcpe/ChunkCache.php +++ b/src/network/mcpe/ChunkCache.php @@ -45,8 +45,6 @@ class ChunkCache implements ChunkListener{ /** * Fetches the ChunkCache instance for the given world. This lazily creates cache systems as needed. * - * @param World $world - * * @return ChunkCache */ public static function getInstance(World $world) : self{ @@ -64,9 +62,6 @@ class ChunkCache implements ChunkListener{ /** @var int */ private $misses = 0; - /** - * @param World $world - */ private function __construct(World $world){ $this->world = $world; } @@ -74,9 +69,6 @@ class ChunkCache implements ChunkListener{ /** * Requests asynchronous preparation of the chunk at the given coordinates. * - * @param int $chunkX - * @param int $chunkZ - * * @return CompressBatchPromise a promise of resolution which will contain a compressed chunk packet. */ public function request(int $chunkX, int $chunkZ) : CompressBatchPromise{ @@ -125,9 +117,6 @@ class ChunkCache implements ChunkListener{ /** * Restarts an async request for an unresolved chunk. * - * @param int $chunkX - * @param int $chunkZ - * * @throws \InvalidArgumentException */ private function restartPendingRequest(int $chunkX, int $chunkZ) : void{ @@ -143,9 +132,6 @@ class ChunkCache implements ChunkListener{ } /** - * @param int $chunkX - * @param int $chunkZ - * * @throws \InvalidArgumentException */ private function destroyOrRestart(int $chunkX, int $chunkZ) : void{ @@ -170,7 +156,6 @@ class ChunkCache implements ChunkListener{ /** * @see ChunkListener::onChunkChanged() - * @param Chunk $chunk */ public function onChunkChanged(Chunk $chunk) : void{ //FIXME: this gets fired for stuff that doesn't change terrain related things (like lighting updates) @@ -179,7 +164,6 @@ class ChunkCache implements ChunkListener{ /** * @see ChunkListener::onBlockChanged() - * @param Vector3 $block */ public function onBlockChanged(Vector3 $block) : void{ //FIXME: requesters will still receive this chunk after it's been dropped, but we can't mark this for a simple @@ -189,7 +173,6 @@ class ChunkCache implements ChunkListener{ /** * @see ChunkListener::onChunkUnloaded() - * @param Chunk $chunk */ public function onChunkUnloaded(Chunk $chunk) : void{ $this->destroy($chunk->getX(), $chunk->getZ()); @@ -199,8 +182,6 @@ class ChunkCache implements ChunkListener{ /** * Returns the number of bytes occupied by the cache data in this cache. This does not include the size of any * promises referenced by the cache. - * - * @return int */ public function calculateCacheSize() : int{ $result = 0; @@ -214,8 +195,6 @@ class ChunkCache implements ChunkListener{ /** * Returns the percentage of requests to the cache which resulted in a cache hit. - * - * @return float */ public function getHitPercentage() : float{ $total = $this->hits + $this->misses; diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index ca613441d..bc65f64bb 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -205,7 +205,6 @@ class NetworkSession{ /** * TODO: this shouldn't be accessible after the initial login phase * - * @param PlayerInfo $info * @throws \InvalidStateException */ public function setPlayerInfo(PlayerInfo $info) : void{ @@ -221,16 +220,10 @@ class NetworkSession{ return $this->connected; } - /** - * @return string - */ public function getIp() : string{ return $this->ip; } - /** - * @return int - */ public function getPort() : int{ return $this->port; } @@ -241,8 +234,6 @@ class NetworkSession{ /** * Returns the last recorded ping measurement for this session, in milliseconds. - * - * @return int */ public function getPing() : int{ return $this->ping; @@ -250,8 +241,6 @@ class NetworkSession{ /** * @internal Called by the network interface to update last recorded ping measurements. - * - * @param int $ping */ public function updatePing(int $ping) : void{ $this->ping = $ping; @@ -269,8 +258,6 @@ class NetworkSession{ } /** - * @param string $payload - * * @throws BadPacketException */ public function handleEncoded(string $payload) : void{ @@ -323,8 +310,6 @@ class NetworkSession{ } /** - * @param Packet $packet - * * @throws BadPacketException */ public function handleDataPacket(Packet $packet) : void{ @@ -384,7 +369,6 @@ class NetworkSession{ /** * @internal - * @param ClientboundPacket $packet */ public function addToSendBuffer(ClientboundPacket $packet) : void{ $timings = Timings::getSendDataPacketTimings($packet); @@ -462,9 +446,6 @@ class NetworkSession{ /** * Disconnects the session, destroying the associated player (if it exists). - * - * @param string $reason - * @param bool $notify */ public function disconnect(string $reason, bool $notify = true) : void{ $this->tryDisconnect(function() use ($reason, $notify){ @@ -478,10 +459,6 @@ class NetworkSession{ /** * Instructs the remote client to connect to a different server. * - * @param string $ip - * @param int $port - * @param string $reason - * * @throws \UnsupportedOperationException */ public function transfer(string $ip, int $port, string $reason = "transfer") : void{ @@ -497,9 +474,6 @@ class NetworkSession{ /** * Called by the Player when it is closed (for example due to getting kicked). - * - * @param string $reason - * @param bool $notify */ public function onPlayerDestroyed(string $reason, bool $notify = true) : void{ $this->tryDisconnect(function() use ($reason, $notify){ @@ -509,9 +483,6 @@ class NetworkSession{ /** * Internal helper function used to handle server disconnections. - * - * @param string $reason - * @param bool $notify */ private function doServerDisconnect(string $reason, bool $notify = true) : void{ if($notify){ @@ -524,8 +495,6 @@ class NetworkSession{ /** * Called by the network interface to close the session when the client disconnects without server input, for * example in a timeout condition or voluntary client disconnect. - * - * @param string $reason */ public function onClientDisconnect(string $reason) : void{ $this->tryDisconnect(function() use ($reason){ @@ -662,8 +631,6 @@ class NetworkSession{ /** * TODO: make this less specialized - * - * @param Player $for */ public function syncAdventureSettings(Player $for) : void{ $pk = new AdventureSettingsPacket(); @@ -763,8 +730,6 @@ class NetworkSession{ /** * Instructs the networksession to start using the chunk at the given coordinates. This may occur asynchronously. - * @param int $chunkX - * @param int $chunkZ * @param \Closure $onCompletion To be called when chunk sending has completed. */ public function startUsingChunk(int $chunkX, int $chunkZ, \Closure $onCompletion) : void{ @@ -805,9 +770,6 @@ class NetworkSession{ $world->sendDifficulty($this->player); } - /** - * @return InventoryManager - */ public function getInvManager() : InventoryManager{ return $this->invManager; } @@ -815,8 +777,6 @@ class NetworkSession{ /** * TODO: expand this to more than just humans * TODO: offhand - * - * @param Human $mob */ public function onMobEquipmentChange(Human $mob) : void{ //TODO: we could send zero for slot here because remote players don't need to know which slot was selected @@ -891,9 +851,6 @@ class NetworkSession{ * This function takes care of handling gamemodes known to MCPE (as of 1.1.0.3, that includes Survival, Creative and Adventure) * * @internal - * @param GameMode $gamemode - * - * @return int */ public static function getClientFriendlyGamemode(GameMode $gamemode) : int{ if($gamemode->equals(GameMode::SPECTATOR())){ diff --git a/src/network/mcpe/PacketBatch.php b/src/network/mcpe/PacketBatch.php index 31c081418..aab0b9319 100644 --- a/src/network/mcpe/PacketBatch.php +++ b/src/network/mcpe/PacketBatch.php @@ -36,7 +36,6 @@ class PacketBatch extends NetworkBinaryStream{ } /** - * @return Packet * @throws BinaryDataException */ public function getPacket() : Packet{ diff --git a/src/network/mcpe/PacketSender.php b/src/network/mcpe/PacketSender.php index 857293ffb..00ff20296 100644 --- a/src/network/mcpe/PacketSender.php +++ b/src/network/mcpe/PacketSender.php @@ -27,16 +27,11 @@ interface PacketSender{ /** * Pushes a packet into the channel to be processed. - * - * @param string $payload - * @param bool $immediate */ public function send(string $payload, bool $immediate) : void; /** * Closes the channel, terminating the connection. - * - * @param string $reason */ public function close(string $reason = "unknown reason") : void; } diff --git a/src/network/mcpe/auth/ProcessLoginTask.php b/src/network/mcpe/auth/ProcessLoginTask.php index 1cf855d2f..2baf79263 100644 --- a/src/network/mcpe/auth/ProcessLoginTask.php +++ b/src/network/mcpe/auth/ProcessLoginTask.php @@ -111,10 +111,6 @@ class ProcessLoginTask extends AsyncTask{ } /** - * @param string $jwt - * @param null|string $currentPublicKey - * @param bool $first - * * @throws VerifyLoginException if errors are encountered */ private function validateToken(string $jwt, ?string &$currentPublicKey, bool $first = false) : void{ diff --git a/src/network/mcpe/compression/CompressBatchPromise.php b/src/network/mcpe/compression/CompressBatchPromise.php index 709734f84..f1d6c777e 100644 --- a/src/network/mcpe/compression/CompressBatchPromise.php +++ b/src/network/mcpe/compression/CompressBatchPromise.php @@ -82,9 +82,6 @@ class CompressBatchPromise{ return $this->result !== null; } - /** - * @return bool - */ public function isCancelled() : bool{ return $this->cancelled; } diff --git a/src/network/mcpe/compression/CompressBatchTask.php b/src/network/mcpe/compression/CompressBatchTask.php index 62aa9a037..e4012d8e0 100644 --- a/src/network/mcpe/compression/CompressBatchTask.php +++ b/src/network/mcpe/compression/CompressBatchTask.php @@ -34,11 +34,6 @@ class CompressBatchTask extends AsyncTask{ /** @var string */ private $data; - /** - * @param string $data - * @param int $compressionLevel - * @param CompressBatchPromise $promise - */ public function __construct(string $data, int $compressionLevel, CompressBatchPromise $promise){ $this->data = $data; $this->level = $compressionLevel; diff --git a/src/network/mcpe/compression/Zlib.php b/src/network/mcpe/compression/Zlib.php index 05a44987f..7c84adb70 100644 --- a/src/network/mcpe/compression/Zlib.php +++ b/src/network/mcpe/compression/Zlib.php @@ -38,10 +38,8 @@ final class Zlib{ } /** - * @param string $payload * @param int $maxDecodedLength default 2MB * - * @return string * @throws \ErrorException */ public static function decompress(string $payload, int $maxDecodedLength = 1024 * 1024 * 2) : string{ @@ -49,10 +47,7 @@ final class Zlib{ } /** - * @param string $payload * @param int $compressionLevel - * - * @return string */ public static function compress(string $payload, ?int $compressionLevel = null) : string{ return zlib_encode($payload, ZLIB_ENCODING_DEFLATE, $compressionLevel ?? self::$LEVEL); diff --git a/src/network/mcpe/encryption/NetworkCipher.php b/src/network/mcpe/encryption/NetworkCipher.php index 0b9c25a0f..4afebce38 100644 --- a/src/network/mcpe/encryption/NetworkCipher.php +++ b/src/network/mcpe/encryption/NetworkCipher.php @@ -65,9 +65,6 @@ class NetworkCipher{ } /** - * @param string $encrypted - * - * @return string * @throws \UnexpectedValueException */ public function decrypt(string $encrypted) : string{ diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index ffffc526d..ca443c289 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -319,9 +319,6 @@ class InGamePacketHandler extends PacketHandler{ /** * Internal function used to execute rollbacks when an action fails on a block. - * - * @param Vector3 $blockPos - * @param int|null $face */ private function onFailedBlockAction(Vector3 $blockPos, ?int $face) : void{ $this->session->getInvManager()->syncSlot($this->player->getInventory(), $this->player->getInventory()->getHeldItemIndex()); @@ -685,9 +682,6 @@ class InGamePacketHandler extends PacketHandler{ /** * Hack to work around a stupid bug in Minecraft W10 which causes empty strings to be sent unquoted in form responses. * - * @param string $json - * @param bool $assoc - * * @return mixed * @throws BadPacketException */ diff --git a/src/network/mcpe/handler/LoginPacketHandler.php b/src/network/mcpe/handler/LoginPacketHandler.php index a439ed4be..f0d6876fc 100644 --- a/src/network/mcpe/handler/LoginPacketHandler.php +++ b/src/network/mcpe/handler/LoginPacketHandler.php @@ -151,9 +151,6 @@ class LoginPacketHandler extends PacketHandler{ * TODO: This is separated for the purposes of allowing plugins (like Specter) to hack it and bypass authentication. * In the future this won't be necessary. * - * @param LoginPacket $packet - * @param bool $authRequired - * * @throws \InvalidArgumentException */ protected function processLogin(LoginPacket $packet, bool $authRequired) : void{ diff --git a/src/network/mcpe/protocol/AddEntityPacket.php b/src/network/mcpe/protocol/AddEntityPacket.php index e8a42ec73..b4e0694f0 100644 --- a/src/network/mcpe/protocol/AddEntityPacket.php +++ b/src/network/mcpe/protocol/AddEntityPacket.php @@ -39,9 +39,6 @@ class AddEntityPacket extends DataPacket implements ClientboundPacket{ return $result; } - /** - * @return int - */ public function getUvarint1() : int{ return $this->uvarint1; } diff --git a/src/network/mcpe/protocol/AvailableCommandsPacket.php b/src/network/mcpe/protocol/AvailableCommandsPacket.php index 5705fee0e..e7b8847d8 100644 --- a/src/network/mcpe/protocol/AvailableCommandsPacket.php +++ b/src/network/mcpe/protocol/AvailableCommandsPacket.php @@ -150,7 +150,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ /** * @param string[] $enumValueList * - * @return CommandEnum * @throws BadPacketException * @throws BinaryDataException */ @@ -173,7 +172,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ } /** - * @return CommandEnum * @throws BinaryDataException */ protected function getSoftEnum() : CommandEnum{ @@ -189,7 +187,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ } /** - * @param CommandEnum $enum * @param int[] $enumValueMap */ protected function putEnum(CommandEnum $enum, array $enumValueMap) : void{ @@ -218,9 +215,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ } /** - * @param int $valueCount - * - * @return int * @throws BinaryDataException */ protected function getEnumValueIndex(int $valueCount) : int{ @@ -247,7 +241,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ * @param CommandEnum[] $enums * @param string[] $enumValues * - * @return CommandEnumConstraint * @throws BadPacketException * @throws BinaryDataException */ @@ -276,7 +269,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ } /** - * @param CommandEnumConstraint $constraint * @param int[] $enumIndexes string enum name -> int index * @param int[] $enumValueIndexes string value -> int index */ @@ -293,7 +285,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ * @param CommandEnum[] $enums * @param string[] $postfixes * - * @return CommandData * @throws BadPacketException * @throws BinaryDataException */ @@ -338,7 +329,6 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ } /** - * @param CommandData $data * @param int[] $enumIndexes string enum name -> int index * @param int[] $postfixIndexes */ diff --git a/src/network/mcpe/protocol/ClientCacheBlobStatusPacket.php b/src/network/mcpe/protocol/ClientCacheBlobStatusPacket.php index 35693516c..d67cc00c2 100644 --- a/src/network/mcpe/protocol/ClientCacheBlobStatusPacket.php +++ b/src/network/mcpe/protocol/ClientCacheBlobStatusPacket.php @@ -39,8 +39,6 @@ class ClientCacheBlobStatusPacket extends DataPacket implements ServerboundPacke /** * @param int[] $hitHashes * @param int[] $missHashes - * - * @return self */ public static function create(array $hitHashes, array $missHashes) : self{ //type checks diff --git a/src/network/mcpe/protocol/ClientCacheMissResponsePacket.php b/src/network/mcpe/protocol/ClientCacheMissResponsePacket.php index d973aa59f..b77cf169b 100644 --- a/src/network/mcpe/protocol/ClientCacheMissResponsePacket.php +++ b/src/network/mcpe/protocol/ClientCacheMissResponsePacket.php @@ -37,8 +37,6 @@ class ClientCacheMissResponsePacket extends DataPacket implements ClientboundPac /** * @param ChunkCacheBlob[] $blobs - * - * @return self */ public static function create(array $blobs) : self{ //type check diff --git a/src/network/mcpe/protocol/ClientCacheStatusPacket.php b/src/network/mcpe/protocol/ClientCacheStatusPacket.php index cfa97c8e2..ec42d5cfc 100644 --- a/src/network/mcpe/protocol/ClientCacheStatusPacket.php +++ b/src/network/mcpe/protocol/ClientCacheStatusPacket.php @@ -39,9 +39,6 @@ class ClientCacheStatusPacket extends DataPacket implements ServerboundPacket{ return $result; } - /** - * @return bool - */ public function isEnabled() : bool{ return $this->enabled; } diff --git a/src/network/mcpe/protocol/CommandOutputPacket.php b/src/network/mcpe/protocol/CommandOutputPacket.php index 36ac89a2c..313933b64 100644 --- a/src/network/mcpe/protocol/CommandOutputPacket.php +++ b/src/network/mcpe/protocol/CommandOutputPacket.php @@ -60,7 +60,6 @@ class CommandOutputPacket extends DataPacket implements ClientboundPacket{ } /** - * @return CommandOutputMessage * @throws BinaryDataException */ protected function getCommandMessage() : CommandOutputMessage{ diff --git a/src/network/mcpe/protocol/CraftingDataPacket.php b/src/network/mcpe/protocol/CraftingDataPacket.php index d1d4c75db..8ac5b2cf8 100644 --- a/src/network/mcpe/protocol/CraftingDataPacket.php +++ b/src/network/mcpe/protocol/CraftingDataPacket.php @@ -163,10 +163,6 @@ class CraftingDataPacket extends DataPacket implements ClientboundPacket{ /** * @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){ diff --git a/src/network/mcpe/protocol/EmotePacket.php b/src/network/mcpe/protocol/EmotePacket.php index 923cde076..9bf12c330 100644 --- a/src/network/mcpe/protocol/EmotePacket.php +++ b/src/network/mcpe/protocol/EmotePacket.php @@ -49,7 +49,6 @@ class EmotePacket extends DataPacket implements ClientboundPacket, ServerboundPa /** * 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; diff --git a/src/network/mcpe/protocol/InventoryContentPacket.php b/src/network/mcpe/protocol/InventoryContentPacket.php index 5aaa29b15..2054dc732 100644 --- a/src/network/mcpe/protocol/InventoryContentPacket.php +++ b/src/network/mcpe/protocol/InventoryContentPacket.php @@ -38,7 +38,6 @@ class InventoryContentPacket extends DataPacket implements ClientboundPacket{ public $items = []; /** - * @param int $windowId * @param Item[] $items * * @return InventoryContentPacket diff --git a/src/network/mcpe/protocol/LevelChunkPacket.php b/src/network/mcpe/protocol/LevelChunkPacket.php index 5689dff69..213d1847b 100644 --- a/src/network/mcpe/protocol/LevelChunkPacket.php +++ b/src/network/mcpe/protocol/LevelChunkPacket.php @@ -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; } diff --git a/src/network/mcpe/protocol/LevelEventGenericPacket.php b/src/network/mcpe/protocol/LevelEventGenericPacket.php index d462b407e..1c6c0eaec 100644 --- a/src/network/mcpe/protocol/LevelEventGenericPacket.php +++ b/src/network/mcpe/protocol/LevelEventGenericPacket.php @@ -45,16 +45,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; } diff --git a/src/network/mcpe/protocol/LoginPacket.php b/src/network/mcpe/protocol/LoginPacket.php index a594af388..8ae9f09be 100644 --- a/src/network/mcpe/protocol/LoginPacket.php +++ b/src/network/mcpe/protocol/LoginPacket.php @@ -109,8 +109,6 @@ class LoginPacket extends DataPacket implements ServerboundPacket{ } /** - * @param Validator $v - * @param string $name * @param mixed $data * * @throws BadPacketException diff --git a/src/network/mcpe/protocol/MoveActorDeltaPacket.php b/src/network/mcpe/protocol/MoveActorDeltaPacket.php index be7abc1c1..304ab1d17 100644 --- a/src/network/mcpe/protocol/MoveActorDeltaPacket.php +++ b/src/network/mcpe/protocol/MoveActorDeltaPacket.php @@ -56,9 +56,6 @@ class MoveActorDeltaPacket extends DataPacket implements ClientboundPacket{ public $zRot = 0.0; /** - * @param int $flag - * - * @return int * @throws BinaryDataException */ private function maybeReadCoord(int $flag) : int{ @@ -69,9 +66,6 @@ class MoveActorDeltaPacket extends DataPacket implements ClientboundPacket{ } /** - * @param int $flag - * - * @return float * @throws BinaryDataException */ private function maybeReadRotation(int $flag) : float{ diff --git a/src/network/mcpe/protocol/Packet.php b/src/network/mcpe/protocol/Packet.php index e54489f81..6e6803872 100644 --- a/src/network/mcpe/protocol/Packet.php +++ b/src/network/mcpe/protocol/Packet.php @@ -34,9 +34,6 @@ interface Packet{ * TODO: this can't have a native return type yet because of incompatibility with BinaryUtils * really this should be addressed by making packets not extend BinaryStream, but that's a task for another day. * - * @param string $buffer - * @param int $offset - * * @return void */ public function setBuffer(string $buffer = "", int $offset = 0); @@ -47,7 +44,6 @@ interface Packet{ /** * Returns whether the offset has reached the end of the buffer. - * @return bool */ public function feof() : bool; @@ -74,8 +70,6 @@ interface Packet{ * Typically this method returns the return value of the handler in the supplied PacketHandler. See other packets * for examples how to implement this. * - * @param PacketHandler $handler - * * @return bool true if the packet was handled successfully, false if not. * @throws BadPacketException if broken data was found in the packet */ diff --git a/src/network/mcpe/protocol/PacketPool.php b/src/network/mcpe/protocol/PacketPool.php index 1e265a262..e8b05db98 100644 --- a/src/network/mcpe/protocol/PacketPool.php +++ b/src/network/mcpe/protocol/PacketPool.php @@ -177,26 +177,15 @@ class PacketPool{ static::registerPacket(new PlayerAuthInputPacket()); } - /** - * @param Packet $packet - */ public static function registerPacket(Packet $packet) : void{ static::$pool[$packet->pid()] = clone $packet; } - /** - * @param int $pid - * - * @return Packet - */ public static function getPacketById(int $pid) : Packet{ return isset(static::$pool[$pid]) ? clone static::$pool[$pid] : new UnknownPacket(); } /** - * @param string $buffer - * - * @return Packet * @throws BinaryDataException */ public static function getPacket(string $buffer) : Packet{ diff --git a/src/network/mcpe/protocol/PlayerAuthInputPacket.php b/src/network/mcpe/protocol/PlayerAuthInputPacket.php index 0b80ff076..9ab85d79e 100644 --- a/src/network/mcpe/protocol/PlayerAuthInputPacket.php +++ b/src/network/mcpe/protocol/PlayerAuthInputPacket.php @@ -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; diff --git a/src/network/mcpe/protocol/RemoveEntityPacket.php b/src/network/mcpe/protocol/RemoveEntityPacket.php index a4cdf96b4..9b052ae50 100644 --- a/src/network/mcpe/protocol/RemoveEntityPacket.php +++ b/src/network/mcpe/protocol/RemoveEntityPacket.php @@ -39,9 +39,6 @@ class RemoveEntityPacket extends DataPacket implements ClientboundPacket{ return $result; } - /** - * @return int - */ public function getUvarint1() : int{ return $this->uvarint1; } diff --git a/src/network/mcpe/protocol/ResourcePackStackPacket.php b/src/network/mcpe/protocol/ResourcePackStackPacket.php index f0792c0d0..69d168402 100644 --- a/src/network/mcpe/protocol/ResourcePackStackPacket.php +++ b/src/network/mcpe/protocol/ResourcePackStackPacket.php @@ -50,8 +50,6 @@ class ResourcePackStackPacket extends DataPacket implements ClientboundPacket{ /** * @param ResourcePackStackEntry[] $resourcePacks * @param ResourcePackStackEntry[] $behaviorPacks - * @param bool $mustAccept - * @param bool $isExperimental * * @return ResourcePackStackPacket */ diff --git a/src/network/mcpe/protocol/ResourcePacksInfoPacket.php b/src/network/mcpe/protocol/ResourcePacksInfoPacket.php index 16113b7d7..753d60486 100644 --- a/src/network/mcpe/protocol/ResourcePacksInfoPacket.php +++ b/src/network/mcpe/protocol/ResourcePacksInfoPacket.php @@ -45,8 +45,6 @@ class ResourcePacksInfoPacket extends DataPacket implements ClientboundPacket{ /** * @param ResourcePackInfoEntry[] $resourcePacks * @param ResourcePackInfoEntry[] $behaviorPacks - * @param bool $mustAccept - * @param bool $hasScripts * * @return ResourcePacksInfoPacket */ diff --git a/src/network/mcpe/protocol/TextPacket.php b/src/network/mcpe/protocol/TextPacket.php index de646852d..b167e2a19 100644 --- a/src/network/mcpe/protocol/TextPacket.php +++ b/src/network/mcpe/protocol/TextPacket.php @@ -79,7 +79,6 @@ class TextPacket extends DataPacket implements ClientboundPacket, ServerboundPac } /** - * @param string $key * @param string[] $parameters * * @return TextPacket @@ -93,7 +92,6 @@ class TextPacket extends DataPacket implements ClientboundPacket, ServerboundPac } /** - * @param string $key * @param string[] $parameters * * @return TextPacket @@ -103,7 +101,6 @@ class TextPacket extends DataPacket implements ClientboundPacket, ServerboundPac } /** - * @param string $key * @param string[] $parameters * * @return TextPacket diff --git a/src/network/mcpe/protocol/UpdateAttributesPacket.php b/src/network/mcpe/protocol/UpdateAttributesPacket.php index 576671903..de37371e3 100644 --- a/src/network/mcpe/protocol/UpdateAttributesPacket.php +++ b/src/network/mcpe/protocol/UpdateAttributesPacket.php @@ -39,7 +39,6 @@ class UpdateAttributesPacket extends DataPacket implements ClientboundPacket{ public $entries = []; /** - * @param int $entityRuntimeId * @param Attribute[] $attributes * * @return UpdateAttributesPacket diff --git a/src/network/mcpe/protocol/types/ChunkCacheBlob.php b/src/network/mcpe/protocol/types/ChunkCacheBlob.php index acf09f35f..a20137620 100644 --- a/src/network/mcpe/protocol/types/ChunkCacheBlob.php +++ b/src/network/mcpe/protocol/types/ChunkCacheBlob.php @@ -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; } diff --git a/src/network/mcpe/protocol/types/RuntimeBlockMapping.php b/src/network/mcpe/protocol/types/RuntimeBlockMapping.php index bee2f9c19..0269a23f8 100644 --- a/src/network/mcpe/protocol/types/RuntimeBlockMapping.php +++ b/src/network/mcpe/protocol/types/RuntimeBlockMapping.php @@ -128,12 +128,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(); /* @@ -145,8 +139,6 @@ final class RuntimeBlockMapping{ } /** - * @param int $runtimeId - * * @return int[] [id, meta] */ public static function fromStaticRuntimeId(int $runtimeId) : array{ diff --git a/src/network/mcpe/protocol/types/SkinAdapter.php b/src/network/mcpe/protocol/types/SkinAdapter.php index f030f4488..357d7c2ab 100644 --- a/src/network/mcpe/protocol/types/SkinAdapter.php +++ b/src/network/mcpe/protocol/types/SkinAdapter.php @@ -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; } diff --git a/src/network/mcpe/protocol/types/SkinAnimation.php b/src/network/mcpe/protocol/types/SkinAnimation.php index 0f6726cf7..40a9e9624 100644 --- a/src/network/mcpe/protocol/types/SkinAnimation.php +++ b/src/network/mcpe/protocol/types/SkinAnimation.php @@ -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; diff --git a/src/network/mcpe/protocol/types/SkinData.php b/src/network/mcpe/protocol/types/SkinData.php index 0e46d0a4f..6ff6dfda8 100644 --- a/src/network/mcpe/protocol/types/SkinData.php +++ b/src/network/mcpe/protocol/types/SkinData.php @@ -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; } diff --git a/src/network/mcpe/protocol/types/command/CommandData.php b/src/network/mcpe/protocol/types/command/CommandData.php index 7bfc70354..5b3ec8fe0 100644 --- a/src/network/mcpe/protocol/types/command/CommandData.php +++ b/src/network/mcpe/protocol/types/command/CommandData.php @@ -38,11 +38,6 @@ class CommandData{ public $overloads = []; /** - * @param string $name - * @param string $description - * @param int $flags - * @param int $permission - * @param CommandEnum|null $aliases * @param CommandParameter[][] $overloads */ public function __construct(string $name, string $description, int $flags, int $permission, ?CommandEnum $aliases, array $overloads){ @@ -59,37 +54,22 @@ class CommandData{ $this->overloads = $overloads; } - /** - * @return string - */ public function getName() : string{ return $this->name; } - /** - * @return string - */ public function getDescription() : string{ return $this->description; } - /** - * @return int - */ public function getFlags() : int{ return $this->flags; } - /** - * @return int - */ public function getPermission() : int{ return $this->permission; } - /** - * @return CommandEnum|null - */ public function getAliases() : ?CommandEnum{ return $this->aliases; } diff --git a/src/network/mcpe/protocol/types/command/CommandEnum.php b/src/network/mcpe/protocol/types/command/CommandEnum.php index 2a46c260b..dfaf39e5b 100644 --- a/src/network/mcpe/protocol/types/command/CommandEnum.php +++ b/src/network/mcpe/protocol/types/command/CommandEnum.php @@ -30,7 +30,6 @@ class CommandEnum{ private $enumValues = []; /** - * @param string $enumName * @param string[] $enumValues */ public function __construct(string $enumName, array $enumValues){ @@ -38,9 +37,6 @@ class CommandEnum{ $this->enumValues = $enumValues; } - /** - * @return string - */ public function getName() : string{ return $this->enumName; } diff --git a/src/network/mcpe/protocol/types/command/CommandEnumConstraint.php b/src/network/mcpe/protocol/types/command/CommandEnumConstraint.php index ff4ad523f..8f78094b9 100644 --- a/src/network/mcpe/protocol/types/command/CommandEnumConstraint.php +++ b/src/network/mcpe/protocol/types/command/CommandEnumConstraint.php @@ -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){ diff --git a/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php b/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php index ebf88b110..ae8ffe562 100644 --- a/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php @@ -31,16 +31,10 @@ final class BlockPosMetadataProperty implements MetadataProperty{ /** @var Vector3 */ private $value; - /** - * @param Vector3 $value - */ public function __construct(Vector3 $value){ $this->value = $value->floor(); } - /** - * @return Vector3 - */ public function getValue() : Vector3{ return $this->value; } diff --git a/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php b/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php index 4c1c73841..62ecda9b4 100644 --- a/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php @@ -34,16 +34,10 @@ final class CompoundTagMetadataProperty implements MetadataProperty{ /** @var CompoundTag */ private $value; - /** - * @param CompoundTag $value - */ public function __construct(CompoundTag $value){ $this->value = clone $value; } - /** - * @return CompoundTag - */ public function getValue() : CompoundTag{ return clone $this->value; } @@ -57,9 +51,6 @@ final class CompoundTagMetadataProperty implements MetadataProperty{ } /** - * @param NetworkBinaryStream $in - * - * @return self * @throws BadPacketException */ public static function read(NetworkBinaryStream $in) : self{ diff --git a/src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php b/src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php index 3fa0ea9dd..c096143a9 100644 --- a/src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php +++ b/src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php @@ -38,93 +38,43 @@ class EntityMetadataCollection{ } - /** - * @param int $key - * @param int $value - * @param bool $force - */ public function setByte(int $key, int $value, bool $force = false) : void{ $this->set($key, new ByteMetadataProperty($value), $force); } - /** - * @param int $key - * @param int $value - * @param bool $force - */ public function setShort(int $key, int $value, bool $force = false) : void{ $this->set($key, new ShortMetadataProperty($value), $force); } - /** - * @param int $key - * @param int $value - * @param bool $force - */ public function setInt(int $key, int $value, bool $force = false) : void{ $this->set($key, new IntMetadataProperty($value), $force); } - /** - * @param int $key - * @param float $value - * @param bool $force - */ public function setFloat(int $key, float $value, bool $force = false) : void{ $this->set($key, new FloatMetadataProperty($value), $force); } - /** - * @param int $key - * @param string $value - * @param bool $force - */ public function setString(int $key, string $value, bool $force = false) : void{ $this->set($key, new StringMetadataProperty($value), $force); } - /** - * @param int $key - * @param CompoundTag $value - * @param bool $force - */ public function setCompoundTag(int $key, CompoundTag $value, bool $force = false) : void{ $this->set($key, new CompoundTagMetadataProperty($value), $force); } - /** - * @param int $key - * @param null|Vector3 $value - * @param bool $force - */ public function setBlockPos(int $key, ?Vector3 $value, bool $force = false) : void{ $this->set($key, new BlockPosMetadataProperty($value ?? new Vector3(0, 0, 0)), $force); } - /** - * @param int $key - * @param int $value - * @param bool $force - */ public function setLong(int $key, int $value, bool $force = false) : void{ $this->set($key, new LongMetadataProperty($value), $force); } - /** - * @param int $key - * @param null|Vector3 $value - * @param bool $force - */ public function setVector3(int $key, ?Vector3 $value, bool $force = false) : void{ $this->set($key, new Vec3MetadataProperty($value ?? new Vector3(0, 0, 0)), $force); } - /** - * @param int $key - * @param MetadataProperty $value - * @param bool $force - */ public function set(int $key, MetadataProperty $value, bool $force = false) : void{ if(!$force and isset($this->properties[$key]) and !($this->properties[$key] instanceof $value)){ throw new \InvalidArgumentException("Can't overwrite property with mismatching types (have " . get_class($this->properties[$key]) . ")"); diff --git a/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php b/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php index faf256111..afe8705cb 100644 --- a/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php @@ -30,16 +30,10 @@ final class FloatMetadataProperty implements MetadataProperty{ /** @var float */ private $value; - /** - * @param float $value - */ public function __construct(float $value){ $this->value = $value; } - /** - * @return float - */ public function getValue() : float{ return $this->value; } diff --git a/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php b/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php index dad794140..298e229b4 100644 --- a/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php @@ -27,9 +27,6 @@ trait IntegerishMetadataProperty{ /** @var int */ private $value; - /** - * @param int $value - */ public function __construct(int $value){ if($value < $this->min() or $value > $this->max()){ throw new \InvalidArgumentException("Value is out of range " . $this->min() . " - " . $this->max()); @@ -41,9 +38,6 @@ trait IntegerishMetadataProperty{ abstract protected function max() : int; - /** - * @return int - */ public function getValue() : int{ return $this->value; } diff --git a/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php b/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php index 846410a00..9c8ca620f 100644 --- a/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php @@ -29,9 +29,6 @@ final class StringMetadataProperty implements MetadataProperty{ /** @var string */ private $value; - /** - * @param string $value - */ public function __construct(string $value){ $this->value = $value; } diff --git a/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php b/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php index 7115d42c5..bc4ec5a7c 100644 --- a/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php @@ -30,16 +30,10 @@ class Vec3MetadataProperty implements MetadataProperty{ /** @var Vector3 */ private $value; - /** - * @param Vector3 $value - */ public function __construct(Vector3 $value){ $this->value = $value->asVector3(); } - /** - * @return Vector3 - */ public function getValue() : Vector3{ return clone $this->value; } diff --git a/src/network/mcpe/protocol/types/inventory/NetworkInventoryAction.php b/src/network/mcpe/protocol/types/inventory/NetworkInventoryAction.php index b1ceb9fe4..a4a2f46b8 100644 --- a/src/network/mcpe/protocol/types/inventory/NetworkInventoryAction.php +++ b/src/network/mcpe/protocol/types/inventory/NetworkInventoryAction.php @@ -88,8 +88,6 @@ class NetworkInventoryAction{ public $newItem; /** - * @param NetworkBinaryStream $packet - * * @return $this * * @throws BinaryDataException @@ -122,8 +120,6 @@ class NetworkInventoryAction{ } /** - * @param NetworkBinaryStream $packet - * * @throws \InvalidArgumentException */ public function write(NetworkBinaryStream $packet) : void{ @@ -151,10 +147,6 @@ class NetworkInventoryAction{ } /** - * @param Player $player - * - * @return InventoryAction|null - * * @throws \UnexpectedValueException */ public function createInventoryAction(Player $player) : ?InventoryAction{ diff --git a/src/network/mcpe/protocol/types/inventory/ReleaseItemTransactionData.php b/src/network/mcpe/protocol/types/inventory/ReleaseItemTransactionData.php index 48f45312b..d6274454b 100644 --- a/src/network/mcpe/protocol/types/inventory/ReleaseItemTransactionData.php +++ b/src/network/mcpe/protocol/types/inventory/ReleaseItemTransactionData.php @@ -41,30 +41,18 @@ class ReleaseItemTransactionData extends TransactionData{ /** @var Vector3 */ private $headPos; - /** - * @return int - */ public function getActionType() : int{ return $this->actionType; } - /** - * @return int - */ public function getHotbarSlot() : int{ return $this->hotbarSlot; } - /** - * @return Item - */ public function getItemInHand() : Item{ return $this->itemInHand; } - /** - * @return Vector3 - */ public function getHeadPos() : Vector3{ return $this->headPos; } diff --git a/src/network/mcpe/protocol/types/inventory/TransactionData.php b/src/network/mcpe/protocol/types/inventory/TransactionData.php index a58d03780..28c49010c 100644 --- a/src/network/mcpe/protocol/types/inventory/TransactionData.php +++ b/src/network/mcpe/protocol/types/inventory/TransactionData.php @@ -39,14 +39,9 @@ abstract class TransactionData{ return $this->actions; } - /** - * @return int - */ abstract public function getTypeId() : int; /** - * @param NetworkBinaryStream $stream - * * @throws BinaryDataException * @throws BadPacketException */ @@ -59,8 +54,6 @@ abstract class TransactionData{ } /** - * @param NetworkBinaryStream $stream - * * @throws BinaryDataException * @throws BadPacketException */ diff --git a/src/network/mcpe/protocol/types/inventory/UseItemOnEntityTransactionData.php b/src/network/mcpe/protocol/types/inventory/UseItemOnEntityTransactionData.php index cf1aac04f..f487fee24 100644 --- a/src/network/mcpe/protocol/types/inventory/UseItemOnEntityTransactionData.php +++ b/src/network/mcpe/protocol/types/inventory/UseItemOnEntityTransactionData.php @@ -45,44 +45,26 @@ class UseItemOnEntityTransactionData extends TransactionData{ /** @var Vector3 */ private $clickPos; - /** - * @return int - */ public function getEntityRuntimeId() : int{ return $this->entityRuntimeId; } - /** - * @return int - */ public function getActionType() : int{ return $this->actionType; } - /** - * @return int - */ public function getHotbarSlot() : int{ return $this->hotbarSlot; } - /** - * @return Item - */ public function getItemInHand() : Item{ return $this->itemInHand; } - /** - * @return Vector3 - */ public function getPlayerPos() : Vector3{ return $this->playerPos; } - /** - * @return Vector3 - */ public function getClickPos() : Vector3{ return $this->clickPos; } diff --git a/src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php b/src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php index 06edaf809..261b1c874 100644 --- a/src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php +++ b/src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php @@ -50,58 +50,34 @@ class UseItemTransactionData extends TransactionData{ /** @var int */ private $blockRuntimeId; - /** - * @return int - */ public function getActionType() : int{ return $this->actionType; } - /** - * @return Vector3 - */ public function getBlockPos() : Vector3{ return $this->blockPos; } - /** - * @return int - */ public function getFace() : int{ return $this->face; } - /** - * @return int - */ public function getHotbarSlot() : int{ return $this->hotbarSlot; } - /** - * @return Item - */ public function getItemInHand() : Item{ return $this->itemInHand; } - /** - * @return Vector3 - */ public function getPlayerPos() : Vector3{ return $this->playerPos; } - /** - * @return Vector3 - */ public function getClickPos() : Vector3{ return $this->clickPos; } - /** - * @return int - */ public function getBlockRuntimeId() : int{ return $this->blockRuntimeId; } diff --git a/src/network/mcpe/protocol/types/resourcepacks/ResourcePackInfoEntry.php b/src/network/mcpe/protocol/types/resourcepacks/ResourcePackInfoEntry.php index e8331fbd3..387790814 100644 --- a/src/network/mcpe/protocol/types/resourcepacks/ResourcePackInfoEntry.php +++ b/src/network/mcpe/protocol/types/resourcepacks/ResourcePackInfoEntry.php @@ -52,51 +52,30 @@ class ResourcePackInfoEntry{ $this->hasScripts = $hasScripts; } - /** - * @return string - */ public function getPackId() : string{ return $this->packId; } - /** - * @return string - */ public function getVersion() : string{ return $this->version; } - /** - * @return int - */ public function getSizeBytes() : int{ return $this->sizeBytes; } - /** - * @return string - */ public function getEncryptionKey() : string{ return $this->encryptionKey; } - /** - * @return string - */ public function getSubPackName() : string{ return $this->subPackName; } - /** - * @return string - */ public function getContentId() : string{ return $this->contentId; } - /** - * @return bool - */ public function hasScripts() : bool{ return $this->hasScripts; } diff --git a/src/network/mcpe/protocol/types/resourcepacks/ResourcePackStackEntry.php b/src/network/mcpe/protocol/types/resourcepacks/ResourcePackStackEntry.php index 843a87ce5..85ebfd92d 100644 --- a/src/network/mcpe/protocol/types/resourcepacks/ResourcePackStackEntry.php +++ b/src/network/mcpe/protocol/types/resourcepacks/ResourcePackStackEntry.php @@ -40,23 +40,14 @@ class ResourcePackStackEntry{ $this->subPackName = $subPackName; } - /** - * @return string - */ public function getPackId() : string{ return $this->packId; } - /** - * @return string - */ public function getVersion() : string{ return $this->version; } - /** - * @return string - */ public function getSubPackName() : string{ return $this->subPackName; } diff --git a/src/network/mcpe/serializer/ChunkSerializer.php b/src/network/mcpe/serializer/ChunkSerializer.php index d7c17a92b..a1d00f37d 100644 --- a/src/network/mcpe/serializer/ChunkSerializer.php +++ b/src/network/mcpe/serializer/ChunkSerializer.php @@ -38,9 +38,6 @@ final class ChunkSerializer{ /** * Returns the number of subchunks that will be sent from the given chunk. * Chunks are sent in a stack, so every chunk below the top non-empty one must be sent. - * @param Chunk $chunk - * - * @return int */ public static function getSubChunkCount(Chunk $chunk) : int{ for($count = $chunk->getSubChunks()->count(); $count > 0; --$count){ @@ -53,13 +50,6 @@ final class ChunkSerializer{ return $count; } - /** - * @param Chunk $chunk - * - * @param string|null $tiles - * - * @return string - */ public static function serialize(Chunk $chunk, ?string $tiles = null) : string{ $stream = new NetworkBinaryStream(); $subChunkCount = self::getSubChunkCount($chunk); diff --git a/src/network/mcpe/serializer/NetworkBinaryStream.php b/src/network/mcpe/serializer/NetworkBinaryStream.php index bc29ec588..df6670150 100644 --- a/src/network/mcpe/serializer/NetworkBinaryStream.php +++ b/src/network/mcpe/serializer/NetworkBinaryStream.php @@ -64,7 +64,6 @@ class NetworkBinaryStream extends BinaryStream{ private const DAMAGE_TAG_CONFLICT_RESOLUTION = "___Damage_ProtocolCollisionResolution___"; /** - * @return string * @throws BinaryDataException */ public function getString() : string{ @@ -77,7 +76,6 @@ class NetworkBinaryStream extends BinaryStream{ } /** - * @return UUID * @throws BinaryDataException */ public function getUUID() : UUID{ @@ -162,8 +160,6 @@ class NetworkBinaryStream extends BinaryStream{ } /** - * @return Item - * * @throws BadPacketException * @throws BinaryDataException */ @@ -401,7 +397,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Reads and returns an EntityUniqueID - * @return int * * @throws BinaryDataException */ @@ -411,8 +406,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes an EntityUniqueID - * - * @param int $eid */ public function putEntityUniqueId(int $eid) : void{ $this->putVarLong($eid); @@ -420,7 +413,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Reads and returns an EntityRuntimeID - * @return int * * @throws BinaryDataException */ @@ -430,8 +422,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes an EntityRuntimeID - * - * @param int $eid */ public function putEntityRuntimeId(int $eid) : void{ $this->putUnsignedVarLong($eid); @@ -454,10 +444,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes a block position with unsigned Y coordinate. - * - * @param int $x - * @param int $y - * @param int $z */ public function putBlockPosition(int $x, int $y, int $z) : void{ $this->putVarInt($x); @@ -482,10 +468,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes a block position with a signed Y coordinate. - * - * @param int $x - * @param int $y - * @param int $z */ public function putSignedBlockPosition(int $x, int $y, int $z) : void{ $this->putVarInt($x); @@ -496,8 +478,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Reads a floating-point Vector3 object with coordinates rounded to 4 decimal places. * - * @return Vector3 - * * @throws BinaryDataException */ public function getVector3() : Vector3{ @@ -515,8 +495,6 @@ class NetworkBinaryStream extends BinaryStream{ * For all other purposes, use the non-nullable version. * * @see NetworkBinaryStream::putVector3() - * - * @param Vector3|null $vector */ public function putVector3Nullable(?Vector3 $vector) : void{ if($vector){ @@ -530,8 +508,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes a floating-point Vector3 object - * - * @param Vector3 $vector */ public function putVector3(Vector3 $vector) : void{ $this->putLFloat($vector->x); @@ -540,7 +516,6 @@ class NetworkBinaryStream extends BinaryStream{ } /** - * @return float * @throws BinaryDataException */ public function getByteRotation() : float{ @@ -590,8 +565,6 @@ class NetworkBinaryStream extends BinaryStream{ /** * Writes a gamerule array, members should be in the structure [name => [type, value]] * TODO: implement this properly - * - * @param array $rules */ public function putGameRules(array $rules) : void{ $this->putUnsignedVarInt(count($rules)); @@ -615,8 +588,6 @@ class NetworkBinaryStream extends BinaryStream{ } /** - * @return EntityLink - * * @throws BinaryDataException */ protected function getEntityLink() : EntityLink{ @@ -630,9 +601,6 @@ class NetworkBinaryStream extends BinaryStream{ return $link; } - /** - * @param EntityLink $link - */ protected function putEntityLink(EntityLink $link) : void{ $this->putEntityUniqueId($link->fromEntityUniqueId); $this->putEntityUniqueId($link->toEntityUniqueId); @@ -641,7 +609,6 @@ class NetworkBinaryStream extends BinaryStream{ } /** - * @return CommandOriginData * @throws BinaryDataException */ protected function getCommandOriginData() : CommandOriginData{ diff --git a/src/network/query/QueryHandler.php b/src/network/query/QueryHandler.php index 36d6bef55..47941e27c 100644 --- a/src/network/query/QueryHandler.php +++ b/src/network/query/QueryHandler.php @@ -86,14 +86,6 @@ class QueryHandler implements RawPacketHandler{ return Binary::readInt(substr(hash("sha512", $salt . ":" . $token, true), 7, 4)); } - /** - * @param AdvancedNetworkInterface $interface - * @param string $address - * @param int $port - * @param string $packet - * - * @return bool - */ public function handle(AdvancedNetworkInterface $interface, string $address, int $port, string $packet) : bool{ try{ $stream = new BinaryStream($packet); diff --git a/src/permission/BanEntry.php b/src/permission/BanEntry.php index 1d7422409..6dd3ee032 100644 --- a/src/permission/BanEntry.php +++ b/src/permission/BanEntry.php @@ -63,8 +63,6 @@ class BanEntry{ } /** - * @param \DateTime $date - * * @throws \InvalidArgumentException */ public function setCreated(\DateTime $date) : void{ @@ -80,15 +78,11 @@ class BanEntry{ $this->source = $source; } - /** - * @return \DateTime|null - */ public function getExpires() : ?\DateTime{ return $this->expirationDate; } /** - * @param \DateTime|null $date * @throws \InvalidArgumentException */ public function setExpires(?\DateTime $date) : void{ @@ -134,8 +128,6 @@ class BanEntry{ * * @link https://bugs.php.net/bug.php?id=75992 * - * @param \DateTime $dateTime - * * @throws \InvalidArgumentException if the argument can't be parsed from a formatted date string */ private static function validateDate(\DateTime $dateTime) : void{ @@ -147,9 +139,6 @@ class BanEntry{ } /** - * @param string $date - * - * @return \DateTime * @throws \RuntimeException */ private static function parseDate(string $date) : \DateTime{ @@ -162,9 +151,6 @@ class BanEntry{ } /** - * @param string $str - * - * @return BanEntry|null * @throws \RuntimeException */ public static function fromString(string $str) : ?BanEntry{ diff --git a/src/permission/BanList.php b/src/permission/BanList.php index f3e4ee63b..3b08a5991 100644 --- a/src/permission/BanList.php +++ b/src/permission/BanList.php @@ -42,32 +42,18 @@ class BanList{ /** @var bool */ private $enabled = true; - /** - * @param string $file - */ public function __construct(string $file){ $this->file = $file; } - /** - * @return bool - */ public function isEnabled() : bool{ return $this->enabled; } - /** - * @param bool $flag - */ public function setEnabled(bool $flag) : void{ $this->enabled = $flag; } - /** - * @param string $name - * - * @return BanEntry|null - */ public function getEntry(string $name) : ?BanEntry{ $this->removeExpired(); @@ -83,11 +69,6 @@ class BanList{ return $this->list; } - /** - * @param string $name - * - * @return bool - */ public function isBanned(string $name) : bool{ $name = strtolower($name); if(!$this->isEnabled()){ @@ -99,21 +80,15 @@ class BanList{ } } - /** - * @param BanEntry $entry - */ public function add(BanEntry $entry) : void{ $this->list[$entry->getName()] = $entry; $this->save(); } /** - * @param string $target * @param string $reason * @param \DateTime $expires * @param string $source - * - * @return BanEntry */ public function addBan(string $target, ?string $reason = null, ?\DateTime $expires = null, ?string $source = null) : BanEntry{ $entry = new BanEntry($target); @@ -127,9 +102,6 @@ class BanList{ return $entry; } - /** - * @param string $name - */ public function remove(string $name) : void{ $name = strtolower($name); if(isset($this->list[$name])){ @@ -170,9 +142,6 @@ class BanList{ } } - /** - * @param bool $writeHeader - */ public function save(bool $writeHeader = true) : void{ $this->removeExpired(); $fp = @fopen($this->file, "w"); diff --git a/src/permission/DefaultPermissions.php b/src/permission/DefaultPermissions.php index ea25519c7..4daed435e 100644 --- a/src/permission/DefaultPermissions.php +++ b/src/permission/DefaultPermissions.php @@ -27,10 +27,7 @@ abstract class DefaultPermissions{ public const ROOT = "pocketmine"; /** - * @param Permission $perm * @param Permission $parent - * - * @return Permission */ public static function registerPermission(Permission $perm, ?Permission $parent = null) : Permission{ if($parent instanceof Permission){ diff --git a/src/permission/Permissible.php b/src/permission/Permissible.php index a9065bc4c..74874512f 100644 --- a/src/permission/Permissible.php +++ b/src/permission/Permissible.php @@ -31,8 +31,6 @@ interface Permissible extends ServerOperator{ * Checks if this instance has a permission overridden * * @param string|Permission $name - * - * @return bool */ public function isPermissionSet($name) : bool; @@ -40,31 +38,17 @@ interface Permissible extends ServerOperator{ * Returns the permission value if overridden, or the default value if not * * @param string|Permission $name - * - * @return bool */ public function hasPermission($name) : bool; /** - * @param Plugin $plugin * @param string $name * @param bool $value - * - * @return PermissionAttachment */ public function addAttachment(Plugin $plugin, ?string $name = null, ?bool $value = null) : PermissionAttachment; - /** - * @param PermissionAttachment $attachment - * - * @return void - */ public function removeAttachment(PermissionAttachment $attachment) : void; - - /** - * @return void - */ public function recalculatePermissions() : void; /** diff --git a/src/permission/PermissibleBase.php b/src/permission/PermissibleBase.php index 3e2a96eea..12d6519a0 100644 --- a/src/permission/PermissibleBase.php +++ b/src/permission/PermissibleBase.php @@ -45,9 +45,6 @@ class PermissibleBase implements Permissible{ */ private $permissions = []; - /** - * @param ServerOperator $opable - */ public function __construct(ServerOperator $opable){ $this->opable = $opable; if($opable instanceof Permissible){ @@ -55,24 +52,16 @@ class PermissibleBase implements Permissible{ } } - /** - * @return bool - */ public function isOp() : bool{ return $this->opable->isOp(); } - /** - * @param bool $value - */ public function setOp(bool $value) : void{ $this->opable->setOp($value); } /** * @param Permission|string $name - * - * @return bool */ public function isPermissionSet($name) : bool{ return isset($this->permissions[$name instanceof Permission ? $name->getName() : $name]); @@ -80,8 +69,6 @@ class PermissibleBase implements Permissible{ /** * @param Permission|string $name - * - * @return bool */ public function hasPermission($name) : bool{ if($name instanceof Permission){ @@ -105,11 +92,8 @@ class PermissibleBase implements Permissible{ /** * //TODO: tick scheduled attachments * - * @param Plugin $plugin * @param string $name * @param bool $value - * - * @return PermissionAttachment */ public function addAttachment(Plugin $plugin, ?string $name = null, ?bool $value = null) : PermissionAttachment{ if(!$plugin->isEnabled()){ @@ -127,9 +111,6 @@ class PermissibleBase implements Permissible{ return $result; } - /** - * @param PermissionAttachment $attachment - */ public function removeAttachment(PermissionAttachment $attachment) : void{ if(isset($this->attachments[spl_object_id($attachment)])){ unset($this->attachments[spl_object_id($attachment)]); @@ -177,8 +158,6 @@ class PermissibleBase implements Permissible{ /** * @param bool[] $children - * @param bool $invert - * @param PermissionAttachment|null $attachment */ private function calculateChildPermissions(array $children, bool $invert, ?PermissionAttachment $attachment) : void{ $permManager = PermissionManager::getInstance(); diff --git a/src/permission/PermissibleDelegateTrait.php b/src/permission/PermissibleDelegateTrait.php index a6bab9e4c..371651973 100644 --- a/src/permission/PermissibleDelegateTrait.php +++ b/src/permission/PermissibleDelegateTrait.php @@ -30,11 +30,8 @@ trait PermissibleDelegateTrait{ /** @var PermissibleBase */ private $perm = null; - /** * @param Permission|string $name - * - * @return bool */ public function isPermissionSet($name) : bool{ return $this->perm->isPermissionSet($name); @@ -42,27 +39,19 @@ trait PermissibleDelegateTrait{ /** * @param Permission|string $name - * - * @return bool */ public function hasPermission($name) : bool{ return $this->perm->hasPermission($name); } /** - * @param Plugin $plugin * @param string $name * @param bool $value - * - * @return PermissionAttachment */ public function addAttachment(Plugin $plugin, ?string $name = null, ?bool $value = null) : PermissionAttachment{ return $this->perm->addAttachment($plugin, $name, $value); } - /** - * @param PermissionAttachment $attachment - */ public function removeAttachment(PermissionAttachment $attachment) : void{ $this->perm->removeAttachment($attachment); } diff --git a/src/permission/Permission.php b/src/permission/Permission.php index adca9f5a1..63228658b 100644 --- a/src/permission/Permission.php +++ b/src/permission/Permission.php @@ -56,7 +56,6 @@ class Permission{ /** * Creates a new Permission object to be attached to Permissible objects * - * @param string $name * @param string $description * @param string $defaultValue * @param bool[] $children @@ -70,9 +69,6 @@ class Permission{ $this->recalculatePermissibles(); } - /** - * @return string - */ public function getName() : string{ return $this->name; } @@ -84,16 +80,10 @@ class Permission{ return $this->children; } - /** - * @return string - */ public function getDefault() : string{ return $this->defaultValue; } - /** - * @param string $value - */ public function setDefault(string $value) : void{ if($value !== $this->defaultValue){ $this->defaultValue = $value; @@ -101,16 +91,10 @@ class Permission{ } } - /** - * @return string - */ public function getDescription() : string{ return $this->description; } - /** - * @param string $value - */ public function setDescription(string $value) : void{ $this->description = $value; } @@ -132,10 +116,8 @@ class Permission{ } } - /** * @param string|Permission $name - * @param bool $value * * @return Permission|null Permission if $name is a string, null if it's a Permission */ diff --git a/src/permission/PermissionAttachment.php b/src/permission/PermissionAttachment.php index 769750371..adea70919 100644 --- a/src/permission/PermissionAttachment.php +++ b/src/permission/PermissionAttachment.php @@ -42,9 +42,6 @@ class PermissionAttachment{ private $plugin; /** - * @param Plugin $plugin - * @param Permissible $permissible - * * @throws PluginException */ public function __construct(Plugin $plugin, Permissible $permissible){ @@ -56,30 +53,18 @@ class PermissionAttachment{ $this->plugin = $plugin; } - /** - * @return Plugin - */ public function getPlugin() : Plugin{ return $this->plugin; } - /** - * @param PermissionRemovedExecutor $ex - */ public function setRemovalCallback(PermissionRemovedExecutor $ex) : void{ $this->removed = $ex; } - /** - * @return PermissionRemovedExecutor|null - */ public function getRemovalCallback() : ?PermissionRemovedExecutor{ return $this->removed; } - /** - * @return Permissible - */ public function getPermissible() : Permissible{ return $this->permissible; } @@ -118,7 +103,6 @@ class PermissionAttachment{ /** * @param string|Permission $name - * @param bool $value */ public function setPermission($name, bool $value) : void{ $name = $name instanceof Permission ? $name->getName() : $name; @@ -143,9 +127,6 @@ class PermissionAttachment{ } } - /** - * @return void - */ public function remove() : void{ $this->permissible->removeAttachment($this); } diff --git a/src/permission/PermissionAttachmentInfo.php b/src/permission/PermissionAttachmentInfo.php index 002a480d4..57297a11c 100644 --- a/src/permission/PermissionAttachmentInfo.php +++ b/src/permission/PermissionAttachmentInfo.php @@ -38,11 +38,6 @@ class PermissionAttachmentInfo{ private $value; /** - * @param Permissible $permissible - * @param string $permission - * @param PermissionAttachment|null $attachment - * @param bool $value - * * @throws \InvalidStateException */ public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){ @@ -52,30 +47,18 @@ class PermissionAttachmentInfo{ $this->value = $value; } - /** - * @return Permissible - */ public function getPermissible() : Permissible{ return $this->permissible; } - /** - * @return string - */ public function getPermission() : string{ return $this->permission; } - /** - * @return PermissionAttachment|null - */ public function getAttachment() : ?PermissionAttachment{ return $this->attachment; } - /** - * @return bool - */ public function getValue() : bool{ return $this->value; } diff --git a/src/permission/PermissionManager.php b/src/permission/PermissionManager.php index fd1100877..b0c57373f 100644 --- a/src/permission/PermissionManager.php +++ b/src/permission/PermissionManager.php @@ -52,20 +52,10 @@ class PermissionManager{ /** @var Permissible[] */ protected $defSubsOp = []; - /** - * @param string $name - * - * @return null|Permission - */ public function getPermission(string $name) : ?Permission{ return $this->permissions[$name] ?? null; } - /** - * @param Permission $permission - * - * @return bool - */ public function addPermission(Permission $permission) : bool{ if(!isset($this->permissions[$permission->getName()])){ $this->permissions[$permission->getName()] = $permission; @@ -89,8 +79,6 @@ class PermissionManager{ } /** - * @param bool $op - * * @return Permission[] */ public function getDefaultPermissions(bool $op) : array{ @@ -101,9 +89,6 @@ class PermissionManager{ } } - /** - * @param Permission $permission - */ public function recalculatePermissionDefaults(Permission $permission) : void{ if(isset($this->permissions[$permission->getName()])){ unset($this->defaultPermsOp[$permission->getName()]); @@ -112,9 +97,6 @@ class PermissionManager{ } } - /** - * @param Permission $permission - */ private function calculatePermissionDefault(Permission $permission) : void{ Timings::$permissionDefaultTimer->startTiming(); if($permission->getDefault() === Permission::DEFAULT_OP or $permission->getDefault() === Permission::DEFAULT_TRUE){ @@ -129,19 +111,12 @@ class PermissionManager{ Timings::$permissionDefaultTimer->startTiming(); } - /** - * @param bool $op - */ private function dirtyPermissibles(bool $op) : void{ foreach($this->getDefaultPermSubscriptions($op) as $p){ $p->recalculatePermissions(); } } - /** - * @param string $permission - * @param Permissible $permissible - */ public function subscribeToPermission(string $permission, Permissible $permissible) : void{ if(!isset($this->permSubs[$permission])){ $this->permSubs[$permission] = []; @@ -149,10 +124,6 @@ class PermissionManager{ $this->permSubs[$permission][spl_object_id($permissible)] = $permissible; } - /** - * @param string $permission - * @param Permissible $permissible - */ public function unsubscribeFromPermission(string $permission, Permissible $permissible) : void{ if(isset($this->permSubs[$permission])){ unset($this->permSubs[$permission][spl_object_id($permissible)]); @@ -162,9 +133,6 @@ class PermissionManager{ } } - /** - * @param Permissible $permissible - */ public function unsubscribeFromAllPermissions(Permissible $permissible) : void{ foreach($this->permSubs as $permission => &$subs){ unset($subs[spl_object_id($permissible)]); @@ -175,18 +143,12 @@ class PermissionManager{ } /** - * @param string $permission - * * @return array|Permissible[] */ public function getPermissionSubscriptions(string $permission) : array{ return $this->permSubs[$permission] ?? []; } - /** - * @param bool $op - * @param Permissible $permissible - */ public function subscribeToDefaultPerms(bool $op, Permissible $permissible) : void{ if($op){ $this->defSubsOp[spl_object_id($permissible)] = $permissible; @@ -195,10 +157,6 @@ class PermissionManager{ } } - /** - * @param bool $op - * @param Permissible $permissible - */ public function unsubscribeFromDefaultPerms(bool $op, Permissible $permissible) : void{ if($op){ unset($this->defSubsOp[spl_object_id($permissible)]); @@ -208,8 +166,6 @@ class PermissionManager{ } /** - * @param bool $op - * * @return Permissible[] */ public function getDefaultPermSubscriptions(bool $op) : array{ diff --git a/src/permission/PermissionParser.php b/src/permission/PermissionParser.php index bf9d83840..36c4182bf 100644 --- a/src/permission/PermissionParser.php +++ b/src/permission/PermissionParser.php @@ -33,8 +33,6 @@ class PermissionParser{ /** * @param bool|string $value * - * @return string - * * @throws \InvalidArgumentException */ public static function defaultFromString($value) : string{ @@ -72,9 +70,6 @@ class PermissionParser{ } /** - * @param array $data - * @param string $default - * * @return Permission[] */ public static function loadPermissions(array $data, string $default = Permission::DEFAULT_OP) : array{ @@ -87,13 +82,6 @@ class PermissionParser{ } /** - * @param string $name - * @param array $data - * @param string $default - * @param array $output - * - * @return Permission - * * @throws \Exception */ public static function loadPermission(string $name, array $data, string $default = Permission::DEFAULT_OP, array &$output = []) : Permission{ @@ -127,8 +115,6 @@ class PermissionParser{ /** * @param Permission[] $permissions - * - * @return array */ public static function emitPermissions(array $permissions) : array{ $result = []; diff --git a/src/permission/PermissionRemovedExecutor.php b/src/permission/PermissionRemovedExecutor.php index 0298f1bfa..71076d94d 100644 --- a/src/permission/PermissionRemovedExecutor.php +++ b/src/permission/PermissionRemovedExecutor.php @@ -26,10 +26,5 @@ namespace pocketmine\permission; interface PermissionRemovedExecutor{ - /** - * @param PermissionAttachment $attachment - * - * @return void - */ public function attachmentRemoved(PermissionAttachment $attachment) : void; } diff --git a/src/permission/ServerOperator.php b/src/permission/ServerOperator.php index 55601af28..c9fe3afd8 100644 --- a/src/permission/ServerOperator.php +++ b/src/permission/ServerOperator.php @@ -27,15 +27,11 @@ namespace pocketmine\permission; interface ServerOperator{ /** * Checks if the current object has operator permissions - * - * @return bool */ public function isOp() : bool; /** * Sets the operator permission for the current object - * - * @param bool $value */ public function setOp(bool $value) : void; } diff --git a/src/player/GameMode.php b/src/player/GameMode.php index b294dd5ae..7b99f5a81 100644 --- a/src/player/GameMode.php +++ b/src/player/GameMode.php @@ -70,8 +70,6 @@ final class GameMode{ } /** - * @param int $n - * * @return GameMode * @throws \InvalidArgumentException */ @@ -100,23 +98,14 @@ final class GameMode{ $this->aliases = $aliases; } - /** - * @return int - */ public function getMagicNumber() : int{ return $this->magicNumber; } - /** - * @return string - */ public function getEnglishName() : string{ return $this->englishName; } - /** - * @return string - */ public function getTranslationKey() : string{ return "%" . $this->translationKey; } diff --git a/src/player/IPlayer.php b/src/player/IPlayer.php index 5ba416891..66609474a 100644 --- a/src/player/IPlayer.php +++ b/src/player/IPlayer.php @@ -27,54 +27,24 @@ use pocketmine\permission\ServerOperator; interface IPlayer extends ServerOperator{ - /** - * @return bool - */ public function isOnline() : bool; - /** - * @return string - */ public function getName() : string; - /** - * @return bool - */ public function isBanned() : bool; - /** - * @param bool $banned - */ public function setBanned(bool $banned) : void; - /** - * @return bool - */ public function isWhitelisted() : bool; - /** - * @param bool $value - */ public function setWhitelisted(bool $value) : void; - /** - * @return Player|null - */ public function getPlayer() : ?Player; - /** - * @return int|null - */ public function getFirstPlayed() : ?int; - /** - * @return int|null - */ public function getLastPlayed() : ?int; - /** - * @return bool - */ public function hasPlayedBefore() : bool; } diff --git a/src/player/OfflinePlayer.php b/src/player/OfflinePlayer.php index 8dcca0a88..a85b657c9 100644 --- a/src/player/OfflinePlayer.php +++ b/src/player/OfflinePlayer.php @@ -36,10 +36,6 @@ class OfflinePlayer implements IPlayer{ /** @var CompoundTag|null */ private $namedtag = null; - /** - * @param Server $server - * @param string $name - */ public function __construct(Server $server, string $name){ $this->server = $server; $this->name = $name; diff --git a/src/player/Player.php b/src/player/Player.php index fe1989d13..49f9f1bf3 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -138,8 +138,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * Validates the given username. * * @param string $name - * - * @return bool */ public static function isValidUserName(?string $name) : bool{ if($name === null){ @@ -248,12 +246,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** @var \Logger */ protected $logger; - /** - * @param Server $server - * @param NetworkSession $session - * @param PlayerInfo $playerInfo - * @param bool $authenticated - */ public function __construct(Server $server, NetworkSession $session, PlayerInfo $playerInfo, bool $authenticated){ $username = TextFormat::clean($playerInfo->getUsername()); $this->logger = new \PrefixedLogger($server->getLogger(), "Player: $username"); @@ -412,8 +404,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * If the player is logged into Xbox Live, returns their Xbox user ID (XUID) as a string. Returns an empty string if * the player is not logged into Xbox Live. - * - * @return string */ public function getXuid() : string{ return $this->xuid; @@ -433,8 +423,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * (In the olden days this method used to return a fake UUID computed by the server, which was used by plugins such * as SimpleAuth for authentication. This is NOT SAFE anymore as this UUID is now what was given by the client, NOT * a server-computed UUID.) - * - * @return UUID */ public function getUniqueId() : UUID{ return parent::getUniqueId(); @@ -446,7 +434,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * TODO: not sure this should be nullable - * @return int|null */ public function getFirstPlayed() : ?int{ return $this->firstPlayed; @@ -454,7 +441,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * TODO: not sure this should be nullable - * @return int|null */ public function getLastPlayed() : ?int{ return $this->lastPlayed; @@ -494,32 +480,20 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, return $this->autoJump; } - /** - * @param Player $player - */ public function spawnTo(Player $player) : void{ if($this->isAlive() and $player->isAlive() and $player->getWorld() === $this->getWorld() and $player->canSee($this) and !$this->isSpectator()){ parent::spawnTo($player); } } - /** - * @return Server - */ public function getServer() : Server{ return $this->server; } - /** - * @return bool - */ public function getRemoveFormat() : bool{ return $this->removeFormat; } - /** - * @param bool $remove - */ public function setRemoveFormat(bool $remove = true) : void{ $this->removeFormat = $remove; } @@ -535,18 +509,10 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $this->lineHeight = $height; } - /** - * @param Player $player - * - * @return bool - */ public function canSee(Player $player) : bool{ return !isset($this->hiddenPlayers[$player->getUniqueId()->toBinary()]); } - /** - * @param Player $player - */ public function hidePlayer(Player $player) : void{ if($player === $this){ return; @@ -555,9 +521,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $player->despawnFrom($this); } - /** - * @param Player $player - */ public function showPlayer(Player $player) : void{ if($player === $this){ return; @@ -597,23 +560,14 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $this->logger->debug("Setting view distance to " . $this->viewDistance . " (requested " . $distance . ")"); } - /** - * @return bool - */ public function isOnline() : bool{ return $this->isConnected(); } - /** - * @return bool - */ public function isOp() : bool{ return $this->server->isOp($this->getName()); } - /** - * @param bool $value - */ public function setOp(bool $value) : void{ if($value === $this->isOp()){ return; @@ -651,23 +605,16 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } } - /** - * @return bool - */ public function isConnected() : bool{ return $this->networkSession !== null and $this->networkSession->isConnected(); } - /** - * @return NetworkSession - */ public function getNetworkSession() : NetworkSession{ return $this->networkSession; } /** * Gets the username - * @return string */ public function getName() : string{ return $this->username; @@ -675,23 +622,17 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns the "friendly" display name of this player to use in the chat. - * - * @return string */ public function getDisplayName() : string{ return $this->displayName; } - /** - * @param string $name - */ public function setDisplayName(string $name) : void{ $this->displayName = $name; } /** * Returns the player's locale, e.g. en_US. - * @return string */ public function getLocale() : string{ return $this->locale; @@ -700,12 +641,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Called when a player changes their skin. * Plugin developers should not use this, use setSkin() and sendSkin() instead. - * - * @param Skin $skin - * @param string $newSkinName - * @param string $oldSkinName - * - * @return bool */ public function changeSkin(Skin $skin, string $newSkinName, string $oldSkinName) : bool{ $ev = new PlayerChangeSkinEvent($this, $this->getSkin(), $skin); @@ -732,7 +667,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns whether the player is currently using an item (right-click and hold). - * @return bool */ public function isUsingItem() : bool{ return $this->startAction > -1; @@ -745,8 +679,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns how long the player has been using their currently-held item for. Used for determining arrow shoot force * for bows. - * - * @return int */ public function getItemUseDuration() : int{ return $this->startAction === -1 ? -1 : ($this->server->getTick() - $this->startAction); @@ -754,10 +686,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns whether the player has a cooldown period left before it can use the given item again. - * - * @param Item $item - * - * @return bool */ public function hasItemCooldown(Item $item) : bool{ $this->checkItemCooldowns(); @@ -766,8 +694,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Resets the player's cooldown time for the given item back to the maximum. - * - * @param Item $item */ public function resetItemCooldown(Item $item) : void{ $ticks = $item->getCooldownTicks(); @@ -1010,9 +936,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } } - /** - * @return bool - */ public function hasValidSpawnPosition() : bool{ return $this->spawnPosition !== null and $this->spawnPosition->isValid(); } @@ -1033,18 +956,10 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $this->networkSession->syncPlayerSpawnPoint($this->spawnPosition); } - /** - * @return bool - */ public function isSleeping() : bool{ return $this->sleeping !== null; } - /** - * @param Vector3 $pos - * - * @return bool - */ public function sleepOn(Vector3 $pos) : bool{ $pos = $pos->floor(); $b = $this->getWorld()->getBlock($pos); @@ -1084,9 +999,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } } - /** - * @return GameMode - */ public function getGamemode() : GameMode{ return $this->gamemode; } @@ -1106,10 +1018,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Sets the gamemode, and if needed, kicks the Player. - * - * @param GameMode $gm - * - * @return bool */ public function setGamemode(GameMode $gm) : bool{ if($this->gamemode->equals($gm)){ @@ -1139,8 +1047,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * in Adventure Mode. Supply the $literal parameter as true to force a literal Survival Mode check. * * @param bool $literal whether a literal check should be performed - * - * @return bool */ public function isSurvival(bool $literal = false) : bool{ return $this->gamemode->equals(GameMode::SURVIVAL()) or (!$literal and $this->gamemode->equals(GameMode::ADVENTURE())); @@ -1151,8 +1057,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * in Spectator Mode. Supply the $literal parameter as true to force a literal Creative Mode check. * * @param bool $literal whether a literal check should be performed - * - * @return bool */ public function isCreative(bool $literal = false) : bool{ return $this->gamemode->equals(GameMode::CREATIVE()) or (!$literal and $this->gamemode->equals(GameMode::SPECTATOR())); @@ -1163,24 +1067,17 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * in Spectator Mode. Supply the $literal parameter as true to force a literal Adventure Mode check. * * @param bool $literal whether a literal check should be performed - * - * @return bool */ public function isAdventure(bool $literal = false) : bool{ return $this->gamemode->equals(GameMode::ADVENTURE()) or (!$literal and $this->gamemode->equals(GameMode::SPECTATOR())); } - /** - * @return bool - */ public function isSpectator() : bool{ return $this->gamemode->equals(GameMode::SPECTATOR()); } /** * TODO: make this a dynamic ability instead of being hardcoded - * - * @return bool */ public function hasFiniteResources() : bool{ return $this->gamemode->equals(GameMode::SURVIVAL()) or $this->gamemode->equals(GameMode::ADVENTURE()); @@ -1233,8 +1130,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns the location that the player wants to be in at the end of this tick. Note that this may not be their * actual result position at the end due to plugin interference or a range of other things. - * - * @return Vector3 */ public function getNextPosition() : Vector3{ return $this->newPosition !== null ? clone $this->newPosition : $this->location->asVector3(); @@ -1438,11 +1333,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns whether the player can interact with the specified position. This checks distance and direction. * - * @param Vector3 $pos - * @param float $maxDistance * @param float $maxDiff defaults to half of the 3D diagonal width of a block - * - * @return bool */ public function canInteract(Vector3 $pos, float $maxDistance, float $maxDiff = M_SQRT3 / 2) : bool{ $eyePos = $this->getEyePos(); @@ -1459,10 +1350,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Sends a chat message as this player. If the message begins with a / (forward-slash) it will be treated * as a command. - * - * @param string $message - * - * @return bool */ public function chat(string $message) : bool{ $this->doCloseInventory(); @@ -1654,9 +1541,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Performs a left-click (attack) action on the block. * - * @param Vector3 $pos - * @param int $face - * * @return bool if an action took place successfully */ public function attackBlock(Vector3 $pos, int $face) : bool{ @@ -1708,8 +1592,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Breaks the block at the given position using the currently-held item. * - * @param Vector3 $pos - * * @return bool if the block was successfully broken, false if a rollback needs to take place. */ public function breakBlock(Vector3 $pos) : bool{ @@ -1734,10 +1616,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Touches the block at the given position with the currently-held item. * - * @param Vector3 $pos - * @param int $face - * @param Vector3 $clickOffset - * * @return bool if it did something */ public function interactBlock(Vector3 $pos, int $face, Vector3 $clickOffset) : bool{ @@ -1762,8 +1640,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * Attacks the given entity with the currently-held item. * TODO: move this up the class hierarchy * - * @param Entity $entity - * * @return bool if the entity was dealt damage */ public function attackEntity(Entity $entity) : bool{ @@ -1831,11 +1707,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Interacts with the given entity using the currently-held item. - * - * @param Entity $entity - * @param Vector3 $clickPos - * - * @return bool */ public function interactEntity(Entity $entity, Vector3 $clickPos) : bool{ //TODO @@ -1877,8 +1748,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Drops an item on the ground in front of the player. - * - * @param Item $item */ public function dropItem(Item $item) : void{ $this->broadcastEntityEvent(ActorEventPacket::ARM_SWING, null, $this->getViewers()); @@ -1888,8 +1757,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Adds a title text to the user's screen, with an optional subtitle. * - * @param string $title - * @param string $subtitle * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. * @param int $stay Duration in ticks to stay on screen for * @param int $fadeOut Duration in ticks for fade-out. @@ -1904,8 +1771,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Sets the subtitle message, without sending a title. - * - * @param string $subtitle */ public function sendSubTitle(string $subtitle) : void{ $this->networkSession->onSubTitle($subtitle); @@ -1913,8 +1778,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Adds small text to the user's screen. - * - * @param string $message */ public function sendActionBarMessage(string $message) : void{ $this->networkSession->onActionBar($message); @@ -1965,7 +1828,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } /** - * @param string $message * @param string[] $parameters */ public function sendTranslation(string $message, array $parameters = []) : void{ @@ -1983,8 +1845,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * Sends a popup message to the player * * TODO: add translation type popups - * - * @param string $message */ public function sendPopup(string $message) : void{ $this->networkSession->onPopup($message); @@ -1997,8 +1857,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Sends a Form to the player, or queue to send it if a form is already open. * - * @param Form $form - * * @throws \InvalidArgumentException */ public function sendForm(Form $form) : void{ @@ -2009,10 +1867,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } /** - * @param int $formId * @param mixed $responseData - * - * @return bool */ public function onFormSubmit(int $formId, $responseData) : bool{ if(!isset($this->forms[$formId])){ @@ -2055,11 +1910,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Kicks a player from the server * - * @param string $reason - * @param bool $isAdmin * @param TextContainer|string $quitMessage - * - * @return bool */ public function kick(string $reason = "", bool $isAdmin = true, $quitMessage = null) : bool{ $ev = new PlayerKickEvent($this, $reason, $quitMessage ?? $this->getLeaveMessage()); @@ -2093,7 +1944,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, * * @param string $reason Shown to the player, usually this will appear on their disconnect screen. * @param TextContainer|string $quitMessage Message to broadcast to online players (null will use default) - * @param bool $notify */ public function disconnect(string $reason, $quitMessage = null, bool $notify = true) : void{ if(!$this->isConnected()){ @@ -2347,11 +2197,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * TODO: remove this - * - * @param Vector3 $pos - * @param float|null $yaw - * @param float|null $pitch - * @param int $mode */ public function sendPosition(Vector3 $pos, ?float $yaw = null, ?float $pitch = null, int $mode = MovePlayerPacket::MODE_NORMAL) : void{ $this->networkSession->syncMovement($pos, $yaw, $pitch, $mode); @@ -2407,9 +2252,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, return $this->craftingGrid; } - /** - * @param CraftingGrid $grid - */ public function setCraftingGrid(CraftingGrid $grid) : void{ $this->craftingGrid = $grid; } @@ -2440,8 +2282,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Returns the inventory the player is currently viewing. This might be a chest, furnace, or any other container. - * - * @return Inventory|null */ public function getCurrentWindow() : ?Inventory{ return $this->currentWindow; @@ -2449,10 +2289,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, /** * Opens an inventory window to the player. Returns if it was successful. - * - * @param Inventory $inventory - * - * @return bool */ public function setCurrentWindow(Inventory $inventory) : bool{ if($inventory === $this->currentWindow){ diff --git a/src/player/PlayerInfo.php b/src/player/PlayerInfo.php index e25b50e31..285294ddf 100644 --- a/src/player/PlayerInfo.php +++ b/src/player/PlayerInfo.php @@ -45,14 +45,6 @@ class PlayerInfo{ /** @var array */ private $extraData; - /** - * @param string $username - * @param UUID $uuid - * @param Skin $skin - * @param string $locale - * @param string $xuid - * @param array $extraData - */ public function __construct(string $username, UUID $uuid, Skin $skin, string $locale, string $xuid, array $extraData = []){ $this->username = TextFormat::clean($username); $this->uuid = $uuid; @@ -62,44 +54,26 @@ class PlayerInfo{ $this->extraData = $extraData; } - /** - * @return string - */ public function getUsername() : string{ return $this->username; } - /** - * @return UUID - */ public function getUuid() : UUID{ return $this->uuid; } - /** - * @return Skin - */ public function getSkin() : Skin{ return $this->skin; } - /** - * @return string - */ public function getLocale() : string{ return $this->locale; } - /** - * @return string - */ public function getXuid() : string{ return $this->xuid; } - /** - * @return array - */ public function getExtraData() : array{ return $this->extraData; } diff --git a/src/plugin/ApiVersion.php b/src/plugin/ApiVersion.php index e935fa0fb..be2d2ca07 100644 --- a/src/plugin/ApiVersion.php +++ b/src/plugin/ApiVersion.php @@ -36,10 +36,7 @@ final class ApiVersion{ } /** - * @param string $myVersionStr * @param string[] $wantVersionsStr - * - * @return bool */ public static function isCompatible(string $myVersionStr, array $wantVersionsStr) : bool{ $myVersion = new VersionString($myVersionStr); diff --git a/src/plugin/DiskResourceProvider.php b/src/plugin/DiskResourceProvider.php index c3487bb39..31016110f 100644 --- a/src/plugin/DiskResourceProvider.php +++ b/src/plugin/DiskResourceProvider.php @@ -49,8 +49,6 @@ class DiskResourceProvider implements ResourceProvider{ * Gets an embedded resource on the plugin file. * WARNING: You must close the resource given using fclose() * - * @param string $filename - * * @return null|resource Resource data, or null */ public function getResource(string $filename){ diff --git a/src/plugin/PharPluginLoader.php b/src/plugin/PharPluginLoader.php index c0220a714..98b3bed07 100644 --- a/src/plugin/PharPluginLoader.php +++ b/src/plugin/PharPluginLoader.php @@ -46,8 +46,6 @@ class PharPluginLoader implements PluginLoader{ /** * Loads the plugin contained in $file - * - * @param string $file */ public function loadPlugin(string $file) : void{ $this->loader->addPath("$file/src"); @@ -55,10 +53,6 @@ class PharPluginLoader implements PluginLoader{ /** * Gets the PluginDescription from the file - * - * @param string $file - * - * @return null|PluginDescription */ public function getPluginDescription(string $file) : ?PluginDescription{ $phar = new \Phar($file); diff --git a/src/plugin/Plugin.php b/src/plugin/Plugin.php index 7b6328e41..12ed87dde 100644 --- a/src/plugin/Plugin.php +++ b/src/plugin/Plugin.php @@ -36,9 +36,6 @@ interface Plugin{ public function __construct(PluginLoader $loader, Server $server, PluginDescription $description, string $dataFolder, string $file, ResourceProvider $resourceProvider); - /** - * @return bool - */ public function isEnabled() : bool; /** @@ -47,52 +44,27 @@ interface Plugin{ * @internal This is intended for core use only and should not be used by plugins * @see PluginManager::enablePlugin() * @see PluginManager::disablePlugin() - * - * @param bool $enabled */ public function onEnableStateChange(bool $enabled) : void; - /** - * @return bool - */ public function isDisabled() : bool; /** * Gets the plugin's data folder to save files and configuration. * This directory name has a trailing slash. - * - * @return string */ public function getDataFolder() : string; - /** - * @return PluginDescription - */ public function getDescription() : PluginDescription; - /** - * @return Server - */ public function getServer() : Server; - /** - * @return string - */ public function getName() : string; - /** - * @return \AttachableLogger - */ public function getLogger() : \AttachableLogger; - /** - * @return PluginLoader - */ public function getPluginLoader() : PluginLoader; - /** - * @return TaskScheduler - */ public function getScheduler() : TaskScheduler; } diff --git a/src/plugin/PluginBase.php b/src/plugin/PluginBase.php index dbc51b980..e4f25612c 100644 --- a/src/plugin/PluginBase.php +++ b/src/plugin/PluginBase.php @@ -126,9 +126,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ } - /** - * @return bool - */ final public function isEnabled() : bool{ return $this->isEnabled; } @@ -139,8 +136,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ * @internal This is intended for core use only and should not be used by plugins * @see PluginManager::enablePlugin() * @see PluginManager::disablePlugin() - * - * @param bool $enabled */ final public function onEnableStateChange(bool $enabled) : void{ if($this->isEnabled !== $enabled){ @@ -153,9 +148,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ } } - /** - * @return bool - */ final public function isDisabled() : bool{ return !$this->isEnabled; } @@ -168,9 +160,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ return $this->description; } - /** - * @return \AttachableLogger - */ public function getLogger() : \AttachableLogger{ return $this->logger; } @@ -233,8 +222,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ } /** - * @param string $name - * * @return Command|PluginIdentifiableCommand|null */ public function getCommand(string $name){ @@ -251,12 +238,7 @@ abstract class PluginBase implements Plugin, CommandExecutor{ } /** - * @param CommandSender $sender - * @param Command $command - * @param string $label * @param string[] $args - * - * @return bool */ public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{ return false; @@ -266,8 +248,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ * Gets an embedded resource on the plugin file. * WARNING: You must close the resource given using fclose() * - * @param string $filename - * * @return null|resource Resource data, or null */ public function getResource(string $filename){ @@ -276,11 +256,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ /** * Saves an embedded resource to its relative location in the data folder - * - * @param string $filename - * @param bool $replace - * - * @return bool */ public function saveResource(string $filename, bool $replace = false) : bool{ if(trim($filename) === ""){ @@ -315,9 +290,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{ return $this->resourceProvider->getResources(); } - /** - * @return Config - */ public function getConfig() : Config{ if($this->config === null){ $this->reloadConfig(); @@ -342,44 +314,26 @@ abstract class PluginBase implements Plugin, CommandExecutor{ $this->config = new Config($this->configFile); } - /** - * @return Server - */ final public function getServer() : Server{ return $this->server; } - /** - * @return string - */ final public function getName() : string{ return $this->description->getName(); } - /** - * @return string - */ final public function getFullName() : string{ return $this->description->getFullName(); } - /** - * @return string - */ protected function getFile() : string{ return $this->file; } - /** - * @return PluginLoader - */ public function getPluginLoader() : PluginLoader{ return $this->loader; } - /** - * @return TaskScheduler - */ public function getScheduler() : TaskScheduler{ return $this->scheduler; } diff --git a/src/plugin/PluginDescription.php b/src/plugin/PluginDescription.php index 0a6fe602a..ec2bfbba2 100644 --- a/src/plugin/PluginDescription.php +++ b/src/plugin/PluginDescription.php @@ -86,8 +86,6 @@ class PluginDescription{ } /** - * @param array $plugin - * * @throws PluginException */ private function loadMap(array $plugin) : void{ @@ -161,16 +159,10 @@ class PluginDescription{ } } - /** - * @return string - */ public function getFullName() : string{ return $this->name . " v" . $this->version; } - /** - * @return array - */ public function getCompatibleApis() : array{ return $this->api; } @@ -189,16 +181,10 @@ class PluginDescription{ return $this->authors; } - /** - * @return string - */ public function getPrefix() : string{ return $this->prefix; } - /** - * @return array - */ public function getCommands() : array{ return $this->commands; } @@ -244,44 +230,26 @@ class PluginDescription{ } } - /** - * @return array - */ public function getDepend() : array{ return $this->depend; } - /** - * @return string - */ public function getDescription() : string{ return $this->description; } - /** - * @return array - */ public function getLoadBefore() : array{ return $this->loadBefore; } - /** - * @return string - */ public function getMain() : string{ return $this->main; } - /** - * @return string - */ public function getName() : string{ return $this->name; } - /** - * @return PluginLoadOrder - */ public function getOrder() : PluginLoadOrder{ return $this->order; } @@ -293,23 +261,14 @@ class PluginDescription{ return $this->permissions; } - /** - * @return array - */ public function getSoftDepend() : array{ return $this->softDepend; } - /** - * @return string - */ public function getVersion() : string{ return $this->version; } - /** - * @return string - */ public function getWebsite() : string{ return $this->website; } diff --git a/src/plugin/PluginGraylist.php b/src/plugin/PluginGraylist.php index 2438b8281..c7ab8c88a 100644 --- a/src/plugin/PluginGraylist.php +++ b/src/plugin/PluginGraylist.php @@ -48,19 +48,12 @@ class PluginGraylist{ return array_flip($this->plugins); } - /** - * @return bool - */ public function isWhitelist() : bool{ return $this->isWhitelist; } /** * Returns whether the given name is permitted by this graylist. - * - * @param string $name - * - * @return bool */ public function isAllowed(string $name) : bool{ return $this->isWhitelist() === isset($this->plugins[$name]); diff --git a/src/plugin/PluginLoader.php b/src/plugin/PluginLoader.php index 7e019c46c..2bf603dde 100644 --- a/src/plugin/PluginLoader.php +++ b/src/plugin/PluginLoader.php @@ -30,33 +30,21 @@ interface PluginLoader{ /** * Returns whether this PluginLoader can load the plugin in the given path. - * - * @param string $path - * - * @return bool */ public function canLoadPlugin(string $path) : bool; /** * Loads the plugin contained in $file - * - * @param string $file */ public function loadPlugin(string $file) : void; /** * Gets the PluginDescription from the file - * - * @param string $file - * - * @return null|PluginDescription */ public function getPluginDescription(string $file) : ?PluginDescription; /** * Returns the protocol prefix used to access files in this plugin, e.g. file://, phar:// - * - * @return string */ public function getAccessProtocol() : string; } diff --git a/src/plugin/PluginManager.php b/src/plugin/PluginManager.php index e30a27534..ee5810dd7 100644 --- a/src/plugin/PluginManager.php +++ b/src/plugin/PluginManager.php @@ -87,11 +87,6 @@ class PluginManager{ /** @var PluginGraylist|null */ private $graylist; - /** - * @param Server $server - * @param null|string $pluginDataDirectory - * @param PluginGraylist|null $graylist - */ public function __construct(Server $server, ?string $pluginDataDirectory, ?PluginGraylist $graylist = null){ $this->server = $server; $this->pluginDataDirectory = $pluginDataDirectory; @@ -106,11 +101,6 @@ class PluginManager{ $this->graylist = $graylist; } - /** - * @param string $name - * - * @return null|Plugin - */ public function getPlugin(string $name) : ?Plugin{ if(isset($this->plugins[$name])){ return $this->plugins[$name]; @@ -119,9 +109,6 @@ class PluginManager{ return null; } - /** - * @param PluginLoader $loader - */ public function registerInterface(PluginLoader $loader) : void{ $this->fileAssociations[get_class($loader)] = $loader; } @@ -141,10 +128,7 @@ class PluginManager{ } /** - * @param string $path * @param PluginLoader[] $loaders - * - * @return Plugin|null */ public function loadPlugin(string $path, ?array $loaders = null) : ?Plugin{ foreach($loaders ?? $this->fileAssociations as $loader){ @@ -197,7 +181,6 @@ class PluginManager{ } /** - * @param string $directory * @param array $newLoaders * * @return Plugin[] @@ -372,8 +355,6 @@ class PluginManager{ * Returns whether a specified API version string is considered compatible with the server's API version. * * @param string ...$versions - * - * @return bool */ public function isCompatibleApi(string ...$versions) : bool{ $serverString = $this->server->getApiVersion(); @@ -411,18 +392,10 @@ class PluginManager{ return false; } - /** - * @param Plugin $plugin - * - * @return bool - */ public function isPluginEnabled(Plugin $plugin) : bool{ return isset($this->plugins[$plugin->getDescription()->getName()]) and $plugin->isEnabled(); } - /** - * @param Plugin $plugin - */ public function enablePlugin(Plugin $plugin) : void{ if(!$plugin->isEnabled()){ $this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.plugin.enable", [$plugin->getDescription()->getFullName()])); @@ -446,9 +419,6 @@ class PluginManager{ } } - /** - * @param Plugin $plugin - */ public function disablePlugin(Plugin $plugin) : void{ if($plugin->isEnabled()){ $this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.plugin.disable", [$plugin->getDescription()->getFullName()])); @@ -482,9 +452,6 @@ class PluginManager{ /** * Registers all the events in the given Listener class * - * @param Listener $listener - * @param Plugin $plugin - * * @throws PluginException */ public function registerEvents(Listener $listener, Plugin $plugin) : void{ @@ -548,10 +515,6 @@ class PluginManager{ /** * @param string $event Class name that extends Event - * @param \Closure $handler - * @param int $priority - * @param Plugin $plugin - * @param bool $handleCancelled * * @throws \ReflectionException */ diff --git a/src/plugin/ResourceProvider.php b/src/plugin/ResourceProvider.php index 2e4a3e0f0..fd2f29b62 100644 --- a/src/plugin/ResourceProvider.php +++ b/src/plugin/ResourceProvider.php @@ -28,8 +28,6 @@ interface ResourceProvider{ * Gets an embedded resource on the plugin file. * WARNING: You must close the resource given using fclose() * - * @param string $filename - * * @return null|resource Resource data, or null */ public function getResource(string $filename); diff --git a/src/plugin/ScriptPluginLoader.php b/src/plugin/ScriptPluginLoader.php index b714c67b5..126f66de2 100644 --- a/src/plugin/ScriptPluginLoader.php +++ b/src/plugin/ScriptPluginLoader.php @@ -46,8 +46,6 @@ class ScriptPluginLoader implements PluginLoader{ /** * Loads the plugin contained in $file - * - * @param string $file */ public function loadPlugin(string $file) : void{ include_once $file; @@ -55,10 +53,6 @@ class ScriptPluginLoader implements PluginLoader{ /** * Gets the PluginDescription from the file - * - * @param string $file - * - * @return null|PluginDescription */ public function getPluginDescription(string $file) : ?PluginDescription{ $content = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); diff --git a/src/resourcepacks/ResourcePack.php b/src/resourcepacks/ResourcePack.php index c411c8fa6..74f897888 100644 --- a/src/resourcepacks/ResourcePack.php +++ b/src/resourcepacks/ResourcePack.php @@ -29,31 +29,26 @@ interface ResourcePack{ /** * Returns the path to the resource pack. This might be a file or a directory, depending on the type of pack. - * @return string */ public function getPath() : string; /** * Returns the human-readable name of the resource pack - * @return string */ public function getPackName() : string; /** * Returns the pack's UUID as a human-readable string - * @return string */ public function getPackId() : string; /** * Returns the size of the pack on disk in bytes. - * @return int */ public function getPackSize() : int; /** * Returns a version number for the pack in the format major.minor.patch - * @return string */ public function getPackVersion() : string; diff --git a/src/resourcepacks/ResourcePackManager.php b/src/resourcepacks/ResourcePackManager.php index 5071016d0..289117927 100644 --- a/src/resourcepacks/ResourcePackManager.php +++ b/src/resourcepacks/ResourcePackManager.php @@ -52,7 +52,6 @@ class ResourcePackManager{ /** * @param string $path Path to resource-packs directory. - * @param \Logger $logger */ public function __construct(string $path, \Logger $logger){ $this->path = $path; @@ -122,7 +121,6 @@ class ResourcePackManager{ /** * Returns the directory which resource packs are loaded from. - * @return string */ public function getPath() : string{ return $this->path; @@ -130,7 +128,6 @@ class ResourcePackManager{ /** * Returns whether players must accept resource packs in order to join. - * @return bool */ public function resourcePacksRequired() : bool{ return $this->serverForceResources; @@ -146,10 +143,6 @@ class ResourcePackManager{ /** * Returns the resource pack matching the specified UUID string, or null if the ID was not recognized. - * - * @param string $id - * - * @return ResourcePack|null */ public function getPackById(string $id) : ?ResourcePack{ return $this->uuidList[strtolower($id)] ?? null; diff --git a/src/resourcepacks/ZippedResourcePack.php b/src/resourcepacks/ZippedResourcePack.php index 6a12ad12b..3b262759f 100644 --- a/src/resourcepacks/ZippedResourcePack.php +++ b/src/resourcepacks/ZippedResourcePack.php @@ -43,10 +43,6 @@ class ZippedResourcePack implements ResourcePack{ /** * Performs basic validation checks on a resource pack's manifest.json. * TODO: add more manifest validation - * - * @param \stdClass $manifest - * - * @return bool */ public static function verifyManifest(\stdClass $manifest) : bool{ if(!isset($manifest->format_version) or !isset($manifest->header) or !isset($manifest->modules)){ diff --git a/src/scheduler/AsyncPool.php b/src/scheduler/AsyncPool.php index 403703d41..5ac526afc 100644 --- a/src/scheduler/AsyncPool.php +++ b/src/scheduler/AsyncPool.php @@ -69,8 +69,6 @@ class AsyncPool{ /** * Returns the maximum size of the pool. Note that there may be less active workers than this number. - * - * @return int */ public function getSize() : int{ return $this->size; @@ -78,8 +76,6 @@ class AsyncPool{ /** * Increases the maximum size of the pool to the specified amount. This does not immediately start new workers. - * - * @param int $newSize */ public function increaseSize(int $newSize) : void{ if($newSize > $this->size){ @@ -92,8 +88,6 @@ class AsyncPool{ * The signature should be `function(int $worker) : void` * * This function will call the hook for every already-running worker. - * - * @param \Closure $hook */ public function addWorkerStartHook(\Closure $hook) : void{ Utils::validateCallableSignature(function(int $worker) : void{}, $hook); @@ -105,8 +99,6 @@ class AsyncPool{ /** * Removes a previously-registered callback listening for workers being started. - * - * @param \Closure $hook */ public function removeWorkerStartHook(\Closure $hook) : void{ unset($this->workerStartHooks[spl_object_id($hook)]); @@ -124,10 +116,6 @@ class AsyncPool{ /** * Fetches the worker with the specified ID, starting it if it does not exist, and firing any registered worker * start hooks. - * - * @param int $worker - * - * @return AsyncWorker */ private function getWorker(int $worker) : AsyncWorker{ if(!isset($this->workers[$worker])){ @@ -148,9 +136,6 @@ class AsyncPool{ /** * Submits an AsyncTask to an arbitrary worker. - * - * @param AsyncTask $task - * @param int $worker */ public function submitTaskToWorker(AsyncTask $task, int $worker) : void{ if($worker < 0 or $worker >= $this->size){ @@ -174,8 +159,6 @@ class AsyncPool{ * - if an idle worker is found, it will be selected * - else, if the worker pool is not full, a new worker will be selected * - else, the worker with the smallest backlog is chosen. - * - * @return int */ public function selectWorker() : int{ $worker = null; @@ -206,10 +189,6 @@ class AsyncPool{ /** * Submits an AsyncTask to the worker with the least load. If all workers are busy and the pool is not full, a new * worker may be started. - * - * @param AsyncTask $task - * - * @return int */ public function submitTask(AsyncTask $task) : int{ if($task->isSubmitted()){ diff --git a/src/scheduler/AsyncTask.php b/src/scheduler/AsyncTask.php index f59949192..be367f30f 100644 --- a/src/scheduler/AsyncTask.php +++ b/src/scheduler/AsyncTask.php @@ -96,8 +96,6 @@ abstract class AsyncTask extends \Threaded{ /** * Returns whether this task has finished executing, whether successfully or not. This differs from isRunning() * because it is not true prior to task execution. - * - * @return bool */ public function isFinished() : bool{ return $this->finished or $this->isCrashed(); @@ -118,9 +116,6 @@ abstract class AsyncTask extends \Threaded{ return $this->cancelRun; } - /** - * @return bool - */ public function hasResult() : bool{ return $this->result !== null; } @@ -136,9 +131,6 @@ abstract class AsyncTask extends \Threaded{ $this->submitted = true; } - /** - * @return bool - */ public function isSubmitted() : bool{ return $this->submitted; } @@ -210,7 +202,6 @@ abstract class AsyncTask extends \Threaded{ * Objects stored in this storage can be retrieved using fetchLocal() on the same thread that this method was called * from. * - * @param string $key * @param mixed $complexData the data to store */ protected function storeLocal(string $key, $complexData) : void{ @@ -232,8 +223,6 @@ abstract class AsyncTask extends \Threaded{ * If you used storeLocal(), you can use this on the same thread to fetch data stored. This should be used during * onProgressUpdate() and onCompletion() to fetch thread-local data stored on the parent thread. * - * @param string $key - * * @return mixed * * @throws \InvalidArgumentException if no data were stored by this AsyncTask instance. diff --git a/src/scheduler/AsyncWorker.php b/src/scheduler/AsyncWorker.php index e817e2646..51bdfd06e 100644 --- a/src/scheduler/AsyncWorker.php +++ b/src/scheduler/AsyncWorker.php @@ -79,7 +79,6 @@ class AsyncWorker extends Worker{ * Saves mixed data into the worker's thread-local object store. This can be used to store objects which you * want to use on this worker thread from multiple AsyncTasks. * - * @param string $identifier * @param mixed $value */ public function saveToThreadStore(string $identifier, $value) : void{ @@ -97,8 +96,6 @@ class AsyncWorker extends Worker{ * * Objects stored in this storage may ONLY be retrieved while the task is running. * - * @param string $identifier - * * @return mixed */ public function getFromThreadStore(string $identifier){ @@ -110,8 +107,6 @@ class AsyncWorker extends Worker{ /** * Removes previously-stored mixed data from the worker's thread-local object store. - * - * @param string $identifier */ public function removeFromThreadStore(string $identifier) : void{ if(\Thread::getCurrentThread() !== $this){ diff --git a/src/scheduler/BulkCurlTask.php b/src/scheduler/BulkCurlTask.php index 39666d7a0..c2e7939e7 100644 --- a/src/scheduler/BulkCurlTask.php +++ b/src/scheduler/BulkCurlTask.php @@ -43,8 +43,6 @@ class BulkCurlTask extends AsyncTask{ * $operations accepts an array of arrays. Each member array must contain a string mapped to "page", and optionally, * "timeout", "extraHeaders" and "extraOpts". Documentation of these options are same as those in * {@link Utils::simpleCurl}. - * - * @param array $operations */ public function __construct(array $operations){ $this->operations = serialize($operations); diff --git a/src/scheduler/CancellableClosureTask.php b/src/scheduler/CancellableClosureTask.php index dbcd1f6e0..a900170e9 100644 --- a/src/scheduler/CancellableClosureTask.php +++ b/src/scheduler/CancellableClosureTask.php @@ -53,8 +53,6 @@ class CancellableClosureTask extends Task{ * * The closure should follow the signature callback(int $currentTick) : bool. The return value will be used to * decide whether to continue repeating. - * - * @param \Closure $closure */ public function __construct(\Closure $closure){ Utils::validateCallableSignature(function(int $currentTick) : bool{ return false; }, $closure); diff --git a/src/scheduler/DumpWorkerMemoryTask.php b/src/scheduler/DumpWorkerMemoryTask.php index 19cd248de..213721fae 100644 --- a/src/scheduler/DumpWorkerMemoryTask.php +++ b/src/scheduler/DumpWorkerMemoryTask.php @@ -37,11 +37,6 @@ class DumpWorkerMemoryTask extends AsyncTask{ /** @var int */ private $maxStringSize; - /** - * @param string $outputFolder - * @param int $maxNesting - * @param int $maxStringSize - */ public function __construct(string $outputFolder, int $maxNesting, int $maxStringSize){ $this->outputFolder = $outputFolder; $this->maxNesting = $maxNesting; diff --git a/src/scheduler/FileWriteTask.php b/src/scheduler/FileWriteTask.php index 772af28b7..788a8f7d5 100644 --- a/src/scheduler/FileWriteTask.php +++ b/src/scheduler/FileWriteTask.php @@ -35,9 +35,7 @@ class FileWriteTask extends AsyncTask{ private $flags; /** - * @param string $path * @param mixed $contents - * @param int $flags */ public function __construct(string $path, $contents, int $flags = 0){ $this->path = $path; diff --git a/src/scheduler/SendUsageTask.php b/src/scheduler/SendUsageTask.php index d43b48b3f..547b566f8 100644 --- a/src/scheduler/SendUsageTask.php +++ b/src/scheduler/SendUsageTask.php @@ -52,11 +52,6 @@ class SendUsageTask extends AsyncTask{ /** @var string */ public $data; - /** - * @param Server $server - * @param int $type - * @param array $playerList - */ public function __construct(Server $server, int $type, array $playerList = []){ $endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/"; diff --git a/src/scheduler/Task.php b/src/scheduler/Task.php index 38085092b..72a0b237c 100644 --- a/src/scheduler/Task.php +++ b/src/scheduler/Task.php @@ -37,9 +37,6 @@ abstract class Task{ return $this->taskHandler; } - /** - * @return int - */ final public function getTaskId() : int{ if($this->taskHandler !== null){ return $this->taskHandler->getTaskId(); @@ -52,9 +49,6 @@ abstract class Task{ return Utils::getNiceClassName($this); } - /** - * @param TaskHandler|null $taskHandler - */ final public function setHandler(?TaskHandler $taskHandler) : void{ if($this->taskHandler === null or $taskHandler === null){ $this->taskHandler = $taskHandler; @@ -64,8 +58,6 @@ abstract class Task{ /** * Actions to execute when run * - * @param int $currentTick - * * @return void */ abstract public function onRun(int $currentTick); diff --git a/src/scheduler/TaskHandler.php b/src/scheduler/TaskHandler.php index fb798eda9..69159b371 100644 --- a/src/scheduler/TaskHandler.php +++ b/src/scheduler/TaskHandler.php @@ -54,13 +54,6 @@ class TaskHandler{ /** @var string */ private $ownerName; - /** - * @param Task $task - * @param int $taskId - * @param int $delay - * @param int $period - * @param string|null $ownerName - */ public function __construct(Task $task, int $taskId, int $delay = -1, int $period = -1, ?string $ownerName = null){ $this->task = $task; $this->taskId = $taskId; @@ -72,65 +65,38 @@ class TaskHandler{ $this->task->setHandler($this); } - /** - * @return bool - */ public function isCancelled() : bool{ return $this->cancelled; } - /** - * @return int - */ public function getNextRun() : int{ return $this->nextRun; } - /** - * @param int $ticks - */ public function setNextRun(int $ticks) : void{ $this->nextRun = $ticks; } - /** - * @return int - */ public function getTaskId() : int{ return $this->taskId; } - /** - * @return Task - */ public function getTask() : Task{ return $this->task; } - /** - * @return int - */ public function getDelay() : int{ return $this->delay; } - /** - * @return bool - */ public function isDelayed() : bool{ return $this->delay > 0; } - /** - * @return bool - */ public function isRepeating() : bool{ return $this->period > 0; } - /** - * @return int - */ public function getPeriod() : int{ return $this->period; } @@ -150,9 +116,6 @@ class TaskHandler{ $this->task->setHandler(null); } - /** - * @param int $currentTick - */ public function run(int $currentTick) : void{ $this->timings->startTiming(); try{ @@ -162,9 +125,6 @@ class TaskHandler{ } } - /** - * @return string - */ public function getTaskName() : string{ return $this->taskName; } diff --git a/src/scheduler/TaskScheduler.php b/src/scheduler/TaskScheduler.php index d68e480d2..0700dd9c8 100644 --- a/src/scheduler/TaskScheduler.php +++ b/src/scheduler/TaskScheduler.php @@ -52,57 +52,27 @@ class TaskScheduler{ /** @var int */ protected $currentTick = 0; - /** - * @param null|string $owner - */ public function __construct(?string $owner = null){ $this->owner = $owner; $this->queue = new ReversePriorityQueue(); } - /** - * @param Task $task - * - * @return TaskHandler - */ public function scheduleTask(Task $task) : TaskHandler{ return $this->addTask($task, -1, -1); } - /** - * @param Task $task - * @param int $delay - * - * @return TaskHandler - */ public function scheduleDelayedTask(Task $task, int $delay) : TaskHandler{ return $this->addTask($task, $delay, -1); } - /** - * @param Task $task - * @param int $period - * - * @return TaskHandler - */ public function scheduleRepeatingTask(Task $task, int $period) : TaskHandler{ return $this->addTask($task, -1, $period); } - /** - * @param Task $task - * @param int $delay - * @param int $period - * - * @return TaskHandler - */ public function scheduleDelayedRepeatingTask(Task $task, int $delay, int $period) : TaskHandler{ return $this->addTask($task, $delay, $period); } - /** - * @param int $taskId - */ public function cancelTask(int $taskId) : void{ if(isset($this->tasks[$taskId])){ try{ @@ -124,22 +94,11 @@ class TaskScheduler{ $this->ids = 1; } - /** - * @param int $taskId - * - * @return bool - */ public function isQueued(int $taskId) : bool{ return isset($this->tasks[$taskId]); } /** - * @param Task $task - * @param int $delay - * @param int $period - * - * @return TaskHandler - * * @throws \InvalidStateException */ private function addTask(Task $task, int $delay, int $period) : TaskHandler{ @@ -183,9 +142,6 @@ class TaskScheduler{ $this->enabled = $enabled; } - /** - * @param int $currentTick - */ public function mainThreadHeartbeat(int $currentTick) : void{ $this->currentTick = $currentTick; while($this->isReady($this->currentTick)){ @@ -210,9 +166,6 @@ class TaskScheduler{ return !$this->queue->isEmpty() and $this->queue->current()->getNextRun() <= $currentTick; } - /** - * @return int - */ private function nextId() : int{ return $this->ids++; } diff --git a/src/thread/ThreadManager.php b/src/thread/ThreadManager.php index 696b34825..1109a62e4 100644 --- a/src/thread/ThreadManager.php +++ b/src/thread/ThreadManager.php @@ -34,9 +34,6 @@ class ThreadManager extends \Volatile{ self::$instance = new ThreadManager(); } - /** - * @return ThreadManager - */ public static function getInstance() : ThreadManager{ return self::$instance; } diff --git a/src/timings/Timings.php b/src/timings/Timings.php index fed3350f9..85835f5af 100644 --- a/src/timings/Timings.php +++ b/src/timings/Timings.php @@ -161,12 +161,6 @@ abstract class Timings{ } - /** - * @param TaskHandler $task - * @param int $period - * - * @return TimingsHandler - */ public static function getScheduledTaskTimings(TaskHandler $task, int $period) : TimingsHandler{ $name = "Task: " . ($task->getOwnerName() ?? "Unknown") . " Runnable: " . $task->getTaskName(); @@ -183,11 +177,6 @@ abstract class Timings{ return self::$pluginTaskTimingMap[$name]; } - /** - * @param Entity $entity - * - * @return TimingsHandler - */ public static function getEntityTimings(Entity $entity) : TimingsHandler{ $entityType = (new \ReflectionClass($entity))->getShortName(); if(!isset(self::$entityTypeTimingMap[$entityType])){ @@ -201,11 +190,6 @@ abstract class Timings{ return self::$entityTypeTimingMap[$entityType]; } - /** - * @param Tile $tile - * - * @return TimingsHandler - */ public static function getTileEntityTimings(Tile $tile) : TimingsHandler{ $tileType = (new \ReflectionClass($tile))->getShortName(); if(!isset(self::$tileEntityTypeTimingMap[$tileType])){ @@ -215,11 +199,6 @@ abstract class Timings{ return self::$tileEntityTypeTimingMap[$tileType]; } - /** - * @param ServerboundPacket $pk - * - * @return TimingsHandler - */ public static function getReceiveDataPacketTimings(ServerboundPacket $pk) : TimingsHandler{ $pid = $pk->pid(); if(!isset(self::$packetReceiveTimingMap[$pid])){ @@ -230,12 +209,6 @@ abstract class Timings{ return self::$packetReceiveTimingMap[$pid]; } - - /** - * @param ClientboundPacket $pk - * - * @return TimingsHandler - */ public static function getSendDataPacketTimings(ClientboundPacket $pk) : TimingsHandler{ $pid = $pk->pid(); if(!isset(self::$packetSendTimingMap[$pid])){ diff --git a/src/timings/TimingsHandler.php b/src/timings/TimingsHandler.php index b8a4d0f0e..cfcd9f938 100644 --- a/src/timings/TimingsHandler.php +++ b/src/timings/TimingsHandler.php @@ -147,7 +147,6 @@ class TimingsHandler{ private $violations = 0; /** - * @param string $name * @param TimingsHandler $parent */ public function __construct(string $name, ?TimingsHandler $parent = null){ @@ -200,8 +199,6 @@ class TimingsHandler{ } /** - * @param \Closure $closure - * * @return mixed the result of the given closure */ public function time(\Closure $closure){ diff --git a/src/updater/AutoUpdater.php b/src/updater/AutoUpdater.php index 3b80d5cc5..a5086e934 100644 --- a/src/updater/AutoUpdater.php +++ b/src/updater/AutoUpdater.php @@ -49,10 +49,6 @@ class AutoUpdater{ /** @var \Logger */ private $logger; - /** - * @param Server $server - * @param string $endpoint - */ public function __construct(Server $server, string $endpoint){ $this->server = $server; $this->logger = new \PrefixedLogger($server->getLogger(), "Auto Updater"); @@ -69,8 +65,6 @@ class AutoUpdater{ /** * Callback used at the end of the update checking task - * - * @param array $updateInfo */ public function checkUpdateCallback(array $updateInfo) : void{ $this->updateInfo = $updateInfo; @@ -91,8 +85,6 @@ class AutoUpdater{ /** * Returns whether there is an update available. - * - * @return bool */ public function hasUpdate() : bool{ return $this->newVersion !== null; @@ -115,8 +107,6 @@ class AutoUpdater{ /** * Shows a warning to a player to tell them there is an update available - * - * @param Player $player */ public function showPlayerUpdate(Player $player) : void{ $player->sendMessage(TextFormat::DARK_PURPLE . "The version of " . $this->server->getName() . " that this server is running is out of date. Please consider updating to the latest version."); @@ -148,8 +138,6 @@ class AutoUpdater{ /** * Returns the last retrieved update data. - * - * @return array|null */ public function getUpdateInfo() : ?array{ return $this->updateInfo; @@ -185,8 +173,6 @@ class AutoUpdater{ /** * Returns the channel used for update checking (stable, beta, dev) - * - * @return string */ public function getChannel() : string{ $channel = strtolower($this->server->getProperty("auto-updater.preferred-channel", "stable")); @@ -199,8 +185,6 @@ class AutoUpdater{ /** * Returns the host used for update checks. - * - * @return string */ public function getEndpoint() : string{ return $this->endpoint; diff --git a/src/utils/Color.php b/src/utils/Color.php index 12d679a49..047b709e6 100644 --- a/src/utils/Color.php +++ b/src/utils/Color.php @@ -46,7 +46,6 @@ final class Color{ /** * Returns the alpha (opacity) value of this colour. - * @return int */ public function getA() : int{ return $this->a; @@ -54,7 +53,6 @@ final class Color{ /** * Retuns the red value of this colour. - * @return int */ public function getR() : int{ return $this->r; @@ -62,7 +60,6 @@ final class Color{ /** * Returns the green value of this colour. - * @return int */ public function getG() : int{ return $this->g; @@ -70,7 +67,6 @@ final class Color{ /** * Returns the blue value of this colour. - * @return int */ public function getB() : int{ return $this->b; @@ -79,10 +75,7 @@ final class Color{ /** * Mixes the supplied list of colours together to produce a result colour. * - * @param Color $color1 * @param Color ...$colors - * - * @return Color */ public static function mix(Color $color1, Color ...$colors) : Color{ $colors[] = $color1; @@ -102,10 +95,6 @@ final class Color{ /** * Returns a Color from the supplied RGB colour code (24-bit) - * - * @param int $code - * - * @return Color */ public static function fromRGB(int $code) : Color{ return new Color(($code >> 16) & 0xff, ($code >> 8) & 0xff, $code & 0xff); @@ -113,10 +102,6 @@ final class Color{ /** * Returns a Color from the supplied ARGB colour code (32-bit) - * - * @param int $code - * - * @return Color */ public static function fromARGB(int $code) : Color{ return new Color(($code >> 16) & 0xff, ($code >> 8) & 0xff, $code & 0xff, ($code >> 24) & 0xff); @@ -124,7 +109,6 @@ final class Color{ /** * Returns an ARGB 32-bit colour value. - * @return int */ public function toARGB() : int{ return ($this->a << 24) | ($this->r << 16) | ($this->g << 8) | $this->b; @@ -132,10 +116,6 @@ final class Color{ /** * Returns a Color from the supplied RGBA colour code (32-bit) - * - * @param int $c - * - * @return Color */ public static function fromRGBA(int $c) : Color{ return new Color(($c >> 24) & 0xff, ($c >> 16) & 0xff, ($c >> 8) & 0xff, $c & 0xff); @@ -143,7 +123,6 @@ final class Color{ /** * Returns an RGBA 32-bit colour value. - * @return int */ public function toRGBA() : int{ return ($this->r << 24) | ($this->g << 16) | ($this->b << 8) | $this->a; diff --git a/src/utils/Config.php b/src/utils/Config.php index 2eea39ea8..7acc43391 100644 --- a/src/utils/Config.php +++ b/src/utils/Config.php @@ -129,20 +129,11 @@ class Config{ $this->changed = $changed; } - /** - * @param string $str - * - * @return string - */ public static function fixYAMLIndexes(string $str) : string{ return preg_replace("#^( *)(y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)( *)\:#m", "$1\"$2\"$3:", $str); } /** - * @param string $file - * @param int $type - * @param array $default - * * @throws \InvalidArgumentException if config type could not be auto-detected * @throws \InvalidStateException if config type is invalid */ @@ -196,8 +187,6 @@ class Config{ /** * Returns the path of the config. - * - * @return string */ public function getPath() : string{ return $this->file; @@ -238,8 +227,6 @@ class Config{ /** * Sets the options for the JSON encoding when saving * - * @param int $options - * * @return Config $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode @@ -257,8 +244,6 @@ class Config{ /** * Enables the given option in addition to the currently set JSON options * - * @param int $option - * * @return Config $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode @@ -276,8 +261,6 @@ class Config{ /** * Disables the given option for the JSON encoding when saving * - * @param int $option - * * @return Config $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode @@ -295,7 +278,6 @@ class Config{ /** * Returns the options for the JSON encoding when saving * - * @return int * @throws \RuntimeException if the Config is not in JSON * @see json_encode */ @@ -442,9 +424,6 @@ class Config{ } } - /** - * @param array $v - */ public function setAll(array $v) : void{ $this->config = $v; $this->changed = true; @@ -453,8 +432,6 @@ class Config{ /** * @param string $k * @param bool $lowercase If set, searches Config in single-case / lowercase. - * - * @return bool */ public function exists($k, bool $lowercase = false) : bool{ if($lowercase){ @@ -474,27 +451,16 @@ class Config{ $this->changed = true; } - /** - * @param bool $keys - * - * @return array - */ public function getAll(bool $keys = false) : array{ return ($keys ? array_keys($this->config) : $this->config); } - /** - * @param array $defaults - */ public function setDefaults(array $defaults) : void{ $this->fillDefaults($defaults, $this->config); } /** - * @param array $default * @param array $data reference parameter - * - * @return int */ private function fillDefaults(array $default, &$data) : int{ $changed = 0; @@ -517,9 +483,6 @@ class Config{ return $changed; } - /** - * @param string $content - */ private function parseList(string $content) : void{ foreach(explode("\n", trim(str_replace("\r\n", "\n", $content))) as $v){ $v = trim($v); @@ -530,9 +493,6 @@ class Config{ } } - /** - * @return string - */ private function writeProperties() : string{ $content = "#Properties Config file\r\n#" . date("D M j H:i:s T Y") . "\r\n"; foreach($this->config as $k => $v){ @@ -547,9 +507,6 @@ class Config{ return $content; } - /** - * @param string $content - */ private function parseProperties(string $content) : void{ if(preg_match_all('/^\s*([a-zA-Z0-9\-_\.]+)[ \t]*=([^\r\n]*)/um', $content, $matches) > 0){ //false or 0 matches foreach($matches[1] as $i => $k){ diff --git a/src/utils/EnumTrait.php b/src/utils/EnumTrait.php index c3c23bd82..9092bd888 100644 --- a/src/utils/EnumTrait.php +++ b/src/utils/EnumTrait.php @@ -32,8 +32,6 @@ trait EnumTrait{ /** * Registers the given object as an enum member. * - * @param self $member - * * @throws \InvalidArgumentException */ protected static function register(self $member) : void{ @@ -77,9 +75,6 @@ trait EnumTrait{ * Returns the enum member matching the given name. * This is overridden to change the return typehint. * - * @param string $name - * - * @return self * @throws \InvalidArgumentException if no member matches. */ public static function fromString(string $name) : self{ @@ -95,7 +90,6 @@ trait EnumTrait{ private $runtimeId; /** - * @param string $enumName * @throws \InvalidArgumentException */ private function __construct(string $enumName){ @@ -110,9 +104,6 @@ trait EnumTrait{ $this->runtimeId = self::$nextId++; } - /** - * @return string - */ public function name() : string{ return $this->enumName; } @@ -121,8 +112,6 @@ trait EnumTrait{ * Returns a runtime-only identifier for this enum member. This will be different with each run, so don't try to * hardcode it. * This can be useful for switches or array indexing. - * - * @return int */ public function id() : int{ return $this->runtimeId; @@ -130,10 +119,6 @@ trait EnumTrait{ /** * Returns whether the two objects are equivalent. - * - * @param self $other - * - * @return bool */ public function equals(self $other) : bool{ return $this->enumName === $other->enumName; diff --git a/src/utils/Filesystem.php b/src/utils/Filesystem.php index 689a4fcdd..0edc258c0 100644 --- a/src/utils/Filesystem.php +++ b/src/utils/Filesystem.php @@ -101,8 +101,6 @@ final class Filesystem{ * inform other processes that some file or folder is already in use, to avoid data corruption. * If this function succeeds in gaining a lock on the file, it writes the current PID to the file. * - * @param string $lockFilePath - * * @return int|null process ID of the process currently holding the lock failure, null on success. * @throws \InvalidArgumentException if the lock file path is invalid (e.g. parent directory doesn't exist, permission denied) */ @@ -132,7 +130,6 @@ final class Filesystem{ /** * Releases a file lock previously acquired by createLockFile() and deletes the lock file. * - * @param string $lockFilePath * @throws \InvalidArgumentException if the lock file path is invalid (e.g. parent directory doesn't exist, permission denied) */ public static function releaseLockFile(string $lockFilePath) : void{ diff --git a/src/utils/Git.php b/src/utils/Git.php index 6bb4f5234..dd83eb033 100644 --- a/src/utils/Git.php +++ b/src/utils/Git.php @@ -36,10 +36,7 @@ final class Git{ /** * Returns the git hash of the currently checked out head of the given repository, or null on failure. * - * @param string $dir * @param bool $dirty reference parameter, set to whether the repo has local changes - * - * @return string|null */ public static function getRepositoryState(string $dir, bool &$dirty) : ?string{ if(Process::execute("git -C \"$dir\" rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){ @@ -54,10 +51,6 @@ final class Git{ /** * Infallible, returns a string representing git state, or a string of zeros on failure. * If the repo is dirty, a "-dirty" suffix is added. - * - * @param string $dir - * - * @return string */ public static function getRepositoryStatePretty(string $dir) : string{ $dirty = false; diff --git a/src/utils/Internet.php b/src/utils/Internet.php index 1628d819e..c2ce7c14e 100644 --- a/src/utils/Internet.php +++ b/src/utils/Internet.php @@ -113,7 +113,6 @@ class Internet{ * Returns the machine's internal network IP address. If the machine is not behind a router, this may be the same * as the external IP. * - * @return string * @throws InternetException */ public static function getInternalIP() : string{ @@ -135,9 +134,7 @@ class Internet{ * GETs an URL using cURL * NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread. * - * @param string $page * @param int $timeout default 10 - * @param array $extraHeaders * @param string $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occured during the operation. * @param array[] $headers reference parameter * @param int $httpCode reference parameter @@ -158,10 +155,7 @@ class Internet{ * POSTs data to an URL * NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread. * - * @param string $page * @param array|string $args - * @param int $timeout - * @param array $extraHeaders * @param string $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occured during the operation. * @param array[] $headers reference parameter * @param int $httpCode reference parameter @@ -185,7 +179,6 @@ class Internet{ * General cURL shorthand function. * NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread. * - * @param string $page * @param float|int $timeout The maximum connect timeout and timeout in seconds, correct to ms. * @param string[] $extraHeaders extra headers to send as a plain string array * @param array $extraOpts extra CURLOPT_* to set as an [opt => value] map diff --git a/src/utils/MainLogger.php b/src/utils/MainLogger.php index dc5e7e0d2..a4f354b39 100644 --- a/src/utils/MainLogger.php +++ b/src/utils/MainLogger.php @@ -61,9 +61,6 @@ class MainLogger extends \AttachableThreadedLogger{ private $timezone; /** - * @param string $logFile - * @param bool $logDebug - * * @throws \RuntimeException */ public function __construct(string $logFile, bool $logDebug = false){ @@ -82,8 +79,6 @@ class MainLogger extends \AttachableThreadedLogger{ /** * Returns the current logger format used for console output. - * - * @return string */ public function getFormat() : string{ return $this->format; @@ -99,8 +94,6 @@ class MainLogger extends \AttachableThreadedLogger{ * - message * * @see http://php.net/manual/en/function.sprintf.php - * - * @param string $format */ public function setFormat(string $format) : void{ $this->format = $format; @@ -141,15 +134,11 @@ class MainLogger extends \AttachableThreadedLogger{ $this->send($message, \LogLevel::DEBUG, "DEBUG", TextFormat::GRAY); } - /** - * @param bool $logDebug - */ public function setLogDebug(bool $logDebug) : void{ $this->logDebug = $logDebug; } /** - * @param \Throwable $e * @param array|null $trace * * @return void diff --git a/src/utils/Process.php b/src/utils/Process.php index 3728b159b..de2aee85e 100644 --- a/src/utils/Process.php +++ b/src/utils/Process.php @@ -47,8 +47,6 @@ final class Process{ } /** - * @param bool $advanced - * * @return int[]|int */ public static function getMemoryUsage(bool $advanced = false){ diff --git a/src/utils/Random.php b/src/utils/Random.php index 679d6bdc6..0719dcc2c 100644 --- a/src/utils/Random.php +++ b/src/utils/Random.php @@ -86,8 +86,6 @@ class Random{ /** * Returns an 31-bit integer (not signed) - * - * @return int */ public function nextInt() : int{ return $this->nextSignedInt() & 0x7fffffff; @@ -95,8 +93,6 @@ class Random{ /** * Returns a 32-bit integer (signed) - * - * @return int */ public function nextSignedInt() : int{ $t = ($this->x ^ ($this->x << 11)) & 0xffffffff; @@ -112,8 +108,6 @@ class Random{ /** * Returns a float between 0.0 and 1.0 (inclusive) - * - * @return float */ public function nextFloat() : float{ return $this->nextInt() / 0x7fffffff; @@ -121,8 +115,6 @@ class Random{ /** * Returns a float between -1.0 and 1.0 (inclusive) - * - * @return float */ public function nextSignedFloat() : float{ return $this->nextSignedInt() / 0x7fffffff; @@ -130,8 +122,6 @@ class Random{ /** * Returns a random boolean - * - * @return bool */ public function nextBoolean() : bool{ return ($this->nextSignedInt() & 0x01) === 0; @@ -142,8 +132,6 @@ class Random{ * * @param int $start default 0 * @param int $end default 0x7fffffff - * - * @return int */ public function nextRange(int $start = 0, int $end = 0x7fffffff) : int{ return $start + ($this->nextInt() % ($end + 1 - $start)); diff --git a/src/utils/RegistryTrait.php b/src/utils/RegistryTrait.php index f905ad7ac..b91fbd429 100644 --- a/src/utils/RegistryTrait.php +++ b/src/utils/RegistryTrait.php @@ -39,9 +39,6 @@ trait RegistryTrait{ /** * Adds the given object to the registry. * - * @param string $name - * @param object $member - * * @throws \InvalidArgumentException */ private static function _registryRegister(string $name, object $member) : void{ @@ -72,9 +69,6 @@ trait RegistryTrait{ } /** - * @param string $name - * - * @return object * @throws \InvalidArgumentException */ private static function _registryFromString(string $name) : object{ @@ -113,8 +107,6 @@ trait RegistryTrait{ /** * Generates code for static methods for all known registry members. - * - * @return string */ public static function _generateGetters() : string{ $lines = []; @@ -132,8 +124,6 @@ public static function %1$s() : %2$s{ /** * Generates a block of @ method annotations for accessors for this registry's known members. - * - * @return string */ public static function _generateMethodAnnotations() : string{ $traitName = (new \ReflectionClass(__TRAIT__))->getShortName(); diff --git a/src/utils/Terminal.php b/src/utils/Terminal.php index 51f854681..9f8c40d84 100644 --- a/src/utils/Terminal.php +++ b/src/utils/Terminal.php @@ -199,8 +199,6 @@ abstract class Terminal{ * Note that this is platform-dependent and might produce different results depending on the terminal type and/or OS. * * @param string|array $string - * - * @return string */ public static function toANSI($string) : string{ if(!is_array($string)){ @@ -289,8 +287,6 @@ abstract class Terminal{ /** * Emits a string containing Minecraft colour codes to the console formatted with native colours. - * - * @param string $line */ public static function write(string $line) : void{ echo self::toANSI($line); @@ -299,8 +295,6 @@ abstract class Terminal{ /** * Emits a string containing Minecraft colour codes to the console formatted with native colours, followed by a * newline character. - * - * @param string $line */ public static function writeLine(string $line) : void{ echo self::toANSI($line) . self::$FORMAT_RESET . PHP_EOL; diff --git a/src/utils/TextFormat.php b/src/utils/TextFormat.php index bea431abd..6ecfe9c8e 100644 --- a/src/utils/TextFormat.php +++ b/src/utils/TextFormat.php @@ -68,10 +68,6 @@ abstract class TextFormat{ /** * Splits the string by Format tokens - * - * @param string $string - * - * @return array */ public static function tokenize(string $string) : array{ return preg_split("/(" . TextFormat::ESCAPE . "[0-9a-fk-or])/u", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); @@ -80,9 +76,6 @@ abstract class TextFormat{ /** * Cleans the string from Minecraft codes, ANSI Escape Codes and invalid UTF-8 characters * - * @param string $string - * @param bool $removeFormat - * * @return string valid clean UTF-8 */ public static function clean(string $string, bool $removeFormat = true) : string{ @@ -97,10 +90,7 @@ abstract class TextFormat{ /** * Replaces placeholders of § with the correct character. Only valid codes (as in the constants of the TextFormat class) will be converted. * - * @param string $string * @param string $placeholder default "&" - * - * @return string */ public static function colorize(string $string, string $placeholder = "&") : string{ return preg_replace('/' . preg_quote($placeholder, "/") . '([0-9a-fk-or])/u', TextFormat::ESCAPE . '$1', $string); @@ -110,8 +100,6 @@ abstract class TextFormat{ * Returns an JSON-formatted string with colors/markup * * @param string|array $string - * - * @return string */ public static function toJSON($string) : string{ if(!is_array($string)){ @@ -298,8 +286,6 @@ abstract class TextFormat{ * Returns an HTML-formatted string with colors/markup * * @param string|array $string - * - * @return string */ public static function toHTML($string) : string{ if(!is_array($string)){ diff --git a/src/utils/UUID.php b/src/utils/UUID.php index c84b42f43..ff1b25ca5 100644 --- a/src/utils/UUID.php +++ b/src/utils/UUID.php @@ -60,10 +60,7 @@ final class UUID{ /** * Creates an UUID from an hexadecimal representation * - * @param string $uuid * @param int $version - * - * @return UUID */ public static function fromString(string $uuid, ?int $version = null) : UUID{ return self::fromBinary(hex2bin(str_replace("-", "", trim($uuid))), $version); @@ -72,11 +69,8 @@ final class UUID{ /** * Creates an UUID from a binary representation * - * @param string $uuid * @param int $version * - * @return UUID - * * @throws \InvalidArgumentException */ public static function fromBinary(string $uuid, ?int $version = null) : UUID{ @@ -91,8 +85,6 @@ final class UUID{ * Creates an UUIDv3 from binary data or list of binary data * * @param string ...$data - * - * @return UUID */ public static function fromData(string ...$data) : UUID{ $hash = hash("md5", implode($data), true); @@ -120,8 +112,6 @@ final class UUID{ } /** - * @param int $partNumber - * * @return int * @throws \InvalidArgumentException */ diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 3da8fcfdd..aa41cf5af 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -95,9 +95,6 @@ class Utils{ /** * Returns a readable identifier for the given Closure, including file and line. * - * @param \Closure $closure - * - * @return string * @throws \ReflectionException */ public static function getNiceClosureName(\Closure $closure) : string{ @@ -123,9 +120,6 @@ class Utils{ /** * Returns a readable identifier for the class of the given object. Sanitizes class names for anonymous classes. * - * @param object $obj - * - * @return string * @throws \ReflectionException */ public static function getNiceClassName(object $obj) : string{ @@ -163,8 +157,6 @@ class Utils{ * The rest of the hash will change depending on other factors. * * @param string $extra optional, additional data to identify the machine - * - * @return UUID */ public static function getMachineUniqueId(string $extra = "") : UUID{ if(self::$serverUniqueId !== null and $extra === ""){ @@ -233,10 +225,6 @@ class Utils{ * Linux => Linux * BSD => bsd * Other => other - * - * @param bool $recalculate - * - * @return string */ public static function getOS(bool $recalculate = false) : string{ if(self::$os === null or $recalculate){ @@ -265,11 +253,6 @@ class Utils{ return self::$os; } - /** - * @param bool $recalculate - * - * @return int - */ public static function getCoreCount(bool $recalculate = false) : int{ static $processors = 0; @@ -307,10 +290,6 @@ class Utils{ /** * Returns a prettified hexdump - * - * @param string $bin - * - * @return string */ public static function hexdump(string $bin) : string{ $output = ""; @@ -329,8 +308,6 @@ class Utils{ * Returns a string that can be printed, replaces non-printable characters * * @param mixed $str - * - * @return string */ public static function printable($str) : string{ if(!is_string($str)){ @@ -373,8 +350,6 @@ class Utils{ /** - * @param string $token - * * @return array of claims * * @throws \UnexpectedValueException @@ -399,9 +374,6 @@ class Utils{ /** * @param object $value - * @param bool $includeCurrent - * - * @return int */ public static function getReferenceCount($value, bool $includeCurrent = true) : int{ ob_start(); @@ -415,12 +387,6 @@ class Utils{ return -1; } - /** - * @param array $trace - * @param int $maxStringLength - * - * @return array - */ public static function printableTrace(array $trace, int $maxStringLength = 80) : array{ $messages = []; for($i = 0; isset($trace[$i]); ++$i){ @@ -450,11 +416,6 @@ class Utils{ return $messages; } - /** - * @param int $skipFrames - * - * @return array - */ public static function currentTrace(int $skipFrames = 0) : array{ ++$skipFrames; //omit this frame from trace, in addition to other skipped frames if(function_exists("xdebug_get_function_stack")){ @@ -469,11 +430,6 @@ class Utils{ return array_values($trace); } - /** - * @param int $skipFrames - * - * @return array - */ public static function printableCurrentTrace(int $skipFrames = 0) : array{ return self::printableTrace(self::currentTrace(++$skipFrames)); } @@ -481,8 +437,6 @@ class Utils{ /** * Extracts one-line tags from the doc-comment * - * @param string $docComment - * * @return string[] an array of tagName => tag value. If the tag has no value, an empty string is used as the value. */ public static function parseDocComment(string $docComment) : array{ diff --git a/src/utils/VersionString.php b/src/utils/VersionString.php index e9a5f3c60..37d803503 100644 --- a/src/utils/VersionString.php +++ b/src/utils/VersionString.php @@ -48,11 +48,6 @@ class VersionString{ /** @var bool */ private $development = false; - /** - * @param string $baseVersion - * @param bool $isDevBuild - * @param int $buildNumber - */ public function __construct(string $baseVersion, bool $isDevBuild = false, int $buildNumber = 0){ $this->baseVersion = $baseVersion; $this->development = $isDevBuild; @@ -117,12 +112,6 @@ class VersionString{ return $this->getFullVersion(); } - /** - * @param VersionString $target - * @param bool $diff - * - * @return int - */ public function compare(VersionString $target, bool $diff = false) : int{ $number = $this->getNumber(); $tNumber = $target->getNumber(); diff --git a/src/world/BlockTransaction.php b/src/world/BlockTransaction.php index 428daaf8d..55108bc49 100644 --- a/src/world/BlockTransaction.php +++ b/src/world/BlockTransaction.php @@ -47,9 +47,6 @@ class BlockTransaction{ /** * Adds a block to the transaction at the given position. * - * @param Vector3 $pos - * @param Block $state - * * @return $this */ public function addBlock(Vector3 $pos, Block $state) : self{ @@ -59,11 +56,6 @@ class BlockTransaction{ /** * Adds a block to the batch at the given coordinates. * - * @param int $x - * @param int $y - * @param int $z - * @param Block $state - * * @return $this */ public function addBlockAt(int $x, int $y, int $z, Block $state) : self{ @@ -74,10 +66,6 @@ class BlockTransaction{ /** * Reads a block from the given world, masked by the blocks in this transaction. This can be useful if you want to * add blocks to the transaction that depend on previous blocks should they exist. - * - * @param Vector3 $pos - * - * @return Block */ public function fetchBlock(Vector3 $pos) : Block{ return $this->fetchBlockAt($pos->getFloorX(), $pos->getFloorY(), $pos->getFloorZ()); @@ -85,12 +73,6 @@ class BlockTransaction{ /** * @see BlockTransaction::fetchBlock() - * - * @param int $x - * @param int $y - * @param int $z - * - * @return Block */ public function fetchBlockAt(int $x, int $y, int $z) : Block{ return $this->blocks[$x][$y][$z] ?? $this->world->getBlockAt($x, $y, $z); @@ -133,8 +115,6 @@ class BlockTransaction{ * Add a validation predicate which will be used to validate every block. * The callable signature should be the same as the below dummy function. * @see BlockTransaction::dummyValidator() - * - * @param \Closure $validator */ public function addValidator(\Closure $validator) : void{ Utils::validateCallableSignature([$this, 'dummyValidator'], $validator); @@ -146,13 +126,6 @@ class BlockTransaction{ * @see BlockTransaction::addValidator() * * @dummy - * - * @param ChunkManager $world - * @param int $x - * @param int $y - * @param int $z - * - * @return bool */ public function dummyValidator(ChunkManager $world, int $x, int $y, int $z) : bool{ return true; diff --git a/src/world/ChunkListener.php b/src/world/ChunkListener.php index c88f31f76..937cd0c8b 100644 --- a/src/world/ChunkListener.php +++ b/src/world/ChunkListener.php @@ -42,38 +42,27 @@ interface ChunkListener{ /** * This method will be called when a Chunk is replaced by a new one - * - * @param Chunk $chunk */ public function onChunkChanged(Chunk $chunk) : void; /** * This method will be called when a registered chunk is loaded - * - * @param Chunk $chunk */ public function onChunkLoaded(Chunk $chunk) : void; - /** * This method will be called when a registered chunk is unloaded - * - * @param Chunk $chunk */ public function onChunkUnloaded(Chunk $chunk) : void; /** * This method will be called when a registered chunk is populated * Usually it'll be sent with another call to onChunkChanged() - * - * @param Chunk $chunk */ public function onChunkPopulated(Chunk $chunk) : void; /** * This method will be called when a block changes in a registered chunk - * - * @param Vector3 $block */ public function onBlockChanged(Vector3 $block) : void; } diff --git a/src/world/ChunkManager.php b/src/world/ChunkManager.php index eeac6332f..97ef38a30 100644 --- a/src/world/ChunkManager.php +++ b/src/world/ChunkManager.php @@ -30,58 +30,28 @@ interface ChunkManager{ /** * Returns a Block object representing the block state at the given coordinates. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return Block */ public function getBlockAt(int $x, int $y, int $z) : Block; /** * Sets the block at the given coordinates to the block state specified. * - * @param int $x - * @param int $y - * @param int $z - * @param Block $block - * * @throws \InvalidArgumentException */ public function setBlockAt(int $x, int $y, int $z, Block $block) : void; - /** - * @param int $chunkX - * @param int $chunkZ - * @param bool $create - * - * @return Chunk|null - */ public function getChunk(int $chunkX, int $chunkZ, bool $create = false) : ?Chunk; - /** - * @param int $chunkX - * @param int $chunkZ - * @param Chunk|null $chunk - */ public function setChunk(int $chunkX, int $chunkZ, ?Chunk $chunk) : void; /** * Returns the height of the world - * @return int */ public function getWorldHeight() : int; /** * Returns whether the specified coordinates are within the valid world boundaries, taking world format limitations * into account. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return bool */ public function isInWorld(int $x, int $y, int $z) : bool; } diff --git a/src/world/Explosion.php b/src/world/Explosion.php index 43fcec0d1..ab295359a 100644 --- a/src/world/Explosion.php +++ b/src/world/Explosion.php @@ -65,8 +65,6 @@ class Explosion{ private $subChunkHandler; /** - * @param Position $center - * @param float $size * @param Entity|Block $what */ public function __construct(Position $center, float $size, $what = null){ @@ -88,8 +86,6 @@ class Explosion{ /** * Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks * will be destroyed. - * - * @return bool */ public function explodeA() : bool{ if($this->size < 0.1){ @@ -152,8 +148,6 @@ class Explosion{ /** * Executes the explosion's effects on the world. This includes destroying blocks (if any), harming and knocking back entities, * and creating sounds and particles. - * - * @return bool */ public function explodeB() : bool{ $send = []; diff --git a/src/world/Position.php b/src/world/Position.php index 0d9da13ea..28f614983 100644 --- a/src/world/Position.php +++ b/src/world/Position.php @@ -43,9 +43,6 @@ class Position extends Vector3{ } /** - * @param Vector3 $pos - * @param World|null $world - * * @return Position */ public static function fromObject(Vector3 $pos, ?World $world = null){ @@ -54,8 +51,6 @@ class Position extends Vector3{ /** * Return a Position instance - * - * @return Position */ public function asPosition() : Position{ return new Position($this->x, $this->y, $this->z, $this->world); @@ -79,8 +74,6 @@ class Position extends Vector3{ /** * Sets the target world of the position. * - * @param World|null $world - * * @return $this * * @throws \InvalidArgumentException if the specified World has been closed @@ -96,8 +89,6 @@ class Position extends Vector3{ /** * Checks if this object has a valid reference to a loaded world - * - * @return bool */ public function isValid() : bool{ if($this->world !== null and $this->world->isClosed()){ @@ -112,9 +103,6 @@ class Position extends Vector3{ /** * Returns a side Vector * - * @param int $side - * @param int $step - * * @return Position */ public function getSide(int $side, int $step = 1){ diff --git a/src/world/SimpleChunkManager.php b/src/world/SimpleChunkManager.php index 2c04e85a6..6d65b6803 100644 --- a/src/world/SimpleChunkManager.php +++ b/src/world/SimpleChunkManager.php @@ -43,8 +43,6 @@ class SimpleChunkManager implements ChunkManager{ /** * SimpleChunkManager constructor. - * - * @param int $worldHeight */ public function __construct(int $worldHeight = World::Y_MAX){ $this->worldHeight = $worldHeight; @@ -67,23 +65,11 @@ class SimpleChunkManager implements ChunkManager{ } } - /** - * @param int $chunkX - * @param int $chunkZ - * @param bool $create - * - * @return Chunk|null - */ public function getChunk(int $chunkX, int $chunkZ, bool $create = false) : ?Chunk{ $hash = World::chunkHash($chunkX, $chunkZ); return $this->chunks[$hash] ?? ($create ? $this->chunks[$hash] = new Chunk($chunkX, $chunkZ) : null); } - /** - * @param int $chunkX - * @param int $chunkZ - * @param Chunk|null $chunk - */ public function setChunk(int $chunkX, int $chunkZ, ?Chunk $chunk) : void{ if($chunk === null){ unset($this->chunks[World::chunkHash($chunkX, $chunkZ)]); diff --git a/src/world/World.php b/src/world/World.php index 7a5a8f4f8..3e5f27204 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -271,12 +271,6 @@ class World implements ChunkManager{ /** * Computes a small index relative to chunk base from the given coordinates. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return int */ public static function chunkBlockHash(int $x, int $y, int $z) : int{ return ($y << 8) | (($z & 0xf) << 4) | ($x & 0xf); @@ -288,21 +282,11 @@ class World implements ChunkManager{ $z = $hash << 37 >> 37; } - /** - * @param int $hash - * @param int|null $x - * @param int|null $z - */ public static function getXZ(int $hash, ?int &$x, ?int &$z) : void{ $x = $hash >> 32; $z = ($hash & 0xFFFFFFFF) << 32 >> 32; } - /** - * @param string $str - * - * @return int - */ public static function getDifficultyFromString(string $str) : int{ switch(strtolower(trim($str))){ case "0": @@ -331,10 +315,6 @@ class World implements ChunkManager{ /** * Init the default world data - * - * @param Server $server - * @param string $name - * @param WritableWorldProvider $provider */ public function __construct(Server $server, string $name, WritableWorldProvider $provider){ $this->worldId = static::$worldIdCounter++; @@ -479,8 +459,6 @@ class World implements ChunkManager{ * Broadcasts a LevelEvent to players in the area. This could be sound, particles, weather changes, etc. * * @param Vector3|null $pos If null, broadcasts to every player in the World - * @param int $evid - * @param int $data */ public function broadcastLevelEvent(?Vector3 $pos, int $evid, int $data = 0) : void{ $pk = LevelEventPacket::create($evid, $data, $pos); @@ -505,9 +483,6 @@ class World implements ChunkManager{ * * Returns a list of players who have the target chunk within their view distance. * - * @param int $chunkX - * @param int $chunkZ - * * @return Player[] */ public function getChunkPlayers(int $chunkX, int $chunkZ) : array{ @@ -517,9 +492,6 @@ class World implements ChunkManager{ /** * Gets the chunk loaders being used in a specific chunk * - * @param int $chunkX - * @param int $chunkZ - * * @return ChunkLoader[] */ public function getChunkLoaders(int $chunkX, int $chunkZ) : array{ @@ -528,7 +500,6 @@ class World implements ChunkManager{ /** * Returns an array of players who have the target position within their view distance. - * @param Vector3 $pos * * @return Player[] */ @@ -539,10 +510,6 @@ class World implements ChunkManager{ /** * Queues a packet to be sent to all players using the chunk at the specified X/Z coordinates at the end of the * current tick. - * - * @param int $chunkX - * @param int $chunkZ - * @param ClientboundPacket $packet */ public function addChunkPacket(int $chunkX, int $chunkZ, ClientboundPacket $packet) : void{ if(!isset($this->chunkPackets[$index = World::chunkHash($chunkX, $chunkZ)])){ @@ -554,9 +521,6 @@ class World implements ChunkManager{ /** * Broadcasts a packet to every player who has the target position within their view distance. - * - * @param Vector3 $pos - * @param ClientboundPacket $packet */ public function broadcastPacketToViewers(Vector3 $pos, ClientboundPacket $packet) : void{ $this->addChunkPacket($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4, $packet); @@ -564,8 +528,6 @@ class World implements ChunkManager{ /** * Broadcasts a packet to every player in the world. - * - * @param ClientboundPacket $packet */ public function broadcastGlobalPacket(ClientboundPacket $packet) : void{ $this->globalPackets[] = $packet; @@ -621,10 +583,6 @@ class World implements ChunkManager{ /** * Registers a listener to receive events on a chunk. - * - * @param ChunkListener $listener - * @param int $chunkX - * @param int $chunkZ */ public function registerChunkListener(ChunkListener $listener, int $chunkX, int $chunkZ) : void{ $hash = World::chunkHash($chunkX, $chunkZ); @@ -638,10 +596,6 @@ class World implements ChunkManager{ /** * Unregisters a chunk listener previously registered. * - * @param ChunkListener $listener - * @param int $chunkX - * @param int $chunkZ - * *@see World::registerChunkListener() * */ @@ -657,8 +611,6 @@ class World implements ChunkManager{ /** * Unregisters a chunk listener from all chunks it is listening on in this World. - * - * @param ChunkListener $listener */ public function unregisterChunkListenerFromAll(ChunkListener $listener) : void{ $id = spl_object_id($listener); @@ -675,9 +627,6 @@ class World implements ChunkManager{ /** * Returns all the listeners attached to this chunk. * - * @param int $chunkX - * @param int $chunkZ - * * @return ChunkListener[] */ public function getChunkListeners(int $chunkX, int $chunkZ) : array{ @@ -705,9 +654,6 @@ class World implements ChunkManager{ /** * @internal - * - * @param int $currentTick - * */ public function doTick(int $currentTick) : void{ if($this->closed){ @@ -1009,11 +955,6 @@ class World implements ChunkManager{ return []; } - /** - * @param bool $force - * - * @return bool - */ public function save(bool $force = false) : bool{ if(!$this->getAutoSave() and !$force){ @@ -1046,9 +987,6 @@ class World implements ChunkManager{ /** * Schedules a block update to be executed after the specified number of ticks. * Blocks will be updated with the scheduled update type. - * - * @param Vector3 $pos - * @param int $delay */ public function scheduleDelayedBlockUpdate(Vector3 $pos, int $delay) : void{ if( @@ -1072,9 +1010,6 @@ class World implements ChunkManager{ } /** - * @param AxisAlignedBB $bb - * @param bool $targetFirst - * * @return Block[] */ public function getCollisionBlocks(AxisAlignedBB $bb, bool $targetFirst = false) : array{ @@ -1116,10 +1051,6 @@ class World implements ChunkManager{ } /** - * @param Entity $entity - * @param AxisAlignedBB $bb - * @param bool $entities - * * @return AxisAlignedBB[] */ public function getCollisionBoxes(Entity $entity, AxisAlignedBB $bb, bool $entities = true) : array{ @@ -1170,8 +1101,6 @@ class World implements ChunkManager{ /** * Computes the percentage of a circle away from noon the sun is currently at. This can be multiplied by 2 * M_PI to * get an angle in radians, or by 360 to get an angle in degrees. - * - * @return float */ public function computeSunAnglePercentage() : float{ $timeProgress = ($this->time % 24000) / 24000; @@ -1188,7 +1117,6 @@ class World implements ChunkManager{ /** * Returns the percentage of a circle away from noon the sun is currently at. - * @return float */ public function getSunAnglePercentage() : float{ return $this->sunAnglePercentage; @@ -1196,7 +1124,6 @@ class World implements ChunkManager{ /** * Returns the current sun angle in radians. - * @return float */ public function getSunAngleRadians() : float{ return $this->sunAnglePercentage * 2 * M_PI; @@ -1204,7 +1131,6 @@ class World implements ChunkManager{ /** * Returns the current sun angle in degrees. - * @return float */ public function getSunAngleDegrees() : float{ return $this->sunAnglePercentage * 360.0; @@ -1213,8 +1139,6 @@ class World implements ChunkManager{ /** * Computes how many points of sky light is subtracted based on the current time. Used to offset raw chunk sky light * to get a real light value. - * - * @return int */ public function computeSkyLightReduction() : int{ $percentage = max(0, min(1, -(cos($this->getSunAngleRadians()) * 2 - 0.5))); @@ -1226,7 +1150,6 @@ class World implements ChunkManager{ /** * Returns how many points of sky light is subtracted based on the current time. - * @return int */ public function getSkyLightReduction() : int{ return $this->skyLightReduction; @@ -1235,10 +1158,6 @@ class World implements ChunkManager{ /** * Returns the sky light level at the specified coordinates, offset by the current time and weather. * - * @param int $x - * @param int $y - * @param int $z - * * @return int 0-15 */ public function getRealBlockSkyLightAt(int $x, int $y, int $z) : int{ @@ -1264,12 +1183,6 @@ class World implements ChunkManager{ /** * Returns the highest block light level available in the positions adjacent to the specified block coordinates. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return int */ public function getHighestAdjacentBlockSkyLight(int $x, int $y, int $z) : int{ $max = 0; @@ -1291,12 +1204,6 @@ class World implements ChunkManager{ /** * Returns the highest block light level available in the positions adjacent to the specified block coordinates. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return int */ public function getHighestAdjacentBlockLight(int $x, int $y, int $z) : int{ $max = 0; @@ -1333,10 +1240,6 @@ class World implements ChunkManager{ } /** - * @param int $x - * @param int $y - * @param int $z - * * @return int bitmap, (id << 4) | data */ public function getFullBlock(int $x, int $y, int $z) : int{ @@ -1358,11 +1261,8 @@ class World implements ChunkManager{ * Note: If you're using this for performance-sensitive code, and you're guaranteed to be supplying ints in the * specified vector, consider using {@link getBlockAt} instead for better performance. * - * @param Vector3 $pos * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) * @param bool $addToCache Whether to cache the block object created by this method call. - * - * @return Block */ public function getBlock(Vector3 $pos, bool $cached = true, bool $addToCache = true) : Block{ return $this->getBlockAt((int) floor($pos->x), (int) floor($pos->y), (int) floor($pos->z), $cached, $addToCache); @@ -1374,13 +1274,8 @@ class World implements ChunkManager{ * Note for plugin developers: If you are using this method a lot (thousands of times for many positions for * example), you may want to set addToCache to false to avoid using excessive amounts of memory. * - * @param int $x - * @param int $y - * @param int $z * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) * @param bool $addToCache Whether to cache the block object created by this method call. - * - * @return Block */ public function getBlockAt(int $x, int $y, int $z, bool $cached = true, bool $addToCache = true) : Block{ $fullState = 0; @@ -1428,10 +1323,6 @@ class World implements ChunkManager{ /** * Sets the block at the given Vector3 coordinates. * - * @param Vector3 $pos - * @param Block $block - * @param bool $update - * * @throws \InvalidArgumentException if the position is out of the world bounds */ public function setBlock(Vector3 $pos, Block $block, bool $update = true) : void{ @@ -1444,12 +1335,6 @@ class World implements ChunkManager{ * If $update is true, it'll get the neighbour blocks (6 sides) and update them, and also update local lighting. * If you are doing big changes, you might want to set this to false, then update manually. * - * @param int $x - * @param int $y - * @param int $z - * @param Block $block - * @param bool $update - * * @throws \InvalidArgumentException if the position is out of the world bounds */ public function setBlockAt(int $x, int $y, int $z, Block $block, bool $update = true) : void{ @@ -1495,12 +1380,7 @@ class World implements ChunkManager{ } /** - * @param Vector3 $source - * @param Item $item * @param Vector3 $motion - * @param int $delay - * - * @return ItemEntity|null */ public function dropItem(Vector3 $source, Item $item, ?Vector3 $motion = null, int $delay = 10) : ?ItemEntity{ if($item->isNull()){ @@ -1523,9 +1403,6 @@ class World implements ChunkManager{ /** * Drops XP orbs into the world for the specified amount, splitting the amount into several orbs if necessary. * - * @param Vector3 $pos - * @param int $amount - * * @return ExperienceOrb[] */ public function dropExperience(Vector3 $pos, int $amount) : array{ @@ -1554,12 +1431,8 @@ class World implements ChunkManager{ * Tries to break a block using a item, including Player time checks if available * It'll try to lower the durability if Item is a tool, and set it to Air if broken. * - * @param Vector3 $vector * @param Item $item reference parameter (if null, can break anything) * @param Player $player - * @param bool $createParticles - * - * @return bool */ public function useBreakOn(Vector3 $vector, Item &$item = null, ?Player $player = null, bool $createParticles = false) : bool{ $vector = $vector->floor(); @@ -1650,14 +1523,8 @@ class World implements ChunkManager{ /** * Uses a item on a position and face, placing it or activating the block * - * @param Vector3 $vector - * @param Item $item - * @param int $face - * @param Vector3|null $clickVector * @param Player|null $player default null * @param bool $playSound Whether to play a block-place sound if the block was placed successfully. - * - * @return bool */ public function useItemOn(Vector3 $vector, Item &$item, int $face, ?Vector3 $clickVector = null, ?Player $player = null, bool $playSound = false) : bool{ $blockClicked = $this->getBlock($vector); @@ -1771,11 +1638,6 @@ class World implements ChunkManager{ return true; } - /** - * @param int $entityId - * - * @return Entity|null - */ public function getEntity(int $entityId) : ?Entity{ return $this->entities[$entityId] ?? null; } @@ -1792,9 +1654,6 @@ class World implements ChunkManager{ /** * Returns the entities colliding the current one inside the AxisAlignedBB * - * @param AxisAlignedBB $bb - * @param Entity|null $entity - * * @return Entity[] */ public function getCollidingEntities(AxisAlignedBB $bb, ?Entity $entity = null) : array{ @@ -1827,7 +1686,6 @@ class World implements ChunkManager{ /** * Returns the entities near the current one inside the AxisAlignedBB * - * @param AxisAlignedBB $bb * @param Entity $entity * * @return Entity[] @@ -1859,8 +1717,6 @@ class World implements ChunkManager{ /** * Returns the closest Entity to the specified position, within the given radius. * - * @param Vector3 $pos - * @param float $maxDistance * @param string $entityType Class of entity to use for instanceof * @param bool $includeDead Whether to include entitites which are dead * @@ -1921,10 +1777,6 @@ class World implements ChunkManager{ * * Note: This method wraps getTileAt(). If you're guaranteed to be passing integers, and you're using this method * in performance-sensitive code, consider using getTileAt() instead of this method for better performance. - * - * @param Vector3 $pos - * - * @return Tile|null */ public function getTile(Vector3 $pos) : ?Tile{ return $this->getTileAt((int) floor($pos->x), (int) floor($pos->y), (int) floor($pos->z)); @@ -1932,12 +1784,6 @@ class World implements ChunkManager{ /** * Returns the tile at the specified x,y,z coordinates, or null if it does not exist. - * - * @param int $x - * @param int $y - * @param int $z - * - * @return Tile|null */ public function getTileAt(int $x, int $y, int $z) : ?Tile{ return ($chunk = $this->getChunk($x >> 4, $z >> 4)) !== null ? $chunk->getTile($x & 0x0f, $y, $z & 0x0f) : null; @@ -1946,10 +1792,6 @@ class World implements ChunkManager{ /** * Gets the raw block skylight level * - * @param int $x - * @param int $y - * @param int $z - * * @return int 0-15 */ public function getBlockSkyLightAt(int $x, int $y, int $z) : int{ @@ -1959,41 +1801,20 @@ class World implements ChunkManager{ /** * Gets the raw block light level * - * @param int $x - * @param int $y - * @param int $z - * * @return int 0-15 */ public function getBlockLightAt(int $x, int $y, int $z) : int{ return $this->getChunk($x >> 4, $z >> 4, true)->getBlockLight($x & 0x0f, $y, $z & 0x0f); } - /** - * @param int $x - * @param int $z - * - * @return int - */ public function getBiomeId(int $x, int $z) : int{ return $this->getChunk($x >> 4, $z >> 4, true)->getBiomeId($x & 0x0f, $z & 0x0f); } - /** - * @param int $x - * @param int $z - * - * @return Biome - */ public function getBiome(int $x, int $z) : Biome{ return Biome::getBiome($this->getBiomeId($x, $z)); } - /** - * @param int $x - * @param int $z - * @param int $biomeId - */ public function setBiomeId(int $x, int $z, int $biomeId) : void{ $this->getChunk($x >> 4, $z >> 4, true)->setBiomeId($x & 0x0f, $z & 0x0f, $biomeId); } @@ -2009,11 +1830,7 @@ class World implements ChunkManager{ * Returns the chunk at the specified X/Z coordinates. If the chunk is not loaded, attempts to (synchronously!!!) * load it. * - * @param int $chunkX - * @param int $chunkZ * @param bool $create Whether to create an empty chunk as a placeholder if the chunk does not exist - * - * @return Chunk|null */ public function getChunk(int $chunkX, int $chunkZ, bool $create = false) : ?Chunk{ if(isset($this->chunks[$index = World::chunkHash($chunkX, $chunkZ)])){ @@ -2027,11 +1844,6 @@ class World implements ChunkManager{ /** * Returns the chunk containing the given Vector3 position. - * - * @param Vector3 $pos - * @param bool $create - * - * @return null|Chunk */ public function getChunkAtPosition(Vector3 $pos, bool $create = false) : ?Chunk{ return $this->getChunk($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4, $create); @@ -2040,9 +1852,6 @@ class World implements ChunkManager{ /** * Returns the chunks adjacent to the specified chunk. * - * @param int $x - * @param int $z - * * @return (Chunk|null)[] */ public function getAdjacentChunks(int $x, int $z) : array{ @@ -2109,9 +1918,6 @@ class World implements ChunkManager{ } /** - * @param int $chunkX - * @param int $chunkZ - * @param Chunk|null $chunk * @param bool $deleteEntitiesAndTiles Whether to delete entities and tiles on the old chunk, or transfer them to the new one */ public function setChunk(int $chunkX, int $chunkZ, ?Chunk $chunk, bool $deleteEntitiesAndTiles = true) : void{ @@ -2168,9 +1974,6 @@ class World implements ChunkManager{ /** * Gets the highest block Y value at a specific $x and $z * - * @param int $x - * @param int $z - * * @return int 0-255 */ public function getHighestBlockAt(int $x, int $z) : int{ @@ -2179,42 +1982,20 @@ class World implements ChunkManager{ /** * Returns whether the given position is in a loaded area of terrain. - * - * @param Vector3 $pos - * - * @return bool */ public function isInLoadedTerrain(Vector3 $pos) : bool{ return $this->isChunkLoaded($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4); } - /** - * @param int $x - * @param int $z - * - * @return bool - */ public function isChunkLoaded(int $x, int $z) : bool{ return isset($this->chunks[World::chunkHash($x, $z)]); } - /** - * @param int $x - * @param int $z - * - * @return bool - */ public function isChunkGenerated(int $x, int $z) : bool{ $chunk = $this->getChunk($x, $z); return $chunk !== null ? $chunk->isGenerated() : false; } - /** - * @param int $x - * @param int $z - * - * @return bool - */ public function isChunkPopulated(int $x, int $z) : bool{ $chunk = $this->getChunk($x, $z); return $chunk !== null ? $chunk->isPopulated() : false; @@ -2222,8 +2003,6 @@ class World implements ChunkManager{ /** * Returns a Position pointing to the spawn - * - * @return Position */ public function getSpawnLocation() : Position{ return Position::fromObject($this->provider->getWorldData()->getSpawn(), $this); @@ -2231,8 +2010,6 @@ class World implements ChunkManager{ /** * Sets the world spawn location - * - * @param Vector3 $pos */ public function setSpawnLocation(Vector3 $pos) : void{ $previousSpawn = $this->getSpawnLocation(); @@ -2241,8 +2018,6 @@ class World implements ChunkManager{ } /** - * @param Entity $entity - * * @throws \InvalidArgumentException */ public function addEntity(Entity $entity) : void{ @@ -2262,8 +2037,6 @@ class World implements ChunkManager{ /** * Removes the entity from the world index * - * @param Entity $entity - * * @throws \InvalidArgumentException */ public function removeEntity(Entity $entity) : void{ @@ -2281,8 +2054,6 @@ class World implements ChunkManager{ } /** - * @param Tile $tile - * * @throws \InvalidArgumentException */ public function addTile(Tile $tile) : void{ @@ -2308,8 +2079,6 @@ class World implements ChunkManager{ } /** - * @param Tile $tile - * * @throws \InvalidArgumentException */ public function removeTile(Tile $tile) : void{ @@ -2329,12 +2098,6 @@ class World implements ChunkManager{ } } - /** - * @param int $x - * @param int $z - * - * @return bool - */ public function isChunkInUse(int $x, int $z) : bool{ return isset($this->chunkLoaders[$index = World::chunkHash($x, $z)]) and count($this->chunkLoaders[$index]) > 0; } @@ -2342,8 +2105,6 @@ class World implements ChunkManager{ /** * Attempts to load a chunk from the world provider (if not already loaded). * - * @param int $x - * @param int $z * @param bool $create Whether to create an empty chunk to load if the chunk cannot be loaded from disk. * * @return bool if loading the chunk was successful @@ -2473,11 +2234,6 @@ class World implements ChunkManager{ /** * Returns whether the chunk at the specified coordinates is a spawn chunk - * - * @param int $X - * @param int $Z - * - * @return bool */ public function isSpawnChunk(int $X, int $Z) : bool{ $spawn = $this->getSpawnLocation(); @@ -2487,11 +2243,6 @@ class World implements ChunkManager{ return abs($X - $spawnX) <= 1 and abs($Z - $spawnZ) <= 1; } - /** - * @param Vector3|null $spawn - * - * @return Position - */ public function getSafeSpawn(?Vector3 $spawn = null) : Position{ if(!($spawn instanceof Vector3) or $spawn->y < 1){ $spawn = $this->getSpawnLocation(); @@ -2534,8 +2285,6 @@ class World implements ChunkManager{ /** * Gets the current time - * - * @return int */ public function getTime() : int{ return $this->time; @@ -2543,8 +2292,6 @@ class World implements ChunkManager{ /** * Returns the current time of day - * - * @return int */ public function getTimeOfDay() : int{ return $this->time % self::TIME_FULL; @@ -2553,8 +2300,6 @@ class World implements ChunkManager{ /** * Returns the World display name. * WARNING: This is NOT guaranteed to be unique. Multiple worlds at runtime may share the same display name. - * - * @return string */ public function getDisplayName() : string{ return $this->displayName; @@ -2562,8 +2307,6 @@ class World implements ChunkManager{ /** * Returns the World folder name. This will not change at runtime and will be unique to a world per runtime. - * - * @return string */ public function getFolderName() : string{ return $this->folderName; @@ -2571,8 +2314,6 @@ class World implements ChunkManager{ /** * Sets the current time on the world - * - * @param int $time */ public function setTime(int $time) : void{ $this->time = $time; @@ -2597,8 +2338,6 @@ class World implements ChunkManager{ /** * Gets the world seed - * - * @return int */ public function getSeed() : int{ return $this->provider->getWorldData()->getSeed(); @@ -2608,16 +2347,10 @@ class World implements ChunkManager{ return $this->worldHeight; } - /** - * @return int - */ public function getDifficulty() : int{ return $this->provider->getWorldData()->getDifficulty(); } - /** - * @param int $difficulty - */ public function setDifficulty(int $difficulty) : void{ if($difficulty < 0 or $difficulty > 3){ throw new \InvalidArgumentException("Invalid difficulty level $difficulty"); diff --git a/src/world/WorldManager.php b/src/world/WorldManager.php index f8059aaa8..8a86e727a 100644 --- a/src/world/WorldManager.php +++ b/src/world/WorldManager.php @@ -83,9 +83,6 @@ class WorldManager{ return $this->worlds; } - /** - * @return World|null - */ public function getDefaultWorld() : ?World{ return $this->defaultWorld; } @@ -94,8 +91,6 @@ class WorldManager{ * Sets the default world to a different world * This won't change the level-name property, * it only affects the server on runtime - * - * @param World|null $world */ public function setDefaultWorld(?World $world) : void{ if($world === null or ($this->isWorldLoaded($world->getFolderName()) and $world !== $this->defaultWorld)){ @@ -103,30 +98,16 @@ class WorldManager{ } } - /** - * @param string $name - * - * @return bool - */ public function isWorldLoaded(string $name) : bool{ return $this->getWorldByName($name) instanceof World; } - /** - * @param int $worldId - * - * @return World|null - */ public function getWorld(int $worldId) : ?World{ return $this->worlds[$worldId] ?? null; } /** * NOTE: This matches worlds based on the FOLDER name, NOT the display name. - * - * @param string $name - * - * @return World|null */ public function getWorldByName(string $name) : ?World{ foreach($this->worlds as $world){ @@ -139,11 +120,6 @@ class WorldManager{ } /** - * @param World $world - * @param bool $forceUnload - * - * @return bool - * * @throws \InvalidArgumentException */ public function unloadWorld(World $world, bool $forceUnload = false) : bool{ @@ -186,11 +162,8 @@ class WorldManager{ /** * Loads a world from the data directory * - * @param string $name * @param bool $autoUpgrade Converts worlds to the default format if the world's format is not writable / deprecated * - * @return bool - * * @throws WorldException */ public function loadWorld(string $name, bool $autoUpgrade = false) : bool{ @@ -261,13 +234,8 @@ class WorldManager{ /** * Generates a new world if it does not exist * - * @param string $name - * @param int|null $seed * @param string $generator Class name that extends pocketmine\world\generator\Generator - * @param array $options - * @param bool $backgroundGeneration * - * @return bool * @throws \InvalidArgumentException */ public function generateWorld(string $name, ?int $seed = null, string $generator = Normal::class, array $options = [], bool $backgroundGeneration = true) : bool{ @@ -325,11 +293,6 @@ class WorldManager{ return true; } - /** - * @param string $name - * - * @return bool - */ public function isWorldGenerated(string $name) : bool{ if(trim($name) === ""){ return false; @@ -345,10 +308,6 @@ class WorldManager{ /** * Searches all worlds for the entity with the specified ID. * Useful for tracking entities across multiple worlds without needing strong references. - * - * @param int $entityId - * - * @return Entity|null */ public function findEntity(int $entityId) : ?Entity{ foreach($this->worlds as $world){ @@ -388,17 +347,10 @@ class WorldManager{ } } - - /** - * @return bool - */ public function getAutoSave() : bool{ return $this->autoSave; } - /** - * @param bool $value - */ public function setAutoSave(bool $value) : void{ $this->autoSave = $value; foreach($this->worlds as $world){ @@ -408,16 +360,11 @@ class WorldManager{ /** * Returns the period in ticks after which loaded worlds will be automatically saved to disk. - * - * @return int */ public function getAutoSaveInterval() : int{ return $this->autoSaveTicks; } - /** - * @param int $autoSaveTicks - */ public function setAutoSaveInterval(int $autoSaveTicks) : void{ if($autoSaveTicks <= 0){ throw new \InvalidArgumentException("Autosave ticks must be positive"); diff --git a/src/world/biome/Biome.php b/src/world/biome/Biome.php index 92800eae0..eed499e5a 100644 --- a/src/world/biome/Biome.php +++ b/src/world/biome/Biome.php @@ -102,11 +102,6 @@ abstract class Biome{ self::register(self::BIRCH_FOREST, new ForestBiome(TreeType::BIRCH())); } - /** - * @param int $id - * - * @return Biome - */ public static function getBiome(int $id) : Biome{ if(self::$biomes[$id] === null){ self::register($id, new UnknownBiome()); @@ -122,12 +117,6 @@ abstract class Biome{ $this->populators[] = $populator; } - /** - * @param ChunkManager $world - * @param int $chunkX - * @param int $chunkZ - * @param Random $random - */ public function populateChunk(ChunkManager $world, int $chunkX, int $chunkZ, Random $random) : void{ foreach($this->populators as $populator){ $populator->populate($world, $chunkX, $chunkZ, $random); diff --git a/src/world/format/Chunk.php b/src/world/format/Chunk.php index 7733fd36f..e5da1b5bf 100644 --- a/src/world/format/Chunk.php +++ b/src/world/format/Chunk.php @@ -90,12 +90,9 @@ class Chunk{ protected $NBTentities; /** - * @param int $chunkX - * @param int $chunkZ * @param SubChunk[] $subChunks * @param CompoundTag[] $entities * @param CompoundTag[] $tiles - * @param string $biomeIds * @param int[] $heightMap */ public function __construct(int $chunkX, int $chunkZ, array $subChunks = [], ?array $entities = null, ?array $tiles = null, string $biomeIds = "", array $heightMap = []){ @@ -127,16 +124,10 @@ class Chunk{ $this->NBTentities = $entities; } - /** - * @return int - */ public function getX() : int{ return $this->x; } - /** - * @return int - */ public function getZ() : int{ return $this->z; } @@ -145,17 +136,12 @@ class Chunk{ $this->x = $x; } - /** - * @param int $z - */ public function setZ(int $z) : void{ $this->z = $z; } /** * Returns the chunk height in count of subchunks. - * - * @return int */ public function getHeight() : int{ return $this->subChunks->getSize(); @@ -176,11 +162,6 @@ class Chunk{ /** * Sets the blockstate at the given coordinate by internal ID. - * - * @param int $x - * @param int $y - * @param int $z - * @param int $block */ public function setFullBlock(int $x, int $y, int $z, int $block) : void{ $this->getSubChunk($y >> 4)->setFullBlock($x, $y & 0xf, $z, $block); @@ -212,9 +193,6 @@ class Chunk{ $this->getSubChunk($y >> 4)->getBlockSkyLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); } - /** - * @param int $level - */ public function setAllBlockSkyLight(int $level) : void{ for($y = $this->subChunks->count() - 1; $y >= 0; --$y){ $this->getSubChunk($y)->setBlockSkyLightArray(LightArray::fill($level)); @@ -246,9 +224,6 @@ class Chunk{ $this->getSubChunk($y >> 4)->getBlockLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); } - /** - * @param int $level - */ public function setAllBlockLight(int $level) : void{ for($y = $this->subChunks->count() - 1; $y >= 0; --$y){ $this->getSubChunk($y)->setBlockLightArray(LightArray::fill($level)); @@ -279,8 +254,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]; @@ -291,7 +264,6 @@ class Chunk{ * * @param int $x 0-15 * @param int $z 0-15 - * @param int $value */ public function setHeightMap(int $x, int $z, int $value) : void{ $this->heightMap[($z << 4) | $x] = $value; @@ -384,51 +356,30 @@ class Chunk{ $this->dirtyFlags |= self::DIRTY_FLAG_BIOMES; } - /** - * @return bool - */ public function isLightPopulated() : bool{ return $this->lightPopulated; } - /** - * @param bool $value - */ public function setLightPopulated(bool $value = true) : void{ $this->lightPopulated = $value; } - /** - * @return bool - */ public function isPopulated() : bool{ return $this->terrainPopulated; } - /** - * @param bool $value - */ public function setPopulated(bool $value = true) : void{ $this->terrainPopulated = $value; } - /** - * @return bool - */ public function isGenerated() : bool{ return $this->terrainGenerated; } - /** - * @param bool $value - */ public function setGenerated(bool $value = true) : void{ $this->terrainGenerated = $value; } - /** - * @param Entity $entity - */ public function addEntity(Entity $entity) : void{ if($entity->isClosed()){ throw new \InvalidArgumentException("Attempted to add a garbage closed Entity to a chunk"); @@ -439,9 +390,6 @@ class Chunk{ } } - /** - * @param Entity $entity - */ public function removeEntity(Entity $entity) : void{ unset($this->entities[$entity->getId()]); if(!($entity instanceof Player)){ @@ -449,9 +397,6 @@ class Chunk{ } } - /** - * @param Tile $tile - */ public function addTile(Tile $tile) : void{ if($tile->isClosed()){ throw new \InvalidArgumentException("Attempted to add a garbage closed Tile to a chunk"); @@ -465,9 +410,6 @@ class Chunk{ $this->dirtyFlags |= self::DIRTY_FLAG_TILES; } - /** - * @param Tile $tile - */ public function removeTile(Tile $tile) : void{ $pos = $tile->getPos(); unset($this->tiles[Chunk::blockHash($pos->x, $pos->y, $pos->z)]); @@ -503,8 +445,6 @@ class Chunk{ * @param int $x 0-15 * @param int $y * @param int $z 0-15 - * - * @return Tile|null */ public function getTile(int $x, int $y, int $z) : ?Tile{ return $this->tiles[Chunk::blockHash($x, $y, $z)] ?? null; @@ -542,8 +482,6 @@ class Chunk{ /** * Deserializes tiles and entities from NBT - * - * @param World $world */ public function initChunk(World $world) : void{ if($this->NBTentities !== null){ @@ -586,9 +524,6 @@ class Chunk{ } } - /** - * @return string - */ public function getBiomeIdArray() : string{ return $this->biomeIds; } @@ -611,9 +546,6 @@ class Chunk{ $this->heightMap = \SplFixedArray::fromArray($values); } - /** - * @return bool - */ public function isDirty() : bool{ return $this->dirtyFlags !== 0 or !empty($this->tiles) or !empty($this->getSavableEntities()); } @@ -622,9 +554,6 @@ class Chunk{ return ($this->dirtyFlags & $flag) !== 0; } - /** - * @return int - */ public function getDirtyFlags() : int{ return $this->dirtyFlags; } @@ -647,10 +576,6 @@ 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 - * - * @return SubChunkInterface */ public function getSubChunk(int $y) : SubChunkInterface{ if($y < 0 or $y >= $this->subChunks->getSize()){ @@ -662,9 +587,6 @@ class Chunk{ /** * Sets a subchunk in the chunk index - * - * @param int $y - * @param SubChunk|null $subChunk */ public function setSubChunk(int $y, ?SubChunk $subChunk) : void{ if($y < 0 or $y >= $this->subChunks->getSize()){ @@ -697,8 +619,6 @@ class Chunk{ * @param int $x 0-15 * @param int $y * @param int $z 0-15 - * - * @return int */ public static function blockHash(int $x, int $y, int $z) : int{ return ($y << 8) | (($z & 0x0f) << 4) | ($x & 0x0f); diff --git a/src/world/format/SubChunk.php b/src/world/format/SubChunk.php index 0dad3fbb4..5a3f980cc 100644 --- a/src/world/format/SubChunk.php +++ b/src/world/format/SubChunk.php @@ -39,10 +39,7 @@ class SubChunk implements SubChunkInterface{ /** * SubChunk constructor. * - * @param int $default * @param PalettedBlockArray[] $blocks - * @param LightArray|null $skyLight - * @param LightArray|null $blockLight */ public function __construct(int $default, array $blocks, ?LightArray $skyLight = null, ?LightArray $blockLight = null){ $this->defaultBlock = $default; diff --git a/src/world/format/SubChunkInterface.php b/src/world/format/SubChunkInterface.php index 670fac321..8c0af1766 100644 --- a/src/world/format/SubChunkInterface.php +++ b/src/world/format/SubChunkInterface.php @@ -29,34 +29,17 @@ interface SubChunkInterface{ * Returns whether this subchunk contains any non-air blocks. * This function will do a slow check, usually by garbage collecting first. * This is typically useful for disk saving. - * - * @return bool */ public function isEmptyAuthoritative() : bool; /** * Returns a non-authoritative bool to indicate whether the chunk contains any blocks. * This is a fast check, but may be inaccurate if the chunk has been modified and not garbage-collected. - * - * @return bool */ public function isEmptyFast() : 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 $block - */ public function setFullBlock(int $x, int $y, int $z, int $block) : void; /** @@ -64,31 +47,13 @@ interface SubChunkInterface{ */ public function getBlockLayers() : array; - /** - * @param int $x - * @param int $z - * - * @return int - */ public function getHighestBlockAt(int $x, int $z) : int; - /** - * @return LightArray - */ public function getBlockSkyLightArray() : LightArray; - /** - * @param LightArray $data - */ public function setBlockSkyLightArray(LightArray $data) : void; - /** - * @return LightArray - */ public function getBlockLightArray() : LightArray; - /** - * @param LightArray $data - */ public function setBlockLightArray(LightArray $data) : void; } diff --git a/src/world/format/io/BaseWorldProvider.php b/src/world/format/io/BaseWorldProvider.php index 2689d0f6c..c44bf7305 100644 --- a/src/world/format/io/BaseWorldProvider.php +++ b/src/world/format/io/BaseWorldProvider.php @@ -46,7 +46,6 @@ abstract class BaseWorldProvider implements WorldProvider{ } /** - * @return WorldData * @throws CorruptedWorldException * @throws UnsupportedWorldFormatException */ @@ -56,18 +55,11 @@ abstract class BaseWorldProvider implements WorldProvider{ return $this->path; } - /** - * @return WorldData - */ public function getWorldData() : WorldData{ return $this->worldData; } /** - * @param int $chunkX - * @param int $chunkZ - * - * @return Chunk|null * @throws CorruptedChunkException */ public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk{ @@ -82,10 +74,6 @@ abstract class BaseWorldProvider implements WorldProvider{ } /** - * @param int $chunkX - * @param int $chunkZ - * - * @return Chunk|null * @throws CorruptedChunkException */ abstract protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk; diff --git a/src/world/format/io/ChunkUtils.php b/src/world/format/io/ChunkUtils.php index b97dc2e73..9c8ab9893 100644 --- a/src/world/format/io/ChunkUtils.php +++ b/src/world/format/io/ChunkUtils.php @@ -32,8 +32,6 @@ class 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); diff --git a/src/world/format/io/FastChunkSerializer.php b/src/world/format/io/FastChunkSerializer.php index 0ab45ff76..f20842114 100644 --- a/src/world/format/io/FastChunkSerializer.php +++ b/src/world/format/io/FastChunkSerializer.php @@ -48,10 +48,6 @@ final class FastChunkSerializer{ /** * Fast-serializes the chunk for passing between threads * TODO: tiles and entities - * - * @param Chunk $chunk - * - * @return string */ public static function serialize(Chunk $chunk) : string{ $stream = new BinaryStream(); @@ -97,10 +93,6 @@ final class FastChunkSerializer{ /** * Deserializes a fast-serialized chunk - * - * @param string $data - * - * @return Chunk */ public static function deserialize(string $data) : Chunk{ $stream = new BinaryStream($data); diff --git a/src/world/format/io/WorldData.php b/src/world/format/io/WorldData.php index b24b660d2..d3b7757ba 100644 --- a/src/world/format/io/WorldData.php +++ b/src/world/format/io/WorldData.php @@ -32,73 +32,42 @@ interface WorldData{ */ public function save() : void; - /** - * @return string - */ public function getName() : string; /** * Returns the generator name - * - * @return string */ public function getGenerator() : string; - /** - * @return array - */ public function getGeneratorOptions() : array; - /** - * @return int - */ public function getSeed() : int; - - - /** - * @return int - */ public function getTime() : int; - /** - * @param int $value - */ public function setTime(int $value) : void; - - /** - * @return Vector3 - */ public function getSpawn() : Vector3; - /** - * @param Vector3 $pos - */ public function setSpawn(Vector3 $pos) : void; /** * Returns the world difficulty. This will be one of the World constants. - * @return int */ public function getDifficulty() : int; /** * Sets the world difficulty. - * - * @param int $difficulty */ public function setDifficulty(int $difficulty) : void; /** * Returns the time in ticks to the next rain level change. - * @return int */ public function getRainTime() : int; /** * Sets the time in ticks to the next rain level change. - * @param int $ticks */ public function setRainTime(int $ticks) : void; @@ -114,13 +83,11 @@ interface WorldData{ /** * Returns the time in ticks to the next lightning level change. - * @return int */ public function getLightningTime() : int; /** * Sets the time in ticks to the next lightning level change. - * @param int $ticks */ public function setLightningTime(int $ticks) : void; diff --git a/src/world/format/io/WorldProvider.php b/src/world/format/io/WorldProvider.php index 122aca55f..a81e0e5df 100644 --- a/src/world/format/io/WorldProvider.php +++ b/src/world/format/io/WorldProvider.php @@ -31,7 +31,6 @@ use pocketmine\world\format\io\exception\UnsupportedWorldFormatException; interface WorldProvider{ /** - * @param string $path * @throws CorruptedWorldException * @throws UnsupportedWorldFormatException */ @@ -39,34 +38,20 @@ interface WorldProvider{ /** * 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 world. * 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; /** * 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 */ public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk; @@ -78,8 +63,6 @@ interface WorldProvider{ /** * Returns information about the world - * - * @return WorldData */ public function getWorldData() : WorldData; @@ -91,10 +74,6 @@ interface WorldProvider{ /** * Returns a generator which yields all the chunks in this world. * - * @param bool $skipCorrupted - * - * @param \Logger|null $logger - * * @return \Generator|Chunk[] * @throws CorruptedChunkException */ @@ -102,8 +81,6 @@ interface WorldProvider{ /** * Returns the number of chunks in the provider. Used for world conversion time estimations. - * - * @return int */ public function calculateChunkCount() : int; } diff --git a/src/world/format/io/WorldProviderManager.php b/src/world/format/io/WorldProviderManager.php index d5f8bd48f..1c8d0cea8 100644 --- a/src/world/format/io/WorldProviderManager.php +++ b/src/world/format/io/WorldProviderManager.php @@ -47,8 +47,6 @@ abstract class WorldProviderManager{ /** * Returns the default format used to generate new worlds. - * - * @return string */ public static function getDefault() : string{ return self::$default; @@ -67,12 +65,6 @@ abstract class WorldProviderManager{ self::$default = $class; } - /** - * @param string $class - * - * @param string $name - * @param bool $overwrite - */ public static function addProvider(string $class, string $name, bool $overwrite = false) : void{ Utils::testValidInstance($class, WorldProvider::class); @@ -88,8 +80,6 @@ abstract class WorldProviderManager{ /** * Returns a WorldProvider class for this path, or null * - * @param string $path - * * @return string[]|WorldProvider[] */ public static function getMatchingProviders(string $path) : array{ @@ -112,10 +102,6 @@ abstract class WorldProviderManager{ /** * Returns a WorldProvider by name, or null if not found - * - * @param string $name - * - * @return string|null */ public static function getProviderByName(string $name) : ?string{ return self::$providers[trim(strtolower($name))] ?? null; diff --git a/src/world/format/io/WritableWorldProvider.php b/src/world/format/io/WritableWorldProvider.php index 1a5df45c7..ca0069bd8 100644 --- a/src/world/format/io/WritableWorldProvider.php +++ b/src/world/format/io/WritableWorldProvider.php @@ -28,19 +28,11 @@ use pocketmine\world\format\Chunk; interface WritableWorldProvider extends WorldProvider{ /** * Generate the needed files in the path given - * - * @param string $path - * @param string $name - * @param int $seed - * @param string $generator - * @param array $options */ public static function generate(string $path, string $name, int $seed, string $generator, array $options = []) : void; /** * Saves a chunk (usually to disk). - * - * @param Chunk $chunk */ public function saveChunk(Chunk $chunk) : void; } diff --git a/src/world/format/io/data/BaseNbtWorldData.php b/src/world/format/io/data/BaseNbtWorldData.php index 4fd3fc1fc..4a5fcf75f 100644 --- a/src/world/format/io/data/BaseNbtWorldData.php +++ b/src/world/format/io/data/BaseNbtWorldData.php @@ -39,8 +39,6 @@ abstract class BaseNbtWorldData implements WorldData{ protected $compoundTag; /** - * @param string $dataPath - * * @throws CorruptedWorldException * @throws UnsupportedWorldFormatException */ @@ -60,7 +58,6 @@ abstract class BaseNbtWorldData implements WorldData{ } /** - * @return CompoundTag * @throws CorruptedWorldException * @throws UnsupportedWorldFormatException */ diff --git a/src/world/format/io/leveldb/LevelDB.php b/src/world/format/io/leveldb/LevelDB.php index 96690ae0d..319ac2297 100644 --- a/src/world/format/io/leveldb/LevelDB.php +++ b/src/world/format/io/leveldb/LevelDB.php @@ -108,9 +108,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ } /** - * @param string $path - * - * @return \LevelDB * @throws \LevelDBException */ private static function createDB(string $path) : \LevelDB{ @@ -197,9 +194,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ } /** - * @param string $index - * @param int $chunkVersion - * * @return PalettedBlockArray[] */ protected function deserializeLegacyExtraData(string $index, int $chunkVersion) : array{ @@ -232,10 +226,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ } /** - * @param int $chunkX - * @param int $chunkZ - * - * @return Chunk|null * @throws CorruptedChunkException */ protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{ @@ -490,8 +480,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ /** * @param CompoundTag[] $targets - * @param string $index - * @param \LevelDBWriteBatch $write */ private function writeTags(array $targets, string $index, \LevelDBWriteBatch $write) : void{ if(!empty($targets)){ @@ -502,9 +490,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ } } - /** - * @return \LevelDB - */ public function getDatabase() : \LevelDB{ return $this->db; } diff --git a/src/world/format/io/region/LegacyAnvilChunkTrait.php b/src/world/format/io/region/LegacyAnvilChunkTrait.php index f65c37351..aacad403e 100644 --- a/src/world/format/io/region/LegacyAnvilChunkTrait.php +++ b/src/world/format/io/region/LegacyAnvilChunkTrait.php @@ -49,9 +49,6 @@ trait LegacyAnvilChunkTrait{ } /** - * @param string $data - * - * @return Chunk * @throws CorruptedChunkException */ protected function deserializeChunk(string $data) : Chunk{ diff --git a/src/world/format/io/region/McRegion.php b/src/world/format/io/region/McRegion.php index 02a89c6ec..634edde90 100644 --- a/src/world/format/io/region/McRegion.php +++ b/src/world/format/io/region/McRegion.php @@ -39,9 +39,6 @@ use function str_repeat; class McRegion extends RegionWorldProvider{ /** - * @param Chunk $chunk - * - * @return string * @throws \RuntimeException */ protected function serializeChunk(Chunk $chunk) : string{ @@ -49,9 +46,6 @@ class McRegion extends RegionWorldProvider{ } /** - * @param string $data - * - * @return Chunk * @throws CorruptedChunkException */ protected function deserializeChunk(string $data) : Chunk{ diff --git a/src/world/format/io/region/RegionLoader.php b/src/world/format/io/region/RegionLoader.php index 518625fec..974470571 100644 --- a/src/world/format/io/region/RegionLoader.php +++ b/src/world/format/io/region/RegionLoader.php @@ -111,10 +111,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 */ @@ -163,10 +159,6 @@ class RegionLoader{ } /** - * @param int $x - * @param int $z - * - * @return bool * @throws \InvalidArgumentException */ public function chunkExists(int $x, int $z) : bool{ @@ -174,10 +166,6 @@ class RegionLoader{ } /** - * @param int $x - * @param int $z - * @param string $chunkData - * * @throws ChunkException * @throws \InvalidArgumentException */ @@ -207,9 +195,6 @@ class RegionLoader{ } /** - * @param int $x - * @param int $z - * * @throws \InvalidArgumentException */ public function removeChunk(int $x, int $z) : void{ @@ -219,10 +204,6 @@ class RegionLoader{ } /** - * @param int $x - * @param int $z - * - * @return int * @throws \InvalidArgumentException */ protected static function getChunkOffset(int $x, int $z) : int{ @@ -233,7 +214,6 @@ class RegionLoader{ } /** - * @param int $offset * @param int $x reference parameter * @param int $z reference parameter */ diff --git a/src/world/format/io/region/RegionLocationTableEntry.php b/src/world/format/io/region/RegionLocationTableEntry.php index 2d5c69ee6..acca6a80b 100644 --- a/src/world/format/io/region/RegionLocationTableEntry.php +++ b/src/world/format/io/region/RegionLocationTableEntry.php @@ -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; } diff --git a/src/world/format/io/region/RegionWorldProvider.php b/src/world/format/io/region/RegionWorldProvider.php index 79a3cda15..33faba212 100644 --- a/src/world/format/io/region/RegionWorldProvider.php +++ b/src/world/format/io/region/RegionWorldProvider.php @@ -51,13 +51,11 @@ abstract class RegionWorldProvider extends BaseWorldProvider{ /** * Returns the file extension used for regions in this region-based format. - * @return string */ abstract protected static function getRegionFileExtension() : string; /** * Returns the storage version as per Minecraft PC world formats. - * @return int */ abstract protected static function getPcWorldFormatVersion() : int; @@ -105,8 +103,6 @@ abstract class RegionWorldProvider extends BaseWorldProvider{ } /** - * @param int $chunkX - * @param int $chunkZ * @param int $regionX reference parameter * @param int $regionZ reference parameter */ @@ -115,32 +111,17 @@ abstract class RegionWorldProvider extends BaseWorldProvider{ $regionZ = $chunkZ >> 5; } - /** - * @param int $regionX - * @param int $regionZ - * - * @return RegionLoader|null - */ protected function getRegion(int $regionX, int $regionZ) : ?RegionLoader{ return $this->regions[World::chunkHash($regionX, $regionZ)] ?? null; } /** * 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::getRegionFileExtension(); } - /** - * @param int $regionX - * @param int $regionZ - */ protected function loadRegion(int $regionX, int $regionZ) : void{ if(!isset($this->regions[$index = World::chunkHash($regionX, $regionZ)])){ $path = $this->pathToRegion($regionX, $regionZ); @@ -183,17 +164,11 @@ abstract class RegionWorldProvider extends BaseWorldProvider{ abstract protected function serializeChunk(Chunk $chunk) : string; /** - * @param string $data - * - * @return Chunk * @throws CorruptedChunkException */ abstract protected function deserializeChunk(string $data) : Chunk; /** - * @param string $context - * @param ListTag $list - * * @return CompoundTag[] * @throws CorruptedChunkException */ @@ -216,10 +191,6 @@ abstract class RegionWorldProvider extends BaseWorldProvider{ } /** - * @param int $chunkX - * @param int $chunkZ - * - * @return Chunk|null * @throws CorruptedChunkException */ protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{ diff --git a/src/world/generator/Flat.php b/src/world/generator/Flat.php index e284ac137..2e6f370cb 100644 --- a/src/world/generator/Flat.php +++ b/src/world/generator/Flat.php @@ -51,10 +51,6 @@ class Flat extends Generator{ private $preset; /** - * @param ChunkManager $world - * @param int $seed - * @param array $options - * * @throws InvalidGeneratorOptionsException */ public function __construct(ChunkManager $world, int $seed, array $options = []){ @@ -88,8 +84,6 @@ class Flat extends Generator{ } /** - * @param string $layers - * * @return int[] * @throws InvalidGeneratorOptionsException */ diff --git a/src/world/generator/Generator.php b/src/world/generator/Generator.php index 0dd619cba..e428e51be 100644 --- a/src/world/generator/Generator.php +++ b/src/world/generator/Generator.php @@ -35,10 +35,6 @@ abstract class Generator{ /** * Converts a string world seed into an integer for use by the generator. - * - * @param string $seed - * - * @return int|null */ public static function convertSeed(string $seed) : ?int{ if($seed === ""){ //empty seed should cause a random seed to be selected - can't use 0 here because 0 is a valid seed @@ -63,10 +59,6 @@ abstract class Generator{ protected $random; /** - * @param ChunkManager $world - * @param int $seed - * @param array $options - * * @throws InvalidGeneratorOptionsException */ public function __construct(ChunkManager $world, int $seed, array $options = []){ diff --git a/src/world/generator/GeneratorManager.php b/src/world/generator/GeneratorManager.php index 38e40007b..45d8f2083 100644 --- a/src/world/generator/GeneratorManager.php +++ b/src/world/generator/GeneratorManager.php @@ -73,7 +73,6 @@ final class GeneratorManager{ /** * Returns a class name of a registered Generator matching the given name. * - * @param string $name * @param bool $throwOnMissing @deprecated this is for backwards compatibility only * * @return string|Generator Name of class that extends Generator (not an actual Generator object) @@ -95,7 +94,6 @@ final class GeneratorManager{ * * @param string $class Fully qualified name of class that extends \pocketmine\world\generator\Generator * - * @return string * @throws \InvalidArgumentException if the class type cannot be matched to a known alias */ public static function getGeneratorName(string $class) : string{ diff --git a/src/world/generator/biome/BiomeSelector.php b/src/world/generator/biome/BiomeSelector.php index 187757442..e06bbda7a 100644 --- a/src/world/generator/biome/BiomeSelector.php +++ b/src/world/generator/biome/BiomeSelector.php @@ -45,9 +45,6 @@ abstract class BiomeSelector{ /** * Lookup function called by recalculate() to determine the biome to use for this temperature and rainfall. * - * @param float $temperature - * @param float $rainfall - * * @return int biome ID 0-255 */ abstract protected function lookup(float $temperature, float $rainfall) : int; @@ -89,8 +86,6 @@ abstract class BiomeSelector{ /** * @param int $x * @param int $z - * - * @return Biome */ public function pickBiome($x, $z) : Biome{ $temperature = (int) ($this->getTemperature($x, $z) * 63); diff --git a/src/world/generator/hell/Nether.php b/src/world/generator/hell/Nether.php index efb11abed..d6dabd4e7 100644 --- a/src/world/generator/hell/Nether.php +++ b/src/world/generator/hell/Nether.php @@ -51,10 +51,6 @@ class Nether extends Generator{ private $noiseBase; /** - * @param ChunkManager $world - * @param int $seed - * @param array $options - * * @throws InvalidGeneratorOptionsException */ public function __construct(ChunkManager $world, int $seed, array $options = []){ diff --git a/src/world/generator/noise/Noise.php b/src/world/generator/noise/Noise.php index ecf42759d..efe418381 100644 --- a/src/world/generator/noise/Noise.php +++ b/src/world/generator/noise/Noise.php @@ -205,16 +205,6 @@ abstract class Noise{ return $result; } - - /** - * @param int $xSize - * @param int $samplingRate - * @param int $x - * @param int $y - * @param int $z - * - * @return \SplFixedArray - */ public function getFastNoise1D(int $xSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{ if($samplingRate === 0){ throw new \InvalidArgumentException("samplingRate cannot be 0"); @@ -239,16 +229,6 @@ abstract class Noise{ return $noiseArray; } - /** - * @param int $xSize - * @param int $zSize - * @param int $samplingRate - * @param int $x - * @param int $y - * @param int $z - * - * @return \SplFixedArray - */ public function getFastNoise2D(int $xSize, int $zSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{ assert($samplingRate !== 0, new \InvalidArgumentException("samplingRate cannot be 0")); @@ -285,19 +265,6 @@ abstract class Noise{ return $noiseArray; } - /** - * @param int $xSize - * @param int $ySize - * @param int $zSize - * @param int $xSamplingRate - * @param int $ySamplingRate - * @param int $zSamplingRate - * @param int $x - * @param int $y - * @param int $z - * - * @return array - */ public function getFastNoise3D(int $xSize, int $ySize, int $zSize, int $xSamplingRate, int $ySamplingRate, int $zSamplingRate, int $x, int $y, int $z) : array{ assert($xSamplingRate !== 0, new \InvalidArgumentException("xSamplingRate cannot be 0")); diff --git a/src/world/generator/normal/Normal.php b/src/world/generator/normal/Normal.php index 848597c0f..edb03999c 100644 --- a/src/world/generator/normal/Normal.php +++ b/src/world/generator/normal/Normal.php @@ -58,10 +58,6 @@ class Normal extends Generator{ private static $SMOOTH_SIZE = 2; /** - * @param ChunkManager $world - * @param int $seed - * @param array $options - * * @throws InvalidGeneratorOptionsException */ public function __construct(ChunkManager $world, int $seed, array $options = []){ diff --git a/src/world/generator/object/Tree.php b/src/world/generator/object/Tree.php index be9a2adf6..b8345ba9c 100644 --- a/src/world/generator/object/Tree.php +++ b/src/world/generator/object/Tree.php @@ -50,11 +50,6 @@ abstract class Tree{ } /** - * @param ChunkManager $world - * @param int $x - * @param int $y - * @param int $z - * @param Random $random * @param TreeType|null $type default oak * * @throws \InvalidArgumentException diff --git a/src/world/generator/populator/Populator.php b/src/world/generator/populator/Populator.php index 5c43d964c..f0d0f7b8d 100644 --- a/src/world/generator/populator/Populator.php +++ b/src/world/generator/populator/Populator.php @@ -31,11 +31,5 @@ use pocketmine\world\ChunkManager; abstract class Populator{ - /** - * @param ChunkManager $world - * @param int $chunkX - * @param int $chunkZ - * @param Random $random - */ abstract public function populate(ChunkManager $world, int $chunkX, int $chunkZ, Random $random) : void; } diff --git a/src/world/particle/FloatingTextParticle.php b/src/world/particle/FloatingTextParticle.php index 0f9ceb7dd..8785eebfc 100644 --- a/src/world/particle/FloatingTextParticle.php +++ b/src/world/particle/FloatingTextParticle.php @@ -51,10 +51,6 @@ class FloatingTextParticle implements Particle{ /** @var bool */ protected $invisible = false; - /** - * @param string $text - * @param string $title - */ public function __construct(string $text, string $title = ""){ $this->text = $text; $this->title = $title; diff --git a/src/world/particle/Particle.php b/src/world/particle/Particle.php index b800a66d9..4ed80a7c0 100644 --- a/src/world/particle/Particle.php +++ b/src/world/particle/Particle.php @@ -29,8 +29,6 @@ use pocketmine\network\mcpe\protocol\ClientboundPacket; interface Particle{ /** - * @param Vector3 $pos - * * @return ClientboundPacket|ClientboundPacket[] */ public function encode(Vector3 $pos); diff --git a/src/world/particle/PotionSplashParticle.php b/src/world/particle/PotionSplashParticle.php index 70ccd9632..89f9cf047 100644 --- a/src/world/particle/PotionSplashParticle.php +++ b/src/world/particle/PotionSplashParticle.php @@ -40,16 +40,11 @@ class PotionSplashParticle implements Particle{ * Returns the default water-bottle splash colour. * * TODO: replace this with a standard surrogate object constant (first we need to implement them!) - * - * @return Color */ public static function DEFAULT_COLOR() : Color{ return new Color(0x38, 0x5d, 0xc6); } - /** - * @return Color - */ public function getColor() : Color{ return $this->color; } diff --git a/src/world/sound/ClickSound.php b/src/world/sound/ClickSound.php index 7fcb02fce..67d904784 100644 --- a/src/world/sound/ClickSound.php +++ b/src/world/sound/ClickSound.php @@ -35,9 +35,6 @@ class ClickSound implements Sound{ $this->pitch = $pitch; } - /** - * @return float - */ public function getPitch() : float{ return $this->pitch; } diff --git a/src/world/sound/DoorSound.php b/src/world/sound/DoorSound.php index e457e086d..57f2ba6f9 100644 --- a/src/world/sound/DoorSound.php +++ b/src/world/sound/DoorSound.php @@ -35,9 +35,6 @@ class DoorSound implements Sound{ $this->pitch = $pitch; } - /** - * @return float - */ public function getPitch() : float{ return $this->pitch; } diff --git a/src/world/sound/FizzSound.php b/src/world/sound/FizzSound.php index d572d7c71..1f10bd22a 100644 --- a/src/world/sound/FizzSound.php +++ b/src/world/sound/FizzSound.php @@ -35,9 +35,6 @@ class FizzSound implements Sound{ $this->pitch = $pitch; } - /** - * @return float - */ public function getPitch() : float{ return $this->pitch; } diff --git a/src/world/sound/LaunchSound.php b/src/world/sound/LaunchSound.php index 423289b14..e84a4a1de 100644 --- a/src/world/sound/LaunchSound.php +++ b/src/world/sound/LaunchSound.php @@ -35,9 +35,6 @@ class LaunchSound implements Sound{ $this->pitch = $pitch; } - /** - * @return float - */ public function getPitch() : float{ return $this->pitch; } diff --git a/src/world/sound/NoteInstrument.php b/src/world/sound/NoteInstrument.php index 255bfe1f8..a6fd778f2 100644 --- a/src/world/sound/NoteInstrument.php +++ b/src/world/sound/NoteInstrument.php @@ -59,9 +59,6 @@ final class NoteInstrument{ $this->magicNumber = $magicNumber; } - /** - * @return int - */ public function getMagicNumber() : int{ return $this->magicNumber; } diff --git a/src/world/sound/PopSound.php b/src/world/sound/PopSound.php index d38b6473c..6bec571a9 100644 --- a/src/world/sound/PopSound.php +++ b/src/world/sound/PopSound.php @@ -35,9 +35,6 @@ class PopSound implements Sound{ $this->pitch = $pitch; } - /** - * @return float - */ public function getPitch() : float{ return $this->pitch; } diff --git a/src/world/sound/Sound.php b/src/world/sound/Sound.php index ad486f0b6..e44c0ecce 100644 --- a/src/world/sound/Sound.php +++ b/src/world/sound/Sound.php @@ -29,8 +29,6 @@ use pocketmine\network\mcpe\protocol\ClientboundPacket; interface Sound{ /** - * @param Vector3|null $pos - * * @return ClientboundPacket|ClientboundPacket[] */ public function encode(?Vector3 $pos); diff --git a/src/world/sound/XpLevelUpSound.php b/src/world/sound/XpLevelUpSound.php index 6e41e9689..837067446 100644 --- a/src/world/sound/XpLevelUpSound.php +++ b/src/world/sound/XpLevelUpSound.php @@ -37,9 +37,6 @@ class XpLevelUpSound implements Sound{ $this->xpLevel = $xpLevel; } - /** - * @return int - */ public function getXpLevel() : int{ return $this->xpLevel; } diff --git a/src/world/utils/SubChunkIteratorManager.php b/src/world/utils/SubChunkIteratorManager.php index a8fcf0794..5512f4251 100644 --- a/src/world/utils/SubChunkIteratorManager.php +++ b/src/world/utils/SubChunkIteratorManager.php @@ -90,8 +90,6 @@ class SubChunkIteratorManager{ /** * Returns whether we currently have a valid terrain pointer. - * - * @return bool */ public function isValid() : bool{ return $this->currentSubChunk !== null;