Skip to content

Commit eb7a192

Browse files
committed
[F] Fix self reloading
1 parent e33eb91 commit eb7a192

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.hydev.mcpm.client.loader;
2+
3+
import org.bukkit.plugin.Plugin;
4+
import org.bukkit.plugin.java.JavaPlugin;
5+
6+
import java.io.File;
7+
8+
/**
9+
* Entry point for plugin helper in order to reload itself
10+
*/
11+
@SuppressWarnings("unused")
12+
public class PluginLoaderHelper extends JavaPlugin
13+
{
14+
/**
15+
* Reload the mcpm plugin through the helper plugin
16+
*
17+
* @param instance Instance of the mcpm plugin
18+
* @param jar Jar file path of the mcpm plugin
19+
*/
20+
public void reloadMcpm(Plugin instance, File jar)
21+
{
22+
System.out.println("Unloading MCPM...");
23+
PluginLoader.unloadPlugin(instance);
24+
System.out.println("Loading MCPM...");
25+
PluginLoader.loadPluginHelper(jar);
26+
}
27+
}

0 commit comments

Comments
 (0)