Fixed bug configuration saved incorrectly. issue #274

This commit is contained in:
t3hk0d3 2012-02-22 05:05:13 +04:00
parent a1824fff5b
commit 8eea065876

View File

@ -18,6 +18,7 @@
*/ */
package ru.tehkode.modifyworld.bukkit; package ru.tehkode.modifyworld.bukkit;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.ArrayList; import java.util.ArrayList;
@ -72,10 +73,16 @@ public class Modifyworld extends JavaPlugin {
} else { } else {
logger.info("[Modifyworld] Modifyworld disabled. Check config.yml!"); logger.info("[Modifyworld] Modifyworld disabled. Check config.yml!");
this.getPluginLoader().disablePlugin(this); this.getPluginLoader().disablePlugin(this);
return;
} }
try { try {
config.save("config.yml"); File configFile = new File(this.getDataFolder(), "config.yml");
if(!configFile.exists()) {
configFile.mkdirs();
}
config.save(configFile);
} catch (IOException e) { } catch (IOException e) {
logger.severe("[Modifyworld] Can't save new configuration file!"); logger.severe("[Modifyworld] Can't save new configuration file!");
} }