Solved Get Data File From a Different Plugin

Discussion in 'Plugin Development' started by CoderConrad, Feb 13, 2014.

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

    CoderConrad

    I have made an Economy plugin and all of the money is saved to a Config file and is there a way I can get the money from the Config on a different plugin??
     
  2. Offline

    xTigerRebornx

    CoderConrad Depends, are you using that plugin's getConfig() Config, or a custom one? If so, then you can add your Economy plugin as a dependancy and then use Bukkit.getServer().getPluginManager().getPlugin("YourEconPlugin").getConfig() (Not tested, but you should get the general idea)
     
  3. Offline

    jthort

  4. Offline

    xTigerRebornx

    jthort Its his economy plugin, so he'd have to implement the API himself (or try and hook it into Vault)
     
    jthort likes this.
  5. Offline

    CoderConrad

    jthort xTigerRebornx

    I will try first to do the (Bukkit.getServer().getPluginManager().getPlugin("YourEconPlugin").getConfig() (Not tested, but you should get the general idea)) idea on my other plugin and see if that works...

    Thanks!
     
  6. Offline

    Cryices

    Code:
            File file = new File("plugins" + File.separator + "<pluginname>" + File.separator + "config.yml");
            FileConfiguration theconfig = YamlConfiguration.loadConfiguration(file);
            theconfig.set("poop", "blah");
     
Thread Status:
Not open for further replies.

Share This Page