plugin reload without reload command?

Discussion in 'Programming' started by Kristall01, May 10, 2016.

  1. Hi guys,

    I'm working on a plugin for my friend's server providing some cool stuff. This plugin is in early developement phase, so I got an idea to use an updater. This updater would use a custom server from where the plugin could download the updated version of this itself. So this updater section is used with the command '/updatefunplugin', and the newer version is downloaded to the plugins folder (if my update server is online).

    My problem is that I need to reload the server to the downloaded version take effect. Because of certain reasons I can't use neither the '/reload' nor the '/stop' command to reload the server. Is there any method/plugin providing the function of reloading a plugin from its file with the avoidance of those two commands?
     
  2. Code (Text):
    Bukkit.getServer().reload();
    Good luck.
     
  3. You can do this?
    What the fuck how was I missing this all this time D:
     
  4. I think what he was trying to achieve was not to reload the server completly but to reload a single plugin, right @Kristall01?
     
  5. Try this:

    Code (Text):
    try {
      Bukkit.getPluginManager().loadPlugin(new File("plugins/Plugin.jar"));
    }
    catch (UnknownDependencyException | InvalidPluginException| InvalidDescriptionException e) {
      e.printStackTrace();
    }