Compare commits

...

6 Commits

Author SHA1 Message Date
55e3a9df9e modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php 2023-08-15 20:30:15 +07:00
94cab0f223 modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php 2023-08-15 20:29:05 +07:00
8e659424cd modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php 2023-08-15 20:27:34 +07:00
7ac9fd5280 modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php 2023-08-15 20:26:03 +07:00
b805123b10 Update PlayerInfo.php 2023-08-15 20:23:43 +07:00
a3d19b77c8 Create .poggit.yml
Poggit-CI is enabled for this repo by @mukeenanyafiq
Visit the Poggit-CI page for this repo at https://poggit.pmmp.io/ci/mukeenanyafiq/PlayerInfo
2023-08-15 20:22:06 +07:00
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace Matthww\PlayerInfo;
namespace Matthww\PlayerInfo;
use Matthww\PlayerInfo\Tasks\FetchModelsTask;
use Matthww\PlayerInfo\Tasks\LoadTask;

View File

@ -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;
@ -15,11 +15,12 @@ class FetchModelsTask extends AsyncTask {
}
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")->getBody();
if(!is_string($result)) {
$this->setResult(false);
return;
}
file_put_contents($this->path. "models.yml", $result);
$this->setResult(true);
}