private static String updateUserSettings_1_8_7_to_2_0_0() { GuiLogger.getLogger().info("Update user settings from version 1.8.7 to 2.0.0"); Main.getUserSettings().setStringProperty("general.user.name", "Default"); return "2.0.0"; }
private static String updateUserSettings_2_0_1_to_2_1_0() { GuiLogger.getLogger().info("Update user settings from version 2.0.1 to 2.1.0"); Main.getUserSettings().replaceKey("api.id", "plugin.synchronizer.id"); return "2.1.0"; }
private static void cleanSettings() { try { Properties defaultProperties = new Properties(); defaultProperties.load( Resources.class.getResourceAsStream("default_user_settings.properties")); for (String key : defaultProperties.stringPropertyNames()) { String value = defaultProperties.getProperty(key); if (value == null || value.length() == 0) continue; if (Main.getUserSettings().getStringProperty(key) == null) { GuiLogger.getLogger().warning("Clean user settings: " + key); Main.getUserSettings().remove(key); } } } catch (Throwable t) { } }