public static void setDisabledWorlds(String name, boolean data) {
   if (!data) {
     DisabledWorlds.remove(name);
   } else {
     DisabledWorlds.add(name);
   }
   setData("Lists.DisabledWorlds", DisabledWorlds);
 }
 public static void setNoObfuscationForPermission(boolean data) {
   setData("Booleans.NoObfuscationForPermission", data);
   NoObfuscationForPermission = data;
 }
 public static void setUpdateRadius(int data) {
   setData("Integers.UpdateRadius", data);
   UpdateRadius = data;
 }
 private static List<String> getStringList(String path, List<String> defaultData) {
   if (Orebfuscator.instance.getConfig().get(path) == null) setData(path, defaultData);
   return Orebfuscator.instance.getConfig().getStringList(path);
 }
 private static int getInt(String path, int defaultData) {
   if (Orebfuscator.instance.getConfig().get(path) == null) setData(path, defaultData);
   return Orebfuscator.instance.getConfig().getInt(path, defaultData);
 }
 private static boolean getBoolean(String path, boolean defaultData) {
   if (Orebfuscator.instance.getConfig().get(path) == null) setData(path, defaultData);
   return Orebfuscator.instance.getConfig().getBoolean(path, defaultData);
 }
 public static void setCacheLocation(String data) {
   setData("Strings.CacheLocation", data);
   CacheFolder = new File(data);
   CacheLocation = data;
 }
 public static void setUseCache(boolean data) {
   setData("Booleans.UseCache", data);
   UseCache = data;
 }
 public static void setAirGeneratorMaxChance(int data) {
   setData("Integers.AirGeneratorMaxChance", data);
   AirGeneratorMaxChance = data;
 }
 public static void setProximityHiderEnd(int data) {
   setData("Integers.ProximityHiderEnd", data);
   ProximityHiderEnd = data;
 }
 public static void setProximityHiderID(int data) {
   setData("Integers.ProximityHiderID", data);
   ProximityHiderID = data;
 }
 public static void setProximityHiderDistance(int data) {
   setData("Integers.ProximityHiderDistance", data);
   ProximityHiderDistance = data;
 }
 public static void setMaxLoadedCacheFiles(int data) {
   setData("Integers.MaxLoadedCacheFiles", data);
   MaxLoadedCacheFiles = data;
 }
 public static void setProcessingThreads(int data) {
   setData("Integers.ProcessingThreads", data);
   ProcessingThreads = data;
 }
 public static void setInitialRadius(int data) {
   setData("Integers.InitialRadius", data);
   InitialRadius = data;
 }
 public static void setLoginNotification(boolean data) {
   setData("Booleans.LoginNotification", data);
   LoginNotification = data;
 }
 public static void setAntiTexturePackAndFreecam(boolean data) {
   setData("Booleans.AntiTexturePackAndFreecam", data);
   AntiTexturePackAndFreecam = data;
 }
 public static void setOrebfuscatorPriority(int data) {
   setData("Integers.OrebfuscatorPriority", data);
   OrebfuscatorPriority = data;
 }
 public static void setEnabled(boolean data) {
   setData("Booleans.Enabled", data);
   Enabled = data;
 }
 public static void setUseProximityHider(boolean data) {
   setData("Booleans.UseProximityHider", data);
   UseProximityHider = data;
 }
 public static void setUseSpecialBlockForProximityHider(boolean data) {
   setData("Booleans.UseSpecialBlockForProximityHider", data);
   UseSpecialBlockForProximityHider = data;
 }
 public static void setUpdateOnDamage(boolean data) {
   setData("Booleans.UpdateOnDamage", data);
   UpdateOnDamage = data;
 }
 private static String getString(String path, String defaultData) {
   if (Orebfuscator.instance.getConfig().get(path) == null) setData(path, defaultData);
   return Orebfuscator.instance.getConfig().getString(path, defaultData);
 }
 public static void setDarknessHideBlocks(boolean data) {
   setData("Booleans.DarknessHideBlocks", data);
   DarknessHideBlocks = data;
 }
 private static Integer[] getIntList2(String path, List<Integer> defaultData) {
   if (Orebfuscator.instance.getConfig().get(path) == null) setData(path, defaultData);
   return Orebfuscator.instance.getConfig().getIntegerList(path).toArray(new Integer[1]);
 }
 public static void setNoObfuscationForOps(boolean data) {
   setData("Booleans.NoObfuscationForOps", data);
   NoObfuscationForOps = data;
 }
  public static void load() {
    // Version check
    int version = getInt("ConfigVersion", CONFIG_VERSION);
    if (version < CONFIG_VERSION) {
      /*
      Orebfuscator.log("Configuration out of date. Recreating new configuration file.");
      File configFile = new File(Orebfuscator.instance.getDataFolder(), "config.yml");
      File destination = new File(Orebfuscator.instance.getDataFolder(), "config_old.yml");
      if (destination.exists())
      {
          try
          {
              destination.delete();
          }
          catch (Exception e)
          {
              Orebfuscator.log(e);
          }
      }
      configFile.renameTo(destination);
      reload();
      */
      ObfuscatedDataCache.ClearCache();
      setData("ConfigVersion", CONFIG_VERSION);
    }

    EngineMode = getInt("Integers.EngineMode", EngineMode);
    if (EngineMode != 1 && EngineMode != 2) {
      EngineMode = 2;
      System.out.println("[Orebfuscator] EngineMode must be 1 or 2.");
    }
    UpdateRadius = getInt("Integers.UpdateRadius", UpdateRadius);
    InitialRadius = getInt("Integers.InitialRadius", InitialRadius);
    if (InitialRadius > 5) {
      InitialRadius = 5;
      System.out.println("[Orebfuscator] InitialRadius must be less than 6.");
    }
    if (InitialRadius == 0) {
      System.out.println(
          "[Orebfuscator] Warning, InitialRadius is 0. This will cause all exposed blocks to be obfuscated.");
    }
    ProcessingThreads = getInt("Integers.ProcessingThreads", ProcessingThreads);
    MaxLoadedCacheFiles = getInt("Integers.MaxLoadedCacheFiles", MaxLoadedCacheFiles);
    ProximityHiderDistance = getInt("Integers.ProximityHiderDistance", ProximityHiderDistance);
    ProximityHiderID = getInt("Integers.ProximityHiderID", ProximityHiderID);
    ProximityHiderEnd = getInt("Integers.ProximityHiderEnd", ProximityHiderEnd);
    AirGeneratorMaxChance = getInt("Integers.AirGeneratorMaxChance", AirGeneratorMaxChance);
    OrebfuscatorPriority = getInt("Integers.OrebfuscatorPriority", OrebfuscatorPriority);
    UseProximityHider = getBoolean("Booleans.UseProximityHider", UseProximityHider);
    UseSpecialBlockForProximityHider =
        getBoolean("Booleans.UseSpecialBlockForProximityHider", UseSpecialBlockForProximityHider);
    UpdateOnDamage = getBoolean("Booleans.UpdateOnDamage", UpdateOnDamage);
    DarknessHideBlocks = getBoolean("Booleans.DarknessHideBlocks", DarknessHideBlocks);
    NoObfuscationForOps = getBoolean("Booleans.NoObfuscationForOps", NoObfuscationForOps);
    NoObfuscationForPermission =
        getBoolean("Booleans.NoObfuscationForPermission", NoObfuscationForPermission);
    UseCache = getBoolean("Booleans.UseCache", UseCache);
    LoginNotification = getBoolean("Booleans.LoginNotification", LoginNotification);
    AntiTexturePackAndFreecam =
        getBoolean("Booleans.AntiTexturePackAndFreecam", AntiTexturePackAndFreecam);
    Enabled = getBoolean("Booleans.Enabled", Enabled);
    setBlockValues(
        ObfuscateBlocks,
        getIntList(
            "Lists.ObfuscateBlocks",
            Arrays.asList(new Integer[] {14, 15, 16, 21, 54, 56, 73, 74, 129})));
    setBlockValues(
        ProximityHiderBlocks,
        getIntList(
            "Lists.ProximityHiderBlocks",
            Arrays.asList(new Integer[] {23, 54, 56, 58, 61, 62, 116, 129})));
    DisabledWorlds = getStringList("Lists.DisabledWorlds", DisabledWorlds);
    CacheLocation = getString("Strings.CacheLocation", CacheLocation);
    CacheFolder = new File(CacheLocation);

    RandomBlocks = getIntList2("Lists.RandomBlocks", Arrays.asList(RandomBlocks));

    // Validate RandomBlocks
    for (int i = 0; i < RandomBlocks.length; i++) {
      // Don't want people to put chests and other stuff that lags the hell out of players.
      if (OrebfuscatorConfig.isBlockTransparent((short) (int) RandomBlocks[i])) {
        RandomBlocks[i] = 0;
      }
    }
    RandomBlocks2 = RandomBlocks;

    save();
  }
 public static void setEngineMode(int data) {
   setData("Integers.EngineMode", data);
   EngineMode = data;
 }