mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-11-12 17:52:41 +00:00
Compare commits
6 Commits
master
...
cc7e6c74af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc7e6c74af | ||
|
|
39bf52ed79 | ||
|
|
af1162e256 | ||
|
|
4c1e026fc9 | ||
|
|
0c7827e18c | ||
|
|
2743b944a6 |
@@ -8,7 +8,7 @@ We also have a shorter command:\
|
|||||||
`/pinfo <player>`
|
`/pinfo <player>`
|
||||||
|
|
||||||
#### Permission:
|
#### Permission:
|
||||||
`playerinfo.use` - Allows the user/player to use the command `/playerinfo`
|
`playerinfo.use` - Allows operator to use the command `/playerinfo`
|
||||||
|
|
||||||
#### Example:
|
#### Example:
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ commands:
|
|||||||
permissions:
|
permissions:
|
||||||
playerinfo.use:
|
playerinfo.use:
|
||||||
default: op
|
default: op
|
||||||
description: "Allows the user/player to execute the playerinfo command"
|
description: "Allows operator to execute the playerinfo command"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Matthww\PlayerInfo;
|
namespace Matthww\PlayerInfo;
|
||||||
|
|
||||||
use Matthww\PlayerInfo\Tasks\FetchModelsTask;
|
use Matthww\PlayerInfo\Tasks\FetchModelsTask;
|
||||||
use Matthww\PlayerInfo\Tasks\LoadTask;
|
use Matthww\PlayerInfo\Tasks\LoadTask;
|
||||||
@@ -9,6 +9,8 @@ use pocketmine\command\Command;
|
|||||||
use pocketmine\command\CommandSender;
|
use pocketmine\command\CommandSender;
|
||||||
use pocketmine\event\Listener;
|
use pocketmine\event\Listener;
|
||||||
use pocketmine\event\player\PlayerJoinEvent;
|
use pocketmine\event\player\PlayerJoinEvent;
|
||||||
|
use pocketmine\event\server\DataPacketReceiveEvent;
|
||||||
|
use pocketmine\network\mcpe\protocol\LoginPacket;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\plugin\PluginBase;
|
use pocketmine\plugin\PluginBase;
|
||||||
use pocketmine\utils\TextFormat as TF;
|
use pocketmine\utils\TextFormat as TF;
|
||||||
@@ -17,6 +19,7 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
protected $DeviceOS;
|
protected $DeviceOS;
|
||||||
protected $DeviceModel;
|
protected $DeviceModel;
|
||||||
protected $UIProfile;
|
protected $UIProfile;
|
||||||
|
protected $PlayerData;
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function onEnable(): void {
|
public function onEnable(): void {
|
||||||
@@ -103,7 +106,7 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
$this->getScheduler()->scheduleTask(new LoadTask($this, $sender, $args[0]));
|
$this->getScheduler()->scheduleTask(new LoadTask($this, $sender, $args[0]));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$sender->sendMessage(TF::RED . "[PlayerInfo] Player " .TF::WHITE. $args[0]. TF::RED. " is not online or does not exist!");
|
$sender->sendMessage(TF::RED . "[PlayerInfo] Player " .$args[0]. " is not online or does not exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ use pocketmine\utils\Internet;
|
|||||||
|
|
||||||
class FetchModelsTask extends AsyncTask {
|
class FetchModelsTask extends AsyncTask {
|
||||||
|
|
||||||
protected $path;
|
private $path;
|
||||||
protected $version;
|
private $version;
|
||||||
|
|
||||||
public function __construct(string $path, string $version) {
|
public function __construct(string $path, string $version) {
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
@@ -16,12 +16,11 @@ class FetchModelsTask extends AsyncTask {
|
|||||||
|
|
||||||
public function onRun(): void {
|
public function onRun(): void {
|
||||||
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
|
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
|
||||||
if(is_null($result)) {
|
if(!is_string($result)) {
|
||||||
$this->setResult(false);
|
$this->setResult(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
file_put_contents($this->path. "models.yml", $result);
|
||||||
file_put_contents($this->path. "models.yml", $result->getBody());
|
|
||||||
$this->setResult(true);
|
$this->setResult(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user