diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-03 02:25:09 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-03 02:25:09 +0000 |
commit | c7b0db5f50a5610bd81ed2838da5928ab6c87b86 (patch) | |
tree | 2b46c5b235bb44c8dfa910048552df077bd0d88c /src/main/java | |
parent | 620c42b321400454fb7b9da0ea63760a89da94df (diff) | |
download | craftbukkit-c7b0db5f50a5610bd81ed2838da5928ab6c87b86.tar craftbukkit-c7b0db5f50a5610bd81ed2838da5928ab6c87b86.tar.gz craftbukkit-c7b0db5f50a5610bd81ed2838da5928ab6c87b86.tar.lz craftbukkit-c7b0db5f50a5610bd81ed2838da5928ab6c87b86.tar.xz craftbukkit-c7b0db5f50a5610bd81ed2838da5928ab6c87b86.zip |
Enable plugins by default the right way
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 70f78cd8..a6af4cf5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -8,6 +8,7 @@ import net.minecraft.server.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.server.ServerConfigurationManager; import org.bukkit.*; +import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.SimplePluginManager; import org.bukkit.plugin.java.JavaPluginLoader; @@ -29,11 +30,16 @@ public final class CraftServer implements Server { pluginManager.RegisterInterface(JavaPluginLoader.class); File pluginFolder = new File("plugins"); + if (pluginFolder.exists()) { try { - pluginManager.loadPlugins(pluginFolder); + Plugin[] plugins = plugins = pluginManager.loadPlugins(pluginFolder); + + for (Plugin plugin : plugins) { + plugin.getPluginLoader().enablePlugin(plugin); + } } 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, "(Is it up to date?)", ex); } } else { pluginFolder.mkdir(); |