/** * Initializes statistics related to craftable items. Is only called after both block and item * stats have been initialized. */ public static void initCraftableStats() { if (blockStatsInitialized && itemStatsInitialized) { HashSet var0 = new HashSet(); Iterator var1 = CraftingManager.getInstance().getRecipeList().iterator(); while (var1.hasNext()) { IRecipe var2 = (IRecipe) var1.next(); var0.add(Integer.valueOf(var2.getRecipeOutput().itemID)); } var1 = FurnaceRecipes.smelting().getSmeltingList().values().iterator(); while (var1.hasNext()) { ItemStack var4 = (ItemStack) var1.next(); var0.add(Integer.valueOf(var4.itemID)); } objectCraftStats = new StatBase[32000]; var1 = var0.iterator(); while (var1.hasNext()) { Integer var5 = (Integer) var1.next(); if (Item.itemsList[var5.intValue()] != null) { String var3 = StatCollector.translateToLocalFormatted( "stat.craftItem", new Object[] {Item.itemsList[var5.intValue()].getStatName()}); objectCraftStats[var5.intValue()] = (new StatCrafting(16842752 + var5.intValue(), var3, var5.intValue())).registerStat(); } } replaceAllSimilarBlocks(objectCraftStats); } }
private static StatBase[] func_25089_a(String s, int i) { StatBase astatbase[] = new StatBase[256]; for (int j = 0; j < 256; j++) { if (Block.blocksList[j] != null && Block.blocksList[j].getEnableStats()) { String s1 = StatCollector.translateToLocalFormatted( s, new Object[] {Block.blocksList[j].getNameLocalizedForStats()}); astatbase[j] = (new StatCrafting(i + j, s1, j)).func_27053_d(); field_25120_d.add((StatCrafting) astatbase[j]); } } replaceAllSimilarBlocks(astatbase); return astatbase; }
private static StatBase[] func_25087_b(StatBase astatbase[], String s, int i, int j, int k) { if (astatbase == null) { astatbase = new StatBase[32000]; } for (int l = j; l < k; l++) { if (Item.itemsList[l] != null && Item.itemsList[l].func_25005_e()) { String s1 = StatCollector.translateToLocalFormatted( s, new Object[] {Item.itemsList[l].func_25006_i()}); astatbase[l] = (new StatCrafting(i + l, s1, l)).func_27053_d(); } } replaceAllSimilarBlocks(astatbase); return astatbase; }
/** Initializes statistic fields related to minable items and blocks. */ private static StatBase[] initMinableStats(String par0Str, int par1) { StatBase[] var2 = new StatBase[256]; for (int var3 = 0; var3 < 256; ++var3) { if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) { String var4 = StatCollector.translateToLocalFormatted( par0Str, new Object[] {Block.blocksList[var3].translateBlockName()}); var2[var3] = (new StatCrafting(par1 + var3, var4, var3)).registerStat(); objectMineStats.add((StatCrafting) var2[var3]); } } replaceAllSimilarBlocks(var2); return var2; }
private static StatBase[] initBreakStats( StatBase[] par0ArrayOfStatBase, String par1Str, int par2, int par3, int par4) { if (par0ArrayOfStatBase == null) { par0ArrayOfStatBase = new StatBase[32000]; } for (int var5 = par3; var5 < par4; ++var5) { if (Item.itemsList[var5] != null && Item.itemsList[var5].isDamageable()) { String var6 = StatCollector.translateToLocalFormatted( par1Str, new Object[] {Item.itemsList[var5].getStatName()}); par0ArrayOfStatBase[var5] = (new StatCrafting(par2 + var5, var6, var5)).registerStat(); } } replaceAllSimilarBlocks(par0ArrayOfStatBase); return par0ArrayOfStatBase; }
private static StatBase[] func_25090_a(StatBase astatbase[], String s, int i, int j, int k) { if (astatbase == null) { astatbase = new StatBase[32000]; } for (int l = j; l < k; l++) { if (Item.itemsList[l] == null) { continue; } String s1 = StatCollector.translateToLocalFormatted( s, new Object[] {Item.itemsList[l].func_25006_i()}); astatbase[l] = (new StatCrafting(i + l, s1, l)).func_27053_d(); if (l >= Block.blocksList.length) { field_25121_c.add((StatCrafting) astatbase[l]); } } replaceAllSimilarBlocks(astatbase); return astatbase; }
public static void func_25091_c() { if (!field_25101_D || !field_25099_E) { return; } HashSet hashset = new HashSet(); IRecipe irecipe; for (Iterator iterator = CraftingManager.getInstance().getRecipeList().iterator(); iterator.hasNext(); hashset.add(Integer.valueOf(irecipe.func_25077_b().itemID))) { irecipe = (IRecipe) iterator.next(); } ItemStack itemstack; for (Iterator iterator1 = FurnaceRecipes.smelting().getSmeltingList().values().iterator(); iterator1.hasNext(); hashset.add(Integer.valueOf(itemstack.itemID))) { itemstack = (ItemStack) iterator1.next(); } field_25093_z = new StatBase[32000]; Iterator iterator2 = hashset.iterator(); do { if (!iterator2.hasNext()) { break; } Integer integer = (Integer) iterator2.next(); if (Item.itemsList[integer.intValue()] != null) { String s = StatCollector.translateToLocalFormatted( "stat.craftItem", new Object[] {Item.itemsList[integer.intValue()].func_25006_i()}); field_25093_z[integer.intValue()] = (new StatCrafting(0x1010000 + integer.intValue(), s, integer.intValue())) .func_27053_d(); } } while (true); replaceAllSimilarBlocks(field_25093_z); }