コード例 #1
0
  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";
  }
コード例 #2
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";
  }
コード例 #3
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) {

    }
  }
コード例 #4
0
  private static String updateUserSettings_2_3_2_to_2_4_0() {
    GuiLogger.getLogger().info("Update user settings from version 2.3.2 to 2.4.0");

    return "2.4.0";
  }
コード例 #5
0
  private static String updateUserSettings_2_3_0_to_2_3_1() {
    GuiLogger.getLogger().info("Update user settings from version 2.3.0 to 2.3.1");

    return "2.3.1";
  }
コード例 #6
0
  private static String updateUserSettings_2_1_1_to_2_2_0() {
    GuiLogger.getLogger().info("Update user settings from version 2.1.1 to 2.2.0");

    return "2.2.0";
  }