From 6ca1f24ee2bb91405cfe874e7cdbe3007401092b Mon Sep 17 00:00:00 2001 From: Raphfrk Date: Sat, 12 Mar 2011 17:38:10 +0000 Subject: [PATCH] Adds an onLoad method to Plugin. The onLoad method is called for all plugins before the onEnable calls --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c8478195eb..2db3f4b752 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -59,6 +59,13 @@ public final class CraftServer implements Server { if (pluginFolder.exists()) { try { Plugin[] plugins = pluginManager.loadPlugins(pluginFolder); + for (Plugin plugin : plugins) { + try { + plugin.onLoad(); + } catch (AbstractMethodError ame) { + Logger.getLogger("Minecraft").warning("Plugin: " + plugin.getDescription().getName() + " does not support the onLoad() method"); + } + } for (Plugin plugin : plugins) { loadPlugin(plugin); }