1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-03 15:11:09 +01:00

No longer hardcoding sample plugin, now uses plugins dir

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2010-12-24 19:04:35 +00:00
parent f78b33d338
commit c723d80ad5

View file

@ -28,13 +28,16 @@ public final class CraftServer implements Server {
server = console.f; server = console.f;
pluginManager.RegisterInterface(JavaPluginLoader.class); pluginManager.RegisterInterface(JavaPluginLoader.class);
try { File pluginFolder = new File("plugins");
pluginManager.loadPlugin(new File("SamplePlugin.jar")); if (pluginFolder.exists()) {
} catch (InvalidPluginException ex) { try {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, null, ex); pluginManager.loadPlugins(pluginFolder);
} 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();
} }
} }