Package org.bukkit.util.config

Examples of org.bukkit.util.config.Configuration


  public static Configuration getInstalledModsConfig() {
    File installedModsYmlFile = getInstalledModsYmlFile();
    if (installedModsConfig == null || installedModsLocation.compareTo(installedModsYmlFile) != 0) {
      installedModsLocation = installedModsYmlFile;
      installedModsConfig = new Configuration(installedModsLocation);
      installedModsConfig.load();
    }
    return installedModsConfig;
  }
View Full Code Here


    return new File(ModPackListYML.currentModPackDirectory, MODPACK_YML);
  }

  public static Configuration getModPackYML() {
    updateModPackYML();
    Configuration config = new Configuration(getModPackYMLFile());
    config.load();
    return config;
  }
View Full Code Here

      synchronized (key) {
        String selected = getSelectedBuild();

        YmlUtils.downloadYmlFile(ModPackListYML.currentModPack + "/" + MODPACK_YML, FALLBACK_URL, getModPackYMLFile());

        Configuration config = new Configuration(getModPackYMLFile());
        config.load();
        config.setProperty("current", selected);
        config.setProperty("launcher", Main.build);
        config.save();

        updated = true;
      }
    }
  }
View Full Code Here

  private static String getSelectedBuild() {
    String selected = null;
    if (getModPackYMLFile().exists()) {
      try {
        Configuration config = new Configuration(getModPackYMLFile());
        config.load();
        selected = config.getString("current");
        if (selected == null || !isValidBuild(selected)) {
          selected = config.getString("recommended");
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }
View Full Code Here

  public static String getModPackFavIcon() {
    return new File(ModPackListYML.currentModPackDirectory, "resources" + File.separator + "favicon.png").getAbsolutePath();
  }

  public static String[] getModpackBuilds() {
    Configuration config = getModPackYML();
    Map<String, Object> builds = (Map<String, Object>) config.getProperty("builds");
    String latest = config.getString("latest", null);
    String recommended = config.getString("recommended", null);

    if (builds != null) {
      String[] results = new String[builds.size()];
      int index = 0;
      for (String i : builds.keySet()) {
View Full Code Here

    return getMD5(type, MinecraftYML.getLatestMinecraftVersion());
  }

  @SuppressWarnings("unchecked")
  public static String getMD5(FileType type, String version) {
    Configuration config = MinecraftYML.getMinecraftYML();
    Map<String, Map<String, String>> builds = (Map<String, Map<String, String>>) config.getProperty("versions");
    if (builds.containsKey(version)) {
      Map<String, String> files = builds.get(version);
      return files.get(type.name());
    }
    return null;
View Full Code Here

    }
    return null;
  }

  public static String getMinecraftMD5(String md5Hash) {
    Configuration config = MinecraftYML.getMinecraftYML();
    Map<String, Map<String, String>> builds = (Map<String, Map<String, String>>) config.getProperty("versions");
    for (String version : builds.keySet()) {
      String minecraftMD5 = builds.get(version).get("minecraft");
      if (minecraftMD5.equalsIgnoreCase(md5Hash)) { return version; }
    }
    return null;
View Full Code Here

  public void setDownloadListener(DownloadListener listener) {
    this.listener = listener;
  }

  public void install() {
    Configuration config = ModPackYML.getModPackYML();
    config.setProperty("current", getBuild());
    config.save();
  }
View Full Code Here

    config.setProperty("current", getBuild());
    config.save();
  }

  public String getInstalledBuild() {
    Configuration config = ModPackYML.getModPackYML();
    return config.getString("current");
  }
View Full Code Here

    return mods;
  }

  @SuppressWarnings("unchecked")
  public static ModpackBuild getSpoutcraftBuild() {
    Configuration config = ModPackYML.getModPackYML();
    Map<String, Object> builds = (Map<String, Object>) config.getProperty("builds");
    String latest = config.getString("latest", null);
    String recommended = config.getString("recommended", null);
    String selected = SettingsUtil.getSelectedBuild();

    String buildName = selected;
    if (SettingsUtil.isRecommendedBuild()) {
      buildName = recommended;
View Full Code Here

TOP

Related Classes of org.bukkit.util.config.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.