mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Fixed plugin dataFolder
This commit is contained in:
parent
5dafe8e7f0
commit
c167defa72
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PocketMine;
|
namespace PocketMine;
|
||||||
|
use PocketMine\Utils\TextFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the achievement list and a bit more
|
* Handles the achievement list and a bit more
|
||||||
@ -105,9 +106,9 @@ abstract class Achievement{
|
|||||||
public static function broadcast(Player $player, $achievementId){
|
public static function broadcast(Player $player, $achievementId){
|
||||||
if(isset(Achievement::$list[$achievementId])){
|
if(isset(Achievement::$list[$achievementId])){
|
||||||
if(Server::getInstance()->getConfigString("announce-player-achievements", true) === true){
|
if(Server::getInstance()->getConfigString("announce-player-achievements", true) === true){
|
||||||
Server::getInstance()->broadcastMessage($player->getDisplayName() . " has just earned the achievement " . Achievement::$list[$achievementId]["name"]);
|
Server::getInstance()->broadcastMessage($player->getDisplayName() . " has just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
|
||||||
}else{
|
}else{
|
||||||
$player->sendMessage("You have just earned the achievement " . Achievement::$list[$achievementId]["name"]);
|
$player->sendMessage("You have just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -357,7 +357,7 @@ namespace PocketMine {
|
|||||||
$server = new Server($autoloader, \PocketMine\PATH, \PocketMine\DATA, \PocketMine\PLUGIN_PATH);
|
$server = new Server($autoloader, \PocketMine\PATH, \PocketMine\DATA, \PocketMine\PLUGIN_PATH);
|
||||||
$server->start();
|
$server->start();
|
||||||
|
|
||||||
kill(getmypid());
|
//kill(getmypid());
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ class HelpCommand extends VanillaCommand{
|
|||||||
if(($command = Server::getInstance()->getCommandMap()->getCommand(strtolower($command))) instanceof Command){
|
if(($command = Server::getInstance()->getCommandMap()->getCommand(strtolower($command))) instanceof Command){
|
||||||
if($command->testPermissionSilent($sender)){
|
if($command->testPermissionSilent($sender)){
|
||||||
$message = TextFormat::YELLOW . "--------- " . TextFormat::WHITE . " Help: /" . $command->getName() . TextFormat::YELLOW . " ---------\n";
|
$message = TextFormat::YELLOW . "--------- " . TextFormat::WHITE . " Help: /" . $command->getName() . TextFormat::YELLOW . " ---------\n";
|
||||||
$message .= TextFormat::DARK_GREEN . "Description: " . TextFormat::WHITE . $command->getDescription() . "\n";
|
$message .= TextFormat::GOLD . "Description: " . TextFormat::WHITE . $command->getDescription() . "\n";
|
||||||
$message .= TextFormat::DARK_GREEN . "Usage: " . TextFormat::WHITE . implode("\n" . TextFormat::WHITE, explode("\n", $command->getUsage())) . "\n";
|
$message .= TextFormat::GOLD . "Usage: " . TextFormat::WHITE . implode("\n" . TextFormat::WHITE, explode("\n", $command->getUsage())) . "\n";
|
||||||
$sender->sendMessage($message);
|
$sender->sendMessage($message);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -51,7 +51,7 @@ class FolderPluginLoader implements PluginLoader{
|
|||||||
if(is_dir($file) and file_exists($file . "/plugin.yml") and file_exists($file . "/src/")){
|
if(is_dir($file) and file_exists($file . "/plugin.yml") and file_exists($file . "/src/")){
|
||||||
if(($description = $this->getPluginDescription($file)) instanceof PluginDescription){
|
if(($description = $this->getPluginDescription($file)) instanceof PluginDescription){
|
||||||
console("[INFO] Loading " . $description->getName());
|
console("[INFO] Loading " . $description->getName());
|
||||||
$dataFolder = basename($file) . "/" . $description->getName();
|
$dataFolder = dirname($file) . DIRECTORY_SEPARATOR . $description->getName();
|
||||||
if(file_exists($dataFolder) and !is_dir($dataFolder)){
|
if(file_exists($dataFolder) and !is_dir($dataFolder)){
|
||||||
trigger_error("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory", E_USER_WARNING);
|
trigger_error("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory", E_USER_WARNING);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user