Compare commits

..

2 Commits

Author SHA1 Message Date
4a643bbc4c 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>
2023-12-10 14:12:08 +01:00
68941bd668 Update 2.1.5: Support PMMP 5.0.0 and being able to see players Port and UUID, also saving them to the file (#27)
* 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

* modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php

* Update plugin.yml

* Update README.md

* modified:   src/Matthww/PlayerInfo/PlayerInfo.php

* modified:   src/Matthww/PlayerInfo/PlayerInfo.php

* modified:   src/Matthww/PlayerInfo/PlayerInfo.php

* modified:   src/Matthww/PlayerInfo/PlayerInfo.php

* 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

* Update PlayerInfo.php

* modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php

* modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php

* modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php

* modified:   src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php

* Update README.md

* Update plugin.yml

---------

Co-authored-by: poggit-bot <poggitbot@gmail.com>
2023-11-01 09:23:27 +01:00
4 changed files with 9 additions and 8 deletions

View File

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

View File

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

View File

@ -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 " .$args[0]. " is not online or does not exist!");
$sender->sendMessage(TF::RED . "[PlayerInfo] Player " .TF::WHITE. $args[0]. TF::RED. " is not online or does not exist!");
return false;
}
}

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;
@ -16,11 +16,12 @@ class FetchModelsTask extends AsyncTask {
public function onRun(): void {
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
if(!is_string($result)) {
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);
}
}