Config files generate properly on reload.

This commit is contained in:
Adam committed 2012-05-16 15:48:54 -04:00
1 parent 6aa10fca11
commit 9de009cc44
2 files changed
+20 -10

No files matched your search

@@ -65,19 +65,11 @@ public class Anticheat extends JavaPlugin
public void onEnable()
{
plugin = this;
if(!new File(this.getDataFolder()+"/config.yml").exists())
{
saveDefaultConfig();
if(verbose)
{
logger.log(Level.INFO,"[AC] Config file created");
}
}
checkConfig();
config = AnticheatManager.CONFIGURATION;
verbose = config.verboseStartup();
updateFolder = config.updateFolder();
checkForUpdate();
eventList.add(new PlayerListener());
eventList.add(new BlockListener());
eventList.add(new EntityListener());
@@ -216,6 +208,18 @@ public class Anticheat extends JavaPlugin
}
}
}
public static void checkConfig()
{
if(!config.getConfigFile().exists())
{
plugin.saveDefaultConfig();
if(verbose)
{
logger.log(Level.INFO,"[AC] Config file created");
}
}
}
private void checkForUpdate()
{