Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What's wrong?

Comments in 'Plugin Development' started by KingDeadKnight, Mar 18, 2016.

Thread Status:
Not open for further replies.
  1. KingDeadKnight
    Offline

    KingDeadKnight New Member

    Joined:
    Oct 18, 2015
    Posts:
    33
    Minecraft User:
    KingDeadKnight
    I got this error:

    Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 8, column 1), context while scanning for the next token (line 8, column 1) in phar:///home/gsp_614/srv5.hmserv.eu-19150/ImagicalMine.phar/src/pocketmine/plugin/PluginDescription.php on line 56
    [36m[07:15:56] [m[31merror> [37mCould not load '/home/gsp_614/srv5.hmserv.eu-19150/plugins/Regles-master' in folder '/home/gsp_614/srv5.hmserv.eu-19150/plugins/': Argument 1 passed to pocketmine\plugin\PluginDescription::loadMap() must be of the type array, boolean given, called in phar:///home/gsp_614/srv5.hmserv.eu-19150/ImagicalMine.phar/src/pocketmine/plugin/PluginDescription.php on line 56[m
    [36m[07:15:56] [m[31mcritical> [37mTypeError: "Argument 1 passed to pocketmine\plugin\PluginDescription::loadMap() must be of the type array, boolean given, called in phar:///home/gsp_614/srv5.hmserv.eu-19150/ImagicalMine.phar/src/pocketmine/plugin/PluginDescription.php on line 56" (EXCEPTION) in "/src/pocketmine/plugin/PluginDescription" at line 64

    And there is my main code and my plugin yml

    PHP:
    <?php

    namespace KingDeadKnight\Regles;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\plugin\PluginDescription;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\utils\Config;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\Player;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\command\Command;

    class 
    Main extends PluginBase implements Listener{

        
    /** @var Cfg $cfg */
        
    private $cfg;

        public function 
    translateColors($symbol$message){
       
            
    $message str_replace($symbol."0"TextFormat::BLACK$message);
            
    $message str_replace($symbol."1"TextFormat::DARK_BLUE$message);
            
    $message str_replace($symbol."2"TextFormat::DARK_GREEN$message);
            
    $message str_replace($symbol."3"TextFormat::DARK_AQUA$message);
            
    $message str_replace($symbol."4"TextFormat::DARK_RED$message);
            
    $message str_replace($symbol."5"TextFormat::DARK_PURPLE$message);
            
    $message str_replace($symbol."6"TextFormat::GOLD$message);
            
    $message str_replace($symbol."7"TextFormat::GRAY$message);
            
    $message str_replace($symbol."8"TextFormat::DARK_GRAY$message);
            
    $message str_replace($symbol."9"TextFormat::BLUE$message);
            
    $message str_replace($symbol."a"TextFormat::GREEN$message);
            
    $message str_replace($symbol."b"TextFormat::AQUA$message);
            
    $message str_replace($symbol."c"TextFormat::RED$message);
            
    $message str_replace($symbol."d"TextFormat::LIGHT_PURPLE$message);
            
    $message str_replace($symbol."e"TextFormat::YELLOW$message);
            
    $message str_replace($symbol."f"TextFormat::WHITE$message);
       
            
    $message str_replace($symbol."k"TextFormat::OBFUSCATED$message);
            
    $message str_replace($symbol."l"TextFormat::BOLD$message);
            
    $message str_replace($symbol."m"TextFormat::STRIKETHROUGH$message);
            
    $message str_replace($symbol."n"TextFormat::UNDERLINE$message);
            
    $message str_replace($symbol."o"TextFormat::ITALIC$message);
            
    $message str_replace($symbol."r"TextFormat::RESET$message);
       
            return 
    $message;
        }
       
      public function 
    onEnable(){
       if(!
    is_dir($this->getDataFolder())) mkdir($this->getDataFolder());
       
    $this->saveResource("config.yml");
       
    $this->cfg $this->getConfig()->getAll();
       }
             
          public function 
    onCommand(CommandSender $senderCommand $cmd$label, array $args){
              if(
    $cmd->getName() == "regle"){
            
    $this->args $this->getConfig()->get("regles");
            
    $sender->sendMessage($this->translateColors("&"$this->args));
          }
          return 
    true;
        }
    }
    PHP:
    nameRegles
    main
    KingDeadKnight\Regles\Main
    api
    1.14.0
    author
    KingDeadKnight
    version
    0.6

    commands
    :
        
    regle:
            
    descriptionObtiens les regles du serveur !
  2. TheDeibo
    Offline

    TheDeibo Notable Member Plugin Developer

    Joined:
    Sep 8, 2014
    Posts:
    692
    Plugins:
    1
    Minecraft User:
    TheDeibo
    1. README FIRST
    2. Change your API to API 2.
    3. Your layout is slightly messy
    Skullex likes this.
  3. TheNewHEROBRINE
    Offline

    TheNewHEROBRINE New Member

    Joined:
    Mar 5, 2016
    Posts:
    10
    Minecraft User:
    TheNewHEROBRINE
    I tried to run it and it works for me. So be sure to don't use tabs in the plugin.yml but only spaces
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do you know what /** @var Cfg $cfg */ means? In your scope, the type reference `Cfg` doesn't exist.
    Survingo likes this.
  5. KingDeadKnight
    Offline

    KingDeadKnight New Member

    Joined:
    Oct 18, 2015
    Posts:
    33
    Minecraft User:
    KingDeadKnight
    I'm beginner and I try to learn by myself, it's one point
    Second, don't need too change to api 2 if my version of IM is for 1.14.0
  6. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Buddy, this is PocketMine!
    That's a difference like Google and an toaster!
    Last edited: Mar 18, 2016
  7. KingDeadKnight
    Offline

    KingDeadKnight New Member

    Joined:
    Oct 18, 2015
    Posts:
    33
    Minecraft User:
    KingDeadKnight
    Maybe it's another software but we are a community about mcpe so don't care about the software, and help each other, no?
    Tim // robske Büba likes this.
  8. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Nope, this section is for PocketMine-MP Plugin Development and nothing else.
    Just support for PM related builds but not other software
    Last edited: Mar 19, 2016
    Primus likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement