mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-09-09 01:06:44 +00:00
Compare commits
2 Commits
f86a7c5e44
...
master
Author | SHA1 | Date | |
---|---|---|---|
4a643bbc4c | |||
68941bd668 |
@ -8,7 +8,7 @@ We also have a shorter command:\
|
||||
`/pinfo <player>`
|
||||
|
||||
#### Permission:
|
||||
`playerinfo.use` - Allows operator to use the command `/playerinfo`
|
||||
`playerinfo.use` - Allows the user/player to use the command `/playerinfo`
|
||||
|
||||
#### Example:
|
||||
|
||||
|
@ -15,4 +15,4 @@ commands:
|
||||
permissions:
|
||||
playerinfo.use:
|
||||
default: op
|
||||
description: "Allows operator to execute the playerinfo command"
|
||||
description: "Allows the user/player to execute the playerinfo command"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Matthww\PlayerInfo;
|
||||
namespace Matthww\PlayerInfo;
|
||||
|
||||
use Matthww\PlayerInfo\Tasks\FetchModelsTask;
|
||||
use Matthww\PlayerInfo\Tasks\LoadTask;
|
||||
@ -103,7 +103,7 @@ class PlayerInfo extends PluginBase implements Listener {
|
||||
$this->getScheduler()->scheduleTask(new LoadTask($this, $sender, $args[0]));
|
||||
return true;
|
||||
} else {
|
||||
$sender->sendMessage(TF::RED . "[PlayerInfo] Player " .$args[0]. " is not online or does not exist!");
|
||||
$sender->sendMessage(TF::RED . "[PlayerInfo] Player " .TF::WHITE. $args[0]. TF::RED. " is not online or does not exist!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ use pocketmine\utils\Internet;
|
||||
|
||||
class FetchModelsTask extends AsyncTask {
|
||||
|
||||
private $path;
|
||||
private $version;
|
||||
protected $path;
|
||||
protected $version;
|
||||
|
||||
public function __construct(string $path, string $version) {
|
||||
$this->path = $path;
|
||||
@ -16,11 +16,12 @@ class FetchModelsTask extends AsyncTask {
|
||||
|
||||
public function onRun(): void {
|
||||
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
|
||||
if(!is_string($result)) {
|
||||
if(is_null($result)) {
|
||||
$this->setResult(false);
|
||||
return;
|
||||
}
|
||||
file_put_contents($this->path. "models.yml", $result);
|
||||
|
||||
file_put_contents($this->path. "models.yml", $result->getBody());
|
||||
$this->setResult(true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user