Package org.spoutcraft.launcher.modpacks

Source Code of org.spoutcraft.launcher.modpacks.ModLibraryYML

package org.spoutcraft.launcher.modpacks;

import java.io.File;

import org.bukkit.util.config.Configuration;
import org.spoutcraft.launcher.GameUpdater;
import org.spoutcraft.launcher.YmlUtils;

public class ModLibraryYML {

  public static final String      MODLIBRARY_YML  = "modlibrary.yml";
  public static final File        modLibraryYML    = new File(GameUpdater.workDir, MODLIBRARY_YML);

  private static volatile boolean  updated          = false;
  private static final Object      key              = new Object();

  public static void updateModLibraryYML() {
    if (updated) { return; }
    synchronized (key) {
      YmlUtils.downloadRelativeYmlFile(ModLibraryYML.MODLIBRARY_YML);
      updated = true;
    }
  }

  public static Configuration getModLibraryYML() {
    updateModLibraryYML();
    Configuration config = new Configuration(modLibraryYML);
    config.load();
    return config;
  }
}
TOP

Related Classes of org.spoutcraft.launcher.modpacks.ModLibraryYML

TOP
Copyright © 2018 www.massapi.com. 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.