From 4c212585254a0dd0429a04bc239350a8e2e04f82 Mon Sep 17 00:00:00 2001 From: j502647092 Date: Sun, 4 Oct 2015 20:16:10 +0800 Subject: [PATCH] useing pluginhelper... Signed-off-by: j502647092 --- .../org/maxgamer/QuickShop/Util/MsgUtil.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java index d459874..7b37aa5 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java @@ -1,7 +1,5 @@ package org.maxgamer.QuickShop.Util; -import java.io.File; -import java.io.InputStream; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; @@ -21,6 +19,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.maxgamer.QuickShop.QuickShop; import org.maxgamer.QuickShop.Shop.Shop; +import cn.citycraft.PluginHelper.config.FileConfig; import mkremins.fanciful.FancyMessage; @SuppressWarnings("deprecation") @@ -72,18 +71,7 @@ public class MsgUtil { */ public static void loadCfgMessages() { // Load messages.yml - final File messageFile = new File(plugin.getDataFolder(), "messages.yml"); - if (!messageFile.exists()) { - plugin.getLogger().info("Creating messages.yml"); - plugin.saveResource("messages.yml", true); - } - // Store it - messages = YamlConfiguration.loadConfiguration(messageFile); - messages.options().copyDefaults(true); - // Load default messages - final InputStream defMessageStream = plugin.getResource("messages.yml"); - final YamlConfiguration defMessages = YamlConfiguration.loadConfiguration(defMessageStream); - messages.setDefaults(defMessages); + messages = new FileConfig(plugin, "message.yml"); // Parse colour codes Util.parseColours(messages); }