diff --git a/src/Matthww/PlayerInfo/PlayerInfo.php b/src/Matthww/PlayerInfo/PlayerInfo.php index b313676..38c3827 100644 --- a/src/Matthww/PlayerInfo/PlayerInfo.php +++ b/src/Matthww/PlayerInfo/PlayerInfo.php @@ -34,29 +34,29 @@ class PlayerInfo extends PluginBase implements Listener { public function onPacketReceived(DataPacketReceiveEvent $receiveEvent) { $pk = $receiveEvent->getPacket(); - if($pk instanceof LoginPacket){ + if($pk instanceof LoginPacket) { $this->PlayerData[$pk->username] = $pk->clientData; } } public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool { - if (strtolower($command->getName()) == "playerinfo" or strtolower($command->getName()) == "pinfo") { + if(strtolower($command->getName()) == "playerinfo" or strtolower($command->getName()) == "pinfo") { $os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"]; $UI = ["Classic UI", "Pocket UI"]; $Controls = ["Unknown", "Mouse", "Touch", "Controller"]; $GUI = [-2 => "Minimum", -1 => "Medium", 0 => "Maximum"]; - if ($sender->hasPermission("playerinfo.use")) { - if ($sender instanceof ConsoleCommandSender) { - if (isset($args[0])) { + if($sender->hasPermission("playerinfo.use")) { + if($sender instanceof ConsoleCommandSender) { + if(isset($args[0])) { $target = $this->getServer()->getPlayer($args[0]); } else { $sender->sendMessage(TF::RED . "[Error] Please specify a player"); return false; } } else { - if ($sender instanceof Player and !isset($args[0])) { + if($sender instanceof Player and !isset($args[0])) { $target = $sender->getPlayer(); } else { $target = $this->getServer()->getPlayer($args[0]); @@ -66,34 +66,34 @@ class PlayerInfo extends PluginBase implements Listener { $sender->sendMessage(TF::RED . "[Error] No permission"); return false; } - if ($target instanceof Player) { + if($target instanceof Player) { $cdata = $this->PlayerData[$target->getName()]; $sender->sendMessage(TF::GREEN . TF::BOLD . "===" . TF::GREEN . "Player Info" . TF::GREEN . TF::BOLD . "==="); - if ($this->getConfig()->get("Name") == true) { + if($this->getConfig()->get("Name") == true) { $sender->sendMessage(TF::AQUA . "Name: " . TF::RED . $target->getDisplayName()); } - if ($this->getConfig()->get("IP") == true) { + if($this->getConfig()->get("IP") == true) { $sender->sendMessage(TF::AQUA . "IP: " . TF::RED . $target->getAddress()); } - if ($this->getConfig()->get("OS") == true) { + if($this->getConfig()->get("OS") == true) { $sender->sendMessage(TF::AQUA . "OS: " . TF::RED . $os[$cdata["DeviceOS"]]); } - if ($this->getConfig()->get("Model") == true) { + if($this->getConfig()->get("Model") == true) { $sender->sendMessage(TF::AQUA . "Model: " . TF::RED . $cdata["DeviceModel"]); } - if ($this->getConfig()->get("UI") == true) { + if($this->getConfig()->get("UI") == true) { $sender->sendMessage(TF::AQUA . "UI: " . TF::RED . $UI[$cdata["UIProfile"]]); } - if ($this->getConfig()->get("GUI") == true) { + if($this->getConfig()->get("GUI") == true) { $sender->sendMessage(TF::AQUA . "GUI Scale: " . TF::RED . $GUI[$cdata["GuiScale"]]); } - if ($this->getConfig()->get("Controls") == true) { + if($this->getConfig()->get("Controls") == true) { $sender->sendMessage(TF::AQUA . "Controls: " . TF::RED . $Controls[$cdata["CurrentInputMode"]]); } - if ($this->getConfig()->get("Health") == true) { + if($this->getConfig()->get("Health") == true) { $sender->sendMessage(TF::AQUA . "Health: " . TF::RED . $target->getHealth() . "HP"); } - if ($this->getConfig()->get("Position") == true) { + if($this->getConfig()->get("Position") == true) { $sender->sendMessage(TF::AQUA . "Position: " . TF::RED . "X: " . $target->getFloorX() . ", Y: " . $target->getFloorY() . ", Z: " . $target->getFloorZ()); } $sender->sendMessage(TF::GREEN . TF::BOLD . "================");