diff options
author | sk89q <the.sk89q@gmail.com> | 2011-01-15 01:45:36 -0800 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-01-15 01:45:36 -0800 |
commit | 93f49248ac4450e88cdbc75be28aa664a6626aa5 (patch) | |
tree | cd1667f6ebffc24261a11d292fdf2bb319d41029 | |
parent | b8c238008775c4b7ca69322398d52bb40fb3bf96 (diff) | |
download | bukkit-93f49248ac4450e88cdbc75be28aa664a6626aa5.tar bukkit-93f49248ac4450e88cdbc75be28aa664a6626aa5.tar.gz bukkit-93f49248ac4450e88cdbc75be28aa664a6626aa5.tar.lz bukkit-93f49248ac4450e88cdbc75be28aa664a6626aa5.tar.xz bukkit-93f49248ac4450e88cdbc75be28aa664a6626aa5.zip |
JavaPlugin now loads the configuration file on load. getConfiguration() now is much cheaper to call.
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/JavaPlugin.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index 0f1f2ab7..859e016e 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -19,6 +19,7 @@ public abstract class JavaPlugin implements Plugin { private final PluginDescriptionFile description; private final File dataFolder; private final ClassLoader classLoader; + private final Configuration config; /** * Constructs a new Java plugin instance @@ -39,6 +40,8 @@ public abstract class JavaPlugin implements Plugin { description = desc; dataFolder = folder; classLoader = cLoader; + config = new Configuration(new File(dataFolder, "config.yml")); + config.load(); } /** @@ -105,9 +108,6 @@ public abstract class JavaPlugin implements Plugin { * @return */ public Configuration getConfiguration() { - Configuration config = - new Configuration(new File(dataFolder, "config.yml")); - config.load(); return config; } |