From cc734a3aa60b147f2d356e329ed94ca91623bed0 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 24 Dec 2010 19:04:35 +0000 Subject: [PATCH] No longer hardcoding sample plugin, now uses plugins dir --- src/org/bukkit/craftbukkit/CraftServer.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/org/bukkit/craftbukkit/CraftServer.java b/src/org/bukkit/craftbukkit/CraftServer.java index 7467dee201..9af29a4db6 100644 --- a/src/org/bukkit/craftbukkit/CraftServer.java +++ b/src/org/bukkit/craftbukkit/CraftServer.java @@ -28,13 +28,16 @@ public final class CraftServer implements Server { server = console.f; pluginManager.RegisterInterface(JavaPluginLoader.class); - - try { - pluginManager.loadPlugin(new File("SamplePlugin.jar")); - } catch (InvalidPluginException ex) { - Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, null, ex); - } catch (Throwable ex) { - Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex); + + File pluginFolder = new File("plugins"); + if (pluginFolder.exists()) { + try { + pluginManager.loadPlugins(pluginFolder); + } catch (Throwable ex) { + Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex); + } + } else { + pluginFolder.mkdir(); } }