示例#1
0
  /**
   * 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);
    }
  }
示例#2
0
 public static void addRecipes() {
   ModLoader.addRecipe(
       stoneDoor,
       new Object[] {
         "X",
         "Y",
         Character.valueOf('X'),
         Block.dirt // Item.ingotIron, Character.valueOf('Y'), Block.pressurePlatePlanks
       });
   ModLoader.addRecipe(
       goldDoor,
       new Object[] {
         "XX",
         "Y",
         Character.valueOf('X'),
         Block.dirt // Item.ingotGold, Character.valueOf('Y'), Block.pressurePlateStone
       });
   ModLoader.addRecipe(diamondDoor, new Object[] {"XXX", "Y", Character.valueOf('X'), Block.dirt});
   FurnaceRecipes.smelting().addSmelting(mtDoorBlockID, 0, new ItemStack(Item.ingotIron, 1));
   FurnaceRecipes.smelting().addSmelting(mtDoorBlockID, 1, new ItemStack(Item.ingotGold, 1));
   FurnaceRecipes.smelting().addSmelting(mtDoorBlockID, 2, new ItemStack(Item.diamond, 1));
 }
  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);
  }
示例#4
0
 public ItemStack getResultFor(ItemStack itemstack) {
   return FurnaceRecipes.smelting().getSmeltingResult(itemstack);
 }