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

Open/Get Files from other Plugins..

Comments in 'Plugin Development' started by Marcelo234, Feb 6, 2016.

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hey Guys...I want to have a file from a other Plugin...So how to write?
    This DIDN'T work:
    PHP:
    $this->player = new Config($this->getDataFolder() . "Money/PlayersInfo/" strtolower($player->getName()), Config::YAML);
    In this Example "Money" is a other Plugin...But remember(this won't work)
    Thanks Marcelo234
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    $this->player = new Config($this->getServer()->getDataPath() . "/plugins/Money/PlayersInfo/" strtolower($player->getName()) . ".yml"Config::YAML);
    Tho, if both plugins are yours, I would rather use an API.
    Last edited: Feb 6, 2016
    applqpak likes this.
  3. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
  4. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Code:
    [11:40:52] [Server thread/INFO]: Luchs joined the game
    [11:40:59] [Server thread/CRITICAL]: Could not save Config
    Why?
    C:\Users\Marcelo\Desktop\McKaff_BowBash\McKaff_BowBash\plugins\McKaff_BowBash//plugins/McKaff_BowBash/PlayersInfo/luchs: file_put_contents(C:\Users\Marcelo\Desktop\McKaff_BowBash\McKaff_BowBash\plugins\McKaff_BowBash//plugins/McKaff_BowBash/PlayersInfo/luchs): failed to open stream: No such file or directory
    [11:41:01] [Server thread/INFO]: Luchs left the game
    
  5. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Read the problem
  6. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    The File i want to get is in [plugins/Money/resources/PlayersInfo/Luchs]
    And if i look at the Error it seams that the Plugin search in [plugins/otherplugin/Mony/resources/PlayersInfo/Luchs
  7. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Must the Plugin be instanceof a .phar? And what I must write if my otherplugin is an source-plugin?
  8. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    resources is the file where the not written config is. You have to look in /pluginss/PlayersInfo/Luchs
  9. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    PHP:
    public function registerSettings(){
            
    $settings = ["McKaff_Settings"];
            foreach(
    $settings as $plugin){
                
    $ins $this->getServer()->getPluginManager()->getPlugin($plugin);
                if(
    $ins instanceof Plugin && $ins->isEnabled()){
                    
    $this->settings $ins;
                    
    $this->getServer()->getLogger()->info(TextFormat::BLUE."[BB]Sucesfully connected with $plugin");
                }
                else{
                    
    $this->getServer()->getLogger()->info(TextFormat::RED."[BB]WARNING! Can't find $plugin");
                }
            }
        }
    If I start the Server there stand "[BB]WARNING! Can't find $plugin"
    INFO: The McKaff_Settings-Plugin is in the Pluginfolder!
    It works only if the Plugin is a .phar....But is there a way ,that the McKaff_Settings-Plugin could be a sourcefolder?
    I think this is the Problem in my Thread....This is the ground, why my Server didn't get the right parth's!
    Thanks Marcelo234
  10. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Do you have any loader that supports loading from source? For example Dev Tools
    PEMapModder likes this.
  11. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Yes
    DevTools

Share This Page

Advertisement