Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused parameters and imports && updated php docs #456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -110,15 +104,13 @@
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;
use pocketmine\network\protocol\PlayStatusPacket;
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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down