From df7a15f4f9022b28b348f344222612b3adaab596 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 15 Jan 2011 01:45:36 -0800 Subject: [PATCH] JavaPlugin now loads the configuration file on load. getConfiguration() now is much cheaper to call. By: sk89q --- .../src/main/java/org/bukkit/plugin/java/JavaPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index 0f1f2ab740..859e016e6c 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/paper-api/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; }