//in Terraria.Recipe rewrite useCraftGroup recipes to check if craft groups contain id internal static void ResetVanillaGroups() { Wood = new CraftGroup("Wood", Lang.misc[37] + " " + Main.itemName[9], 9, 619, 620, 621, 911, 1729, 2503, 2504); IronBar = new CraftGroup("IronBar", Lang.misc[37] + " " + Main.itemName[22], 22, 704); PressurePlate = new CraftGroup("PressurePlate", Lang.misc[37] + " " + Lang.misc[38], 529, 541, 542, 543, 852, 853, 1151); Sand = new CraftGroup("Sand", Lang.misc[37] + " " + Main.itemName[169], 169, 408, 1246, 370, 3272); Fragment = new CraftGroup("Fragment", Lang.misc[37] + " " + Lang.misc[51], 3458, 3456, 3457, 3459); }
public void AddCraftGroup(string name, string displayName, params int[] items) { CraftGroup group = new CraftGroup(name, displayName, items); craftGroups[name] = group; }
public void AddCraftGroup(CraftGroup group, int stack = 1) { this.AddIngredient(group.Items[0], stack); this.craftGroups.Add(group); }
internal static void do_Load(object threadContext) { if (!LoadMods()) { Main.menuMode = Interface.errorMessageID; return; } if (Main.dedServ) { Console.WriteLine("Adding mod content..."); } int num = 0; foreach (Mod mod in mods.Values) { Interface.loadMods.SetProgressInit(mod.Name, num, mods.Count); try { mod.Autoload(); mod.Load(); } catch (Exception e) { DisableMod(mod.file); ErrorLogger.LogLoadingError(mod.file, mod.buildVersion, e); Main.menuMode = Interface.errorMessageID; return; } num++; } Interface.loadMods.SetProgressSetup(0f); ResizeArrays(); num = 0; foreach (Mod mod in mods.Values) { Interface.loadMods.SetProgressLoad(mod.Name, num, mods.Count); try { mod.SetupContent(); mod.PostSetupContent(); } catch (Exception e) { DisableMod(mod.file); ErrorLogger.LogLoadingError(mod.file, mod.buildVersion, e); Main.menuMode = Interface.errorMessageID; return; } num++; } MapLoader.SetupModMap(); Interface.loadMods.SetProgressRecipes(); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; try { CraftGroup.ResetVanillaGroups(); AddCraftGroups(); Recipe.SetupRecipes(); } catch (Exception e) { ErrorLogger.LogLoadingError("recipes", version, e); Main.menuMode = Interface.errorMessageID; return; } Main.menuMode = 0; numLoads++; }
private static void do_Load(object threadContext) { if (!LoadMods()) { Main.menuMode = Interface.errorMessageID; return; } int num = 0; foreach (Mod mod in mods.Values) { Interface.loadMods.SetProgressInit(mod.Name, num, mods.Count); try { mod.Autoload(); mod.Load(); } catch (Exception e) { DisableMod(mod.file); ErrorLogger.LogLoadingError(mod.file, e); Main.menuMode = Interface.errorMessageID; return; } num++; } Interface.loadMods.SetProgressSetup(0f); ResizeArrays(); num = 0; foreach (Mod mod in mods.Values) { Interface.loadMods.SetProgressLoad(mod.Name, num, mods.Count); try { mod.SetupContent(); } catch (Exception e) { DisableMod(mod.file); ErrorLogger.LogLoadingError(mod.file, e); Main.menuMode = Interface.errorMessageID; return; } num++; } Interface.loadMods.SetProgressRecipes(); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; try { CraftGroup.ResetVanillaGroups(); AddCraftGroups(); Recipe.SetupRecipes(); } catch (Exception e) { ErrorLogger.LogLoadingError("recipes", e); Main.menuMode = Interface.errorMessageID; return; } Main.menuMode = 0; }