From a98acb58de7fba3af35ba0ab5586587c79e5bef2 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 20 Nov 2015 13:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B1=89=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=83=A8=E5=88=86...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../org/maxgamer/QuickShop/QuickShop.java | 13 +++++----- .../org/maxgamer/QuickShop/Util/Util.java | 24 +------------------ 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/main/java/org/maxgamer/QuickShop/QuickShop.java b/src/main/java/org/maxgamer/QuickShop/QuickShop.java index 3aec0f8..2c5fd09 100644 --- a/src/main/java/org/maxgamer/QuickShop/QuickShop.java +++ b/src/main/java/org/maxgamer/QuickShop/QuickShop.java @@ -142,12 +142,9 @@ public class QuickShop extends JavaPlugin { public boolean loadEcon() { final EconomyCore core = new Economy_Vault(); if (!core.isValid()) { - // getLogger().severe("Economy is not valid!"); getLogger().warning("无法找到经济管理类插件..."); getLogger().warning("卸载插件!!!"); this.getPluginLoader().disablePlugin(this); - // if(econ.equals("Vault")) - // getLogger().severe("(Does Vault have an Economy to hook into?!)"); return false; } else { this.economy = new Economy(core); @@ -186,12 +183,14 @@ public class QuickShop extends JavaPlugin { /* Empty the buffer */ if (database != null) { database.close(); + try { + database.getConnection().close(); + } catch (final SQLException e) { + } } - try { - this.database.getConnection().close(); - } catch (final SQLException e) { + if (configManager != null) { + configManager.getWarnings().clear(); } - configManager.getWarnings().clear(); } @Override diff --git a/src/main/java/org/maxgamer/QuickShop/Util/Util.java b/src/main/java/org/maxgamer/QuickShop/Util/Util.java index 1267b8f..5029bcd 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/Util.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/Util.java @@ -163,7 +163,7 @@ public class Util { public static String getName(final ItemStack i) { // final String vanillaName = getDataName(i.getType(), i.getDurability()); final String vanillaName = LocalUtil.getItemName(i); - return prettifyText(vanillaName); + return vanillaName; } // Let's make very long names shorter for our sign @@ -532,28 +532,6 @@ public class Util { } } - /** - * Converts a name like IRON_INGOT into Iron Ingot to improve readability - * - * @param ugly - * The string such as IRON_INGOT - * @return A nicer version, such as Iron Ingot - * - */ - public static String prettifyText(final String ugly) { - final String[] nameParts = ugly.split("_"); - if (nameParts.length == 1) { - return firstUppercase(ugly); - } - - final StringBuilder sb = new StringBuilder(); - for (final String part : nameParts) { - sb.append(firstUppercase(part) + " "); - } - - return sb.toString(); - } - public static String serialize(final ItemStack iStack) { final YamlConfiguration cfg = new YamlConfiguration(); cfg.set("item", iStack);