示例#1
0
public enum Alloy {
  ELECTRICAL_STEEL(
      "Silicon Steel",
      "electricalSteel",
      new ItemStack(Item.ingotIron),
      new ItemStack(Item.coal, 2, 1),
      new ItemStack(ModObject.itemMaterial.actualId, 1, Material.SILICON.ordinal())),
  ENERGETIC_ALLOY(
      "Energetic Alloy",
      "energeticAlloy",
      new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.ELECTRICAL_STEEL.ordinal()),
      new ItemStack(Item.redstone),
      new ItemStack(Item.glowstone)),
  PHASED_IRON(
      "Phased Iron",
      "phasedIron",
      new ItemStack(Item.ingotIron),
      new ItemStack(Item.glowstone),
      new ItemStack(Item.enderPearl)),
  PHASED_GOLD(
      "Phased Gold",
      "phasedGold",
      new ItemStack(Item.ingotGold),
      new ItemStack(Item.glowstone),
      new ItemStack(Item.enderPearl)),
  REDSTONE_ALLOY(
      "Redstone Alloy",
      "redstoneAlloy",
      new ItemStack(Item.ingotIron),
      new ItemStack(Item.redstone, 4, 0));

  public final String unlocalisedName;
  public final String uiName;
  public final String iconKey;
  public final ItemStack[] ingrediants;

  private Alloy(String uiName, String iconKey, ItemStack... ingrediants) {
    this.unlocalisedName = name();
    this.uiName = uiName;
    this.iconKey = "enderio:" + iconKey;
    this.ingrediants = ingrediants;
  }
}
示例#2
0
  public static void addRecipes() {

    // Common Ingredients
    ItemStack conduitBinder =
        new ItemStack(ModObject.itemMaterial.actualId, 4, Material.CONDUIT_BINDER.ordinal());
    ItemStack basicGear =
        new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.BASIC_GEAR.ordinal());
    ItemStack binderComposite =
        new ItemStack(ModObject.itemMaterial.actualId, 1, Material.BINDER_COMPOSITE.ordinal());
    ItemStack industrialBinder =
        new ItemStack(ModObject.itemMaterial.actualId, 1, Material.CONDUIT_BINDER.ordinal());
    ItemStack wrench = new ItemStack(ModObject.itemYetaWrench.actualId, 1, 0);
    ItemStack enderCapacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 2);
    ItemStack fusedQuartzFrame = new ItemStack(ModObject.itemFusedQuartzFrame.actualId, 1, 0);
    ItemStack machineChassi =
        new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.MACHINE_CHASSI.ordinal());
    ItemStack activatedCapacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 1);
    ItemStack endergold =
        new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.PHASED_GOLD.ordinal());
    ItemStack electricalSteel =
        new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.ELECTRICAL_STEEL.ordinal());

    // Conduit Binder
    ItemStack cbc = binderComposite.copy();
    cbc.stackSize = 8;
    if (Config.useAlternateBinderRecipe) {
      GameRegistry.addShapedRecipe(
          cbc, "gcg", "sgs", "gcg", 'g', Block.gravel, 's', Block.sand, 'c', Item.clay);
    } else {
      GameRegistry.addShapedRecipe(
          cbc, "ggg", "scs", "ggg", 'g', Block.gravel, 's', Block.sand, 'c', Item.clay);
    }
    FurnaceRecipes.smelting()
        .addSmelting(binderComposite.itemID, binderComposite.getItemDamage(), conduitBinder, 0);

    // Aloys
    int meta = 0;
    for (Alloy alloy : Alloy.values()) {
      ItemStack ingot = new ItemStack(ModObject.itemAlloy.actualId, 1, meta);
      IMachineRecipe recipe = new BasicAlloyRecipe(ingot, alloy.unlocalisedName, alloy.ingrediants);
      if (ItemAlloy.useNuggets) {
        ItemStack nugget =
            new ItemStack(ModObject.itemAlloy.actualId, 9, meta + Alloy.values().length);
        GameRegistry.addShapelessRecipe(nugget, ingot);
        nugget = nugget.copy();
        nugget.stackSize = 1;
        GameRegistry.addShapedRecipe(ingot, "nnn", "nnn", "nnn", 'n', nugget);
      }
      MachineRecipeRegistry.instance.registerRecipe(
          ModObject.blockAlloySmelter.unlocalisedName, recipe);
      meta++;
    }

    MachineRecipeRegistry.instance.registerRecipe(
        ModObject.blockAlloySmelter.unlocalisedName, new FusedQuartzRecipe());
    MachineRecipeRegistry.instance.registerRecipe(
        ModObject.blockAlloySmelter.unlocalisedName, new VanillaSmeltingRecipe());

    FurnaceRecipes.smelting()
        .addSmelting(
            ModObject.itemPowderIngot.actualId,
            PowderIngot.POWDER_IRON.ordinal(),
            new ItemStack(Item.ingotIron),
            0);
    FurnaceRecipes.smelting()
        .addSmelting(
            ModObject.itemPowderIngot.actualId,
            PowderIngot.POWDER_GOLD.ordinal(),
            new ItemStack(Item.ingotGold),
            0);

    // Fused Quartz Frame
    GameRegistry.addRecipe(
        new ShapedOreRecipe(
            fusedQuartzFrame, "bsb", "s s", "bsb", 'b', conduitBinder, 's', "stickWood"));
    GameRegistry.addRecipe(
        new ShapedOreRecipe(
            fusedQuartzFrame, "bsb", "s s", "bsb", 'b', conduitBinder, 's', "woodStick"));

    // Wrench
    GameRegistry.addShapedRecipe(wrench, "s s", " b ", " s ", 's', electricalSteel, 'b', basicGear);

    // Machine Chassi
    GameRegistry.addShapedRecipe(
        machineChassi, "fif", "i i", "fif", 'f', Block.fenceIron, 'i', Item.ingotIron);

    // Basic Gear
    GameRegistry.addRecipe(
        new ShapedOreRecipe(
            basicGear, "scs", "c c", "scs", 's', "stickWood", 'c', Block.cobblestone));
    GameRegistry.addRecipe(
        new ShapedOreRecipe(
            basicGear, "scs", "c c", "scs", 's', "woodStick", 'c', Block.cobblestone));

    // Ender Capacitor
    if (Config.useHardRecipes) {
      GameRegistry.addShapedRecipe(
          enderCapacitor,
          "eee",
          "cgc",
          "eee",
          'e',
          endergold,
          'c',
          activatedCapacitor,
          'g',
          Block.glowStone);
    } else {
      GameRegistry.addShapedRecipe(
          enderCapacitor,
          " e ",
          "cgc",
          " e ",
          'e',
          endergold,
          'c',
          activatedCapacitor,
          'g',
          Block.glowStone);
    }
  }
示例#3
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"));
    }
  }