Example #1
0
 public static void registerOresInDictionary() {
   // Ore Dictionary Registeration
   OreDictionary.registerOre(
       "dustCoal",
       new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.POWDER_COAL.ordinal()));
   OreDictionary.registerOre(
       "dustIron",
       new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.POWDER_IRON.ordinal()));
   OreDictionary.registerOre(
       "dustGold",
       new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.POWDER_GOLD.ordinal()));
   OreDictionary.registerOre(
       "dustCopper",
       new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.POWDER_COPPER.ordinal()));
   OreDictionary.registerOre(
       "dustTin",
       new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.POWDER_TIN.ordinal()));
 }
Example #2
0
  public static void addOreDictionaryRecipes() {
    int oreId = OreDictionary.getOreID("ingotCopper");
    ArrayList<ItemStack> ingots = OreDictionary.getOres(oreId);
    if (!ingots.isEmpty()) {
      FurnaceRecipes.smelting()
          .addSmelting(
              ModObject.itemPowderIngot.actualId,
              PowderIngot.POWDER_COPPER.ordinal(),
              ingots.get(0),
              0);
    }
    oreId = OreDictionary.getOreID("ingotTin");
    ingots = OreDictionary.getOres(oreId);
    if (!ingots.isEmpty()) {
      FurnaceRecipes.smelting()
          .addSmelting(
              ModObject.itemPowderIngot.actualId,
              PowderIngot.POWDER_TIN.ordinal(),
              ingots.get(0),
              0);
    }

    ItemStack capacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 0);
    ArrayList<ItemStack> copperIngots = OreDictionary.getOres("ingotCopper");
    Item gold;
    if (Config.useHardRecipes) {
      gold = Item.ingotGold;
    } else {
      gold = Item.goldNugget;
    }
    if (copperIngots != null && !copperIngots.isEmpty()) {
      GameRegistry.addRecipe(
          new ShapedOreRecipe(
              capacitor, " gr", "gcg", "rg ", 'r', Item.redstone, 'g', gold, 'c', "ingotCopper"));
    } else {
      GameRegistry.addShapedRecipe(
          capacitor, " gr", "gig", "rg ", 'r', Item.redstone, 'g', gold, 'i', Item.ingotIron);
    }

    int dustCoal = OreDictionary.getOreID("dustCoal");
    ItemStack activatedCapacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 1);
    ItemStack electricalSteel =
        new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.ELECTRICAL_STEEL.ordinal());
    if (Config.useHardRecipes) {
      GameRegistry.addRecipe(
          new ShapedOreRecipe(
              activatedCapacitor,
              "eee",
              "cCc",
              "eee",
              'e',
              electricalSteel,
              'c',
              capacitor,
              'C',
              "dustCoal"));
    } else {
      GameRegistry.addRecipe(
          new ShapedOreRecipe(
              activatedCapacitor,
              " e ",
              "cCc",
              " e ",
              'e',
              electricalSteel,
              'c',
              capacitor,
              'C',
              "dustCoal"));
    }
  }