No longer hardcoding sample plugin, now uses plugins dir

This commit is contained in:
Dinnerbone 2010-12-24 19:04:35 +00:00
parent c8b9f833d9
commit cc734a3aa6

View File

@ -29,13 +29,16 @@ public final class CraftServer implements Server {
pluginManager.RegisterInterface(JavaPluginLoader.class);
File pluginFolder = new File("plugins");
if (pluginFolder.exists()) {
try {
pluginManager.loadPlugin(new File("SamplePlugin.jar"));
} catch (InvalidPluginException ex) {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, null, ex);
pluginManager.loadPlugins(pluginFolder);
} catch (Throwable ex) {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex);
}
} else {
pluginFolder.mkdir();
}
}
public String getName() {