Package org.bukkit.util.config

Examples of org.bukkit.util.config.Configuration


  public static Configuration getConfig() {
    File currentConfigFile = getConfigFile();
    if (config == null || configFile.compareTo(currentConfigFile) != 0) {
      configFile = currentConfigFile;
      config = new Configuration(configFile);
      config.load();
    }
    return config;
  }
View Full Code Here


    updateMinecraftYMLCache();
    return recommended;
  }

  public static void setInstalledVersion(String version) {
    Configuration config = getMinecraftYML();
    config.setProperty("current", version);
    config.save();
  }
View Full Code Here

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

  public static String getInstalledVersion() {
    Configuration config = getMinecraftYML();
    return config.getString("current");
  }
View Full Code Here

        }

        if (YmlUtils.downloadYmlFile(MINECRAFT_YML, "http://technic.freeworldsgaming.com/minecraft.yml", getConfigFile())) {
          // GameUpdater.copy(getConfigFile(), output)
          config = null;
          Configuration config = getConfig();
          latest = config.getString("latest");
          recommended = config.getString("recommended");
          if (current != null) {
            config.setProperty("current", current);
            config.save();
          }
        }
        updated = true;
      }
    }
View Full Code Here

  private static File              librariesYMLFile  = new File(GameUpdater.workDir, LIBRARIES_YML);
  private static final Object      key                = new Object();

  public static Configuration getLibrariesYML() {
    updateLibrariesYMLCache();
    Configuration config = new Configuration(librariesYMLFile);
    config.load();
    return config;
  }
View Full Code Here

    }
  }

  @SuppressWarnings("unchecked")
  public static String getMD5(String library, String version) {
    Configuration config = getLibrariesYML();
    Map<String, Object> libraries = (Map<String, Object>) config.getProperty(library);
    Map<String, String> versions = (Map<String, String>) libraries.get("versions");
    String result = versions.get(version);
    if (result == null) {
      try {
        result = versions.get(Double.parseDouble(version));
View Full Code Here

    }
  }

  public static Configuration getModLibraryYML() {
    updateModLibraryYML();
    Configuration config = new Configuration(modLibraryYML);
    config.load();
    return config;
  }
View Full Code Here

  }

  public static Configuration getConfig() {
    if (config == null) {
      updateModPacksYMLCache();
      config = new Configuration(MODPACKS_YML_FILE);
      config.load();
    }
    return config;
  }
View Full Code Here

    return getMirrorUrl(mirrorURI, fallbackUrl, null);
  }

  @SuppressWarnings("unchecked")
  public static Map<String, Integer> getMirrors() {
    Configuration config = getMirrorsYML();
    return (Map<String, Integer>) config.getProperty("mirrors");
  }
View Full Code Here

    return false;
  }

  public static Configuration getMirrorsYML() {
    updateMirrorsYMLCache();
    Configuration config = new Configuration(mirrorsYML);
    config.load();
    return config;
  }
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.