mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-21 07:50:52 +01:00
No longer hardcoding sample plugin, now uses plugins dir
This commit is contained in:
parent
c8b9f833d9
commit
cc734a3aa6
1 changed files with 10 additions and 7 deletions
|
@ -29,13 +29,16 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
pluginManager.RegisterInterface(JavaPluginLoader.class);
|
pluginManager.RegisterInterface(JavaPluginLoader.class);
|
||||||
|
|
||||||
|
File pluginFolder = new File("plugins");
|
||||||
|
if (pluginFolder.exists()) {
|
||||||
try {
|
try {
|
||||||
pluginManager.loadPlugin(new File("SamplePlugin.jar"));
|
pluginManager.loadPlugins(pluginFolder);
|
||||||
} catch (InvalidPluginException ex) {
|
|
||||||
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex);
|
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
pluginFolder.mkdir();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
Loading…
Reference in a new issue