Example #1
0
        public static void generateRecipes()
        {
            ServerLog.LogAsyncMessage(new LogMessage("Begining " + NAME + " recipe generation", LogType.Log));
            using (StreamWriter outputFile = new StreamWriter(System.IO.Path.Combine(GenerateTypeConfig.MOD_FOLDER, "Log.txt"), true))
            {
                outputFile.WriteLine("Begining " + NAME + " recipe generation");
            }

            if (GenerateTypeConfig.DecorTypes.TryGetValue(LocalGenerateConfig.NAME, out List <DecorType> blockTypes))
            {
                foreach (var currentType in blockTypes)
                {
                    var typeName       = GenerateTypeConfig.TYPEPREFIX + NAME + "." + currentType.type;
                    var typeNameRecipe = GenerateTypeConfig.TYPEPREFIX + NAME + "." + currentType.type + ".Recipe";

                    ServerLog.LogAsyncMessage(new LogMessage("Generating recipe " + typeNameRecipe, LogType.Log));
                    using (StreamWriter outputFile = new StreamWriter(System.IO.Path.Combine(GenerateTypeConfig.MOD_FOLDER, "Log.txt"), true))
                    {
                        outputFile.WriteLine("Generating recipe " + typeNameRecipe);
                    }

                    var recipe = new TypeRecipe();
                    recipe.name = typeNameRecipe;
                    recipe.requires.Add(new RecipeItem(currentType.type));
                    recipe.results.Add(new RecipeItem(typeName));


                    recipe.LoadRecipe();
                }
            }
        }
Example #2
0
        public static void generateRecipes()
        {
            if (GenerateTypeConfig.DecorTypes.TryGetValue(LocalGenerateConfig.NAME, out List <DecorType> blockTypes))
            {
                foreach (var currentType in blockTypes)
                {
                    var typeName       = GenerateTypeConfig.TYPEPREFIX + NAME + "." + currentType.type;
                    var typeNameRecipe = GenerateTypeConfig.TYPEPREFIX + NAME + "." + currentType.type + ".Recipe";

                    ServerLog.LogAsyncMessage(new LogMessage("Generating type " + typeNameRecipe, LogType.Log));

                    var recipe = new TypeRecipe();
                    recipe.name = typeNameRecipe;
                    recipe.requires.Add(new RecipeItem(currentType.type));
                    recipe.results.Add(new RecipeItem(typeName));


                    recipe.LoadRecipe();
                }
            }
        }