summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-20 00:43:06 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-20 00:43:06 +0000
commit346de2a934f3e6cd648f02268aa2c175d34c808b (patch)
tree2bafc14f026728e4fea9ddcff2bc4cc4a11eea78 /src
parent1a2c15414559b638bbf764f1b4d4c1cc024d51af (diff)
downloadbukkit-346de2a934f3e6cd648f02268aa2c175d34c808b.tar
bukkit-346de2a934f3e6cd648f02268aa2c175d34c808b.tar.gz
bukkit-346de2a934f3e6cd648f02268aa2c175d34c808b.tar.lz
bukkit-346de2a934f3e6cd648f02268aa2c175d34c808b.tar.xz
bukkit-346de2a934f3e6cd648f02268aa2c175d34c808b.zip
... Supporting the plugins which really shouldn't be doing what they're doing. Don't put crap in the constructor!
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/plugin/java/JavaPlugin.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index 14b526c1..ada269f6 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -38,6 +38,8 @@ public abstract class JavaPlugin implements Plugin {
public JavaPlugin(PluginLoader pluginLoader, Server instance,
PluginDescriptionFile desc, File folder, File plugin,
ClassLoader cLoader) {
+ initialize(pluginLoader, instance, desc, folder, plugin, cLoader);
+
System.out.println("Using the stupidly long constructor " + desc.getMain() + "(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is no longer recommended. Go nag the plugin author of " + desc.getName() + " to remove it! (Nothing is broken, we just like to keep code clean.)");
ArrayList<String> authors = desc.getAuthors();
@@ -161,22 +163,20 @@ public abstract class JavaPlugin implements Plugin {
* @param file File containing this plugin
* @param classLoader ClassLoader which holds this plugin
*/
- protected void initialize(PluginLoader loader, Server server,
+ protected final void initialize(PluginLoader loader, Server server,
PluginDescriptionFile description, File dataFolder, File file,
ClassLoader classLoader) {
- if (initialized) {
- throw new UnsupportedOperationException("Cannot reinitialize a plugin");
+ if (!initialized) {
+ this.initialized = true;
+ this.loader = loader;
+ this.server = server;
+ this.file = file;
+ this.description = description;
+ this.dataFolder = dataFolder;
+ this.classLoader = classLoader;
+ this.config = new Configuration(new File(dataFolder, "config.yml"));
+ this.config.load();
}
-
- this.initialized = true;
- this.loader = loader;
- this.server = server;
- this.file = file;
- this.description = description;
- this.dataFolder = dataFolder;
- this.classLoader = classLoader;
- this.config = new Configuration(new File(dataFolder, "config.yml"));
- this.config.load();
}
/**