Compare commits

..

8 Commits

Author SHA1 Message Date
f86a7c5e44 modified: src/Matthww/PlayerInfo/PlayerInfo.php 2023-08-15 05:47:35 +07:00
2b82d564eb modified: src/Matthww/PlayerInfo/PlayerInfo.php 2023-08-15 05:46:21 +07:00
cc7e6c74af Merge branch 'master' of https://github.com/mukeenanyafiq/PlayerInfo 2023-08-14 19:50:45 +07:00
39bf52ed79 modified: src/Matthww/PlayerInfo/PlayerInfo.php 2023-08-14 19:50:01 +07:00
af1162e256 Update README.md 2023-08-14 19:34:16 +07:00
4c1e026fc9 Update plugin.yml 2023-08-14 19:03:04 +07:00
0c7827e18c modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php 2023-08-14 18:45:06 +07:00
2743b944a6 modified: plugin.yml
modified:   resources/config.yml
	modified:   resources/models.yml
	modified:   src/Matthww/PlayerInfo/PlayerInfo.php
	modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php
	modified:   src/Matthww/PlayerInfo/Tasks/LoadTask.php
	modified:   src/Matthww/PlayerInfo/Tasks/SaveTask.php
	modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php
2023-08-14 18:43:14 +07:00
4 changed files with 8 additions and 9 deletions

View File

@ -8,7 +8,7 @@ We also have a shorter command:\
`/pinfo <player>`
#### Permission:
`playerinfo.use` - Allows the user/player to use the command `/playerinfo`
`playerinfo.use` - Allows operator to use the command `/playerinfo`
#### Example:

View File

@ -15,4 +15,4 @@ commands:
permissions:
playerinfo.use:
default: op
description: "Allows the user/player to execute the playerinfo command"
description: "Allows operator to execute the playerinfo command"

View File

@ -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 " .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;
}
}

View File

@ -6,8 +6,8 @@ use pocketmine\utils\Internet;
class FetchModelsTask extends AsyncTask {
protected $path;
protected $version;
private $path;
private $version;
public function __construct(string $path, string $version) {
$this->path = $path;
@ -16,12 +16,11 @@ class FetchModelsTask extends AsyncTask {
public function onRun(): void {
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
if(is_null($result)) {
if(!is_string($result)) {
$this->setResult(false);
return;
}
file_put_contents($this->path. "models.yml", $result->getBody());
file_put_contents($this->path. "models.yml", $result);
$this->setResult(true);
}
}