From 8eea065876d393bab81757357b4ab81b0f948857 Mon Sep 17 00:00:00 2001 From: t3hk0d3 Date: Wed, 22 Feb 2012 05:05:13 +0400 Subject: [PATCH] Fixed bug configuration saved incorrectly. issue #274 --- .../java/ru/tehkode/modifyworld/bukkit/Modifyworld.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/tehkode/modifyworld/bukkit/Modifyworld.java b/src/main/java/ru/tehkode/modifyworld/bukkit/Modifyworld.java index f6ffef2..2d66682 100644 --- a/src/main/java/ru/tehkode/modifyworld/bukkit/Modifyworld.java +++ b/src/main/java/ru/tehkode/modifyworld/bukkit/Modifyworld.java @@ -18,6 +18,7 @@ */ package ru.tehkode.modifyworld.bukkit; +import java.io.File; import java.io.IOException; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -72,10 +73,16 @@ public class Modifyworld extends JavaPlugin { } else { logger.info("[Modifyworld] Modifyworld disabled. Check config.yml!"); this.getPluginLoader().disablePlugin(this); + return; } try { - config.save("config.yml"); + File configFile = new File(this.getDataFolder(), "config.yml"); + if(!configFile.exists()) { + configFile.mkdirs(); + } + + config.save(configFile); } catch (IOException e) { logger.severe("[Modifyworld] Can't save new configuration file!"); }