PLugin Makeing A PLugin Start

Discussion in 'Plugin Development' started by ajcool1050, Jun 20, 2012.

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

    ajcool1050

    What code would i use to make my plugin start another plugin in a designated folder/jar
     
  2. Offline

    zhuowei

    Code:
    File file = new File("myjar.jar");
    PluginManager manager = getServer().getPluginManager();
    Plugin plugin = manager.loadPlugin(file);
    manager.enablePlugin(plugin);
    
    Why do you need to do this?

    Edit: enable it.
     
  3. Offline

    ajcool1050

    i wanted to orginaze all my plugins on my server into serten folders but i would need a plugin to run them when there in a seprate folder
     
  4. Offline

    zhuowei

    You might also want to try:
    Code:
    File folder = new File("plugins/folder1");
    PluginManager manager = getServer().getPluginManager();
    Plugin[] plugins = manager.loadPlugins(folder);
    for (Plugin plugin: plugins) {
       manager.enablePlugins(plugins);
    }
    This should let it load all the .jars from a folder, then enable them all.
     
  5. Offline

    ajcool1050

    Cool thanks and this would need to be all under OnEnable right
     
  6. Offline

    zhuowei

    I guess so. Good luck with the plugin!
     
  7. Offline

    ajcool1050

Thread Status:
Not open for further replies.

Share This Page