From 512460177d5f8228f7c60cc41f10dca6cf6fa18c Mon Sep 17 00:00:00 2001 From: Sotr Date: Mon, 20 Jan 2020 21:36:23 +0700 Subject: [PATCH] Remove unused codes Former-commit-id: 23cda96128a9918e2182cb8cfaf9df56292c698b --- .../org/maxgamer/quickshop/QuickShop.java | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index ca049b85a..1a84c6f1d 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -822,57 +822,6 @@ public class QuickShop extends JavaPlugin { return true; } - public void configVaildate() { - YamlConfiguration attached = - YamlConfiguration.loadConfiguration( - new InputStreamReader(Objects.requireNonNull(getResource("config.yml")))); - Set keysA = new HashSet<>(attached.getKeys(true)); - Set keysB = new HashSet<>(getConfig().getKeys(true)); - Set ignoreCheckKeys = new HashSet<>(); - ignoreCheckKeys.add("server-uuid"); - final String msgForConfiguration = - "Missing options in config.yml, the key [%key%] not exist in config.yml, it may cause plugin errors, please fix it! There is guide for you to fix: \n" - + ".....\n" - + "%data%\n" - + ".....\n" - + "Tips: Add \"auto-fix-configuration: true\" in config.yml to allow QuickShop automatic fix your configuration!"; - keysA.stream() - .filter((key) -> !keysB.contains(key)) - .filter((key) -> !ignoreCheckKeys.contains(key)) - .collect(Collectors.toList()) - .forEach( - (miss) -> { - if (!getConfig().getBoolean("auto-fix-configuration", false)) { - String theMsg = msgForConfiguration; - theMsg = theMsg.replace("%key%", miss); - List tiers = new ArrayList<>(Arrays.asList(miss.split("\\."))); - StringBuilder miss2Yaml = new StringBuilder(); - int spaces = 2; - Iterator iterator = tiers.iterator(); - while (true) { - String tier = iterator.next(); - miss2Yaml.append(tier); - if (iterator.hasNext()) { - miss2Yaml.append(": "); - miss2Yaml.append("\n"); - for (int i = 0; i < spaces; i++) { - miss2Yaml.append(" "); - } - spaces += 2; - } else { - miss2Yaml.append(": "); - miss2Yaml.append(attached.get(miss)); - break; - } - } - theMsg = theMsg.replace("%data%", miss2Yaml.toString()); - getLogger().warning(theMsg); - } else { - getConfig().set(miss, attached.get(miss)); - } - }); - } - private void submitMeritcs() { if (!getConfig().getBoolean("disabled-metrics")) { String serverVer = Bukkit.getVersion(); @@ -1441,7 +1390,6 @@ public class QuickShop extends JavaPlugin { } catch (IOException ioe) { getLogger().warning("Error on spawning the example config file: " + ioe.getMessage()); } - configVaildate(); } /**