From de243e58c8fce2fdc5257cbc0e624a3f6c61f0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Sat, 9 Dec 2017 18:03:47 +0300 Subject: [PATCH] . Removed unused parameters and imports updated php docs --- src/pocketmine/Player.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index af7528e12..2992f5b5b 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -46,7 +46,6 @@ use pocketmine\event\player\PlayerChatEvent; use pocketmine\event\player\PlayerCommandPreprocessEvent; use pocketmine\event\player\PlayerCommandPostprocessEvent; -use pocketmine\event\player\PlayerCreationEvent; use pocketmine\event\player\PlayerDeathEvent; use pocketmine\event\player\PlayerDropItemEvent; use pocketmine\event\player\PlayerGameModeChangeEvent; @@ -65,11 +64,11 @@ use pocketmine\event\player\PlayerToggleSprintEvent; use pocketmine\event\server\DataPacketSendEvent; use pocketmine\event\TextContainer; -use pocketmine\event\Timings; use pocketmine\inventory\BaseTransaction; use pocketmine\inventory\BigShapedRecipe; use pocketmine\inventory\BigShapelessRecipe; use pocketmine\inventory\EnchantInventory; +use pocketmine\inventory\transactions\SimpleTransactionData; use pocketmine\inventory\Inventory; use pocketmine\inventory\InventoryHolder; use pocketmine\inventory\PlayerInventory; @@ -81,18 +80,14 @@ use pocketmine\item\Armor; use pocketmine\item\Tool; use pocketmine\item\Potion; -use pocketmine\level\format\FullChunk; -use pocketmine\level\format\LevelProvider; use pocketmine\level\Level; use pocketmine\level\Location; use pocketmine\level\Position; use pocketmine\level\sound\LaunchSound; use pocketmine\math\AxisAlignedBB; -use pocketmine\math\Vector2; use pocketmine\math\Vector3; use pocketmine\metadata\MetadataValue; use pocketmine\nbt\NBT; -use pocketmine\nbt\tag\ByteTag; use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\DoubleTag; use pocketmine\nbt\tag\Enum; @@ -101,7 +96,6 @@ use pocketmine\nbt\tag\LongTag; use pocketmine\nbt\tag\ShortTag; use pocketmine\nbt\tag\StringTag; -use pocketmine\network\Network; use pocketmine\network\protocol\AdventureSettingsPacket; use pocketmine\network\protocol\AnimatePacket; use pocketmine\network\protocol\BatchPacket; @@ -110,7 +104,6 @@ use pocketmine\network\protocol\DataPacket; use pocketmine\network\protocol\DisconnectPacket; use pocketmine\network\protocol\EntityEventPacket; -use pocketmine\network\protocol\FullChunkDataPacket; use pocketmine\network\protocol\Info as ProtocolInfo; use pocketmine\network\protocol\Info; use pocketmine\network\protocol\PlayerActionPacket; @@ -118,7 +111,6 @@ use pocketmine\network\protocol\PlayerListPacket; use pocketmine\network\protocol\RespawnPacket; use pocketmine\network\protocol\SetEntityDataPacket; -use pocketmine\network\protocol\StrangePacket; use pocketmine\network\protocol\TextPacket; use pocketmine\network\protocol\MovePlayerPacket; use pocketmine\network\protocol\SetDifficultyPacket; @@ -129,7 +121,6 @@ use pocketmine\network\protocol\TakeItemEntityPacket; use pocketmine\network\protocol\TransferPacket; use pocketmine\network\protocol\UpdateAttributesPacket; -use pocketmine\network\protocol\SetHealthPacket; use pocketmine\network\protocol\UpdateBlockPacket; use pocketmine\network\protocol\ChunkRadiusUpdatePacket; use pocketmine\network\protocol\InteractPacket; @@ -144,12 +135,9 @@ use pocketmine\utils\TextFormat; use pocketmine\network\protocol\SetPlayerGameTypePacket; use pocketmine\block\Liquid; -use pocketmine\network\protocol\SetCommandsEnabledPacket; use pocketmine\network\protocol\AvailableCommandsPacket; -use pocketmine\network\protocol\ResourcePackDataInfoPacket; use pocketmine\network\protocol\ResourcePacksInfoPacket; use pocketmine\network\protocol\ResourcePackStackPacket; -use raklib\Binary; use pocketmine\network\protocol\ServerToClientHandshakePacket; use pocketmine\item\enchantment\Enchantment; use pocketmine\item\Elytra; @@ -643,7 +631,7 @@ public function __construct(SourceInterface $interface, $clientID, $ip, $port){ $this->clientID = $clientID; $this->spawnPosition = null; $this->gamemode = $this->server->getGamemode(); - $this->setLevel($this->server->getDefaultLevel(), true); + $this->setLevel($this->server->getDefaultLevel()); $this->newPosition = new Vector3(0, 0, 0); $this->checkMovement = (bool) $this->server->getAdvancedProperty("main.check-movement", true); $this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0); @@ -4075,9 +4063,9 @@ private function breakBlock($blockPosition) { * @minProtocolSupport 120 * @param InventoryTransactionPacket $packet */ - private function normalTransactionLogic($packet) { - $trGroup = new SimpleTransactionGroup($this); - foreach ($packet->transactions as $trData) { + private function normalTransactionLogic(InventoryTransactionPacket $packet) { + $trGroup = new SimpleTransactionGroup($this); + foreach ($packet->transactions as $trData) { // echo $trData . PHP_EOL; if ($trData->isDropItemTransaction()) { $this->tryDropItem($packet->transactions); @@ -4099,8 +4087,6 @@ private function normalTransactionLogic($packet) { if (!$trGroup->execute()) { // echo '[INFO] Transaction execute fail.'.PHP_EOL; $trGroup->sendInventories(); - } else { -// echo '[INFO] Transaction successfully executed.'.PHP_EOL; } } catch (\Exception $ex) { echo '[INFO] Transaction execute exception. ' . $ex->getMessage() .PHP_EOL;