/// <summary> /// Initializes statistics related to craftable items. Is only called after both block and item stats have been /// initialized. /// </summary> public static void InitCraftableStats() { if (!BlockStatsInitialized || !ItemStatsInitialized) { return; } List <int> hashset = new List <int>(); IRecipe irecipe; for (IEnumerator <IRecipe> iterator = CraftingManager.GetInstance().GetRecipeList().GetEnumerator(); iterator.MoveNext(); hashset.Add(irecipe.GetRecipeOutput().ItemID)) { irecipe = iterator.Current; } ItemStack itemstack; for (IEnumerator <ItemStack> iterator1 = FurnaceRecipes.Smelting().GetSmeltingList().Values.GetEnumerator(); iterator1.MoveNext(); hashset.Add(itemstack.ItemID)) { itemstack = iterator1.Current; } ObjectCraftStats = new StatBase[32000]; IEnumerator <int> iterator2 = hashset.GetEnumerator(); do { if (!iterator2.MoveNext()) { break; } int integer = iterator2.Current; if (Item.ItemsList[(int)integer] != null) { string s = StatCollector.TranslateToLocalFormatted("stat.craftItem", new object[] { Item.ItemsList[integer].GetStatName() }); ObjectCraftStats[integer] = new StatCrafting(0x1010000 + integer, s, integer).RegisterStat(); } }while (true); ReplaceAllSimilarBlocks(ObjectCraftStats); }
public RecipeSorter(CraftingManager par1CraftingManager) { CraftingManager = par1CraftingManager; }