mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-04-18 21:05:26 +00:00
fix bug that makes servers unable to start because of no internet (#28)
useless fix but it's pretty much good enough for testing servers --------- Co-authored-by: poggit-bot <poggitbot@gmail.com>
This commit is contained in:
parent
68941bd668
commit
4a643bbc4c
@ -15,13 +15,13 @@ class FetchModelsTask extends AsyncTask {
|
||||
}
|
||||
|
||||
public function onRun(): void {
|
||||
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml")->getBody();
|
||||
if(!is_string($result)) {
|
||||
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user