mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-09-07 00:29:10 +00:00
Compare commits
6 Commits
4b4e8bcc18
...
55e3a9df9e
Author | SHA1 | Date | |
---|---|---|---|
55e3a9df9e | |||
94cab0f223 | |||
8e659424cd | |||
7ac9fd5280 | |||
b805123b10 | |||
a3d19b77c8 |
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Matthww\PlayerInfo;
|
||||
namespace Matthww\PlayerInfo;
|
||||
|
||||
use Matthww\PlayerInfo\Tasks\FetchModelsTask;
|
||||
use Matthww\PlayerInfo\Tasks\LoadTask;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user