Fixed plugin dataFolder

This commit is contained in:
Shoghi Cervantes 2014-03-31 22:35:42 +02:00
parent 5dafe8e7f0
commit c167defa72
4 changed files with 7 additions and 6 deletions

View File

@ -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;

View File

@ -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);
} }

View File

@ -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;

View File

@ -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);