1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-11-23 02:08:55 +00:00

useing pluginhelper...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-10-04 20:16:10 +08:00
parent 4a8d08e575
commit 4c21258525

View File

@ -1,7 +1,5 @@
package org.maxgamer.QuickShop.Util; package org.maxgamer.QuickShop.Util;
import java.io.File;
import java.io.InputStream;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
@ -21,6 +19,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.maxgamer.QuickShop.QuickShop; import org.maxgamer.QuickShop.QuickShop;
import org.maxgamer.QuickShop.Shop.Shop; import org.maxgamer.QuickShop.Shop.Shop;
import cn.citycraft.PluginHelper.config.FileConfig;
import mkremins.fanciful.FancyMessage; import mkremins.fanciful.FancyMessage;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -72,18 +71,7 @@ public class MsgUtil {
*/ */
public static void loadCfgMessages() { public static void loadCfgMessages() {
// Load messages.yml // Load messages.yml
final File messageFile = new File(plugin.getDataFolder(), "messages.yml"); messages = new FileConfig(plugin, "message.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);
// Parse colour codes // Parse colour codes
Util.parseColours(messages); Util.parseColours(messages);
} }