mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-09-08 08:52:44 +00:00
Compare commits
6 Commits
4b4e8bcc18
...
55e3a9df9e
Author | SHA1 | Date | |
---|---|---|---|
55e3a9df9e | |||
94cab0f223 | |||
8e659424cd | |||
7ac9fd5280 | |||
b805123b10 | |||
a3d19b77c8 |
@ -6,8 +6,8 @@ use pocketmine\utils\Internet;
|
|||||||
|
|
||||||
class FetchModelsTask extends AsyncTask {
|
class FetchModelsTask extends AsyncTask {
|
||||||
|
|
||||||
private $path;
|
protected $path;
|
||||||
private $version;
|
protected $version;
|
||||||
|
|
||||||
public function __construct(string $path, string $version) {
|
public function __construct(string $path, string $version) {
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
@ -15,11 +15,12 @@ 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")->getBody();
|
||||||
if(!is_string($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);
|
||||||
$this->setResult(true);
|
$this->setResult(true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user