/// <summary> /// Will decompile all mods in a folder and in the sub folders and put them into their respective folders /// </summary> /// <param name="path">The path of the folder</param> public static void DeCompile(string path) { //compile the biomes Compiled.Biome[] compiled = BiomeCompiler.CompiledFromString(LoadAllMods(path)); Decompiled.Biome[] decompiled = BiomeCompiler.Decompile(compiled); File.WriteAllText(Path.Combine(path, "biomes.json"), BiomeCompiler.DecompiledToString(decompiled)); }
/// <summary> /// Will compile all files in a folder and in the sub folders into a single mod /// </summary> /// <param name="path">The path of the folder</param> public static void Compile(string path) { //The string that will be filled with the entire mod to be written at last string mod = ""; //compile the biomes Decompiled.Biome[] decompiled = BiomeCompiler.DecompiledFromString(File.ReadAllText(Path.Combine(path, "biomes.json"))); Compiled.Biome[] compiled = BiomeCompiler.Compile(decompiled); mod += BiomeCompiler.CompiledToString(compiled); //Write the new mod File.WriteAllText(Path.Combine(path, "unnamed.woc"), mod); }
/// <summary> /// Loads all mods and puts them into memory /// </summary> public static void Init() { biomes = BiomeCompiler.CompiledFromString(File.ReadAllText("mods/vanilla.woc")); }