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);