From bbbaa5a8aa09edaf1f4efe6ab5af68c1243b3e10 Mon Sep 17 00:00:00 2001 From: Jos van 't Hof Date: Wed, 4 Apr 2012 13:33:07 +0200 Subject: [PATCH] Moved FileConfiguration declaration to loadYamls(). This fixes reload problems. --- .../me/Josvth/RandomSpawn/Handlers/YamlHandler.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/randomspawn-paper/Random Spawn/src/me/Josvth/RandomSpawn/Handlers/YamlHandler.java b/plugins/randomspawn-paper/Random Spawn/src/me/Josvth/RandomSpawn/Handlers/YamlHandler.java index 029921678..1f5c450ae 100644 --- a/plugins/randomspawn-paper/Random Spawn/src/me/Josvth/RandomSpawn/Handlers/YamlHandler.java +++ b/plugins/randomspawn-paper/Random Spawn/src/me/Josvth/RandomSpawn/Handlers/YamlHandler.java @@ -22,7 +22,7 @@ public class YamlHandler{ public FileConfiguration spawnLocations; public YamlHandler(RandomSpawn instance) { - this.plugin = instance; + plugin = instance; setupYamls(); loadYamls(); } @@ -35,14 +35,16 @@ public class YamlHandler{ if (!(configFile.exists())){this.plugin.saveResource("config.yml", false);} // loads default config's on first run if (!(worldsFile.exists())){this.plugin.saveResource("worlds.yml", false);} if (!(spawnLocationsFile.exists())){this.plugin.saveResource("spawnLocations.yml", false);} + + } + + public void loadYamls() { config = new YamlConfiguration(); worlds = new YamlConfiguration(); spawnLocations = new YamlConfiguration(); - } - - public void loadYamls() { - loadConfig(); + + loadConfig(); loadWorlds(); loadSpawnLocations(); }