Пример #1
0
  public static void registerRecipes() {
    // Uncooked walrus meat
    GameRegistry.addShapedRecipe(
        new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 0),
        "mmm",
        "mmm",
        "mmm",
        'm',
        new ItemStack(ModMahMeat.meat, 1, 0));
    GameRegistry.addShapelessRecipe(
        new ItemStack(ModMahMeat.meat, 9, 0),
        new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 0));
    // Cooked walrus meat
    GameRegistry.addShapedRecipe(
        new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 1),
        "mmm",
        "mmm",
        "mmm",
        'm',
        new ItemStack(ModMahMeat.meat, 1, 1));
    GameRegistry.addShapelessRecipe(
        new ItemStack(ModMahMeat.meat, 9, 1),
        new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 1));

    Item walrus = Item.getByNameOrId("extracells:walrus");
    if (walrus != null) {
      // Allow for equal conversion rates between walri and walrus meat
      GameRegistry.addShapedRecipe(
          new ItemStack(walrus),
          " m ",
          "MMm",
          " m ",
          'm',
          new ItemStack(ModMahMeat.meat, 1, 0),
          'M',
          (new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 0)));
      GameRegistry.addShapelessRecipe(new ItemStack(ModMahMeat.meat, 21, 0), new ItemStack(walrus));
    } else {
      // Add a different recipe for raw walrus
      GameRegistry.addShapedRecipe(
          new ItemStack(Item.getItemFromBlock(ModMahMeat.walrusMeat), 1, 0),
          "fff",
          "fbf",
          "fff",
          'f',
          Items.fish,
          'b',
          Items.bone);
    }

    // Furnace recipes
    FurnaceRecipes.instance()
        .addSmeltingRecipe(
            new ItemStack(ModMahMeat.meat, 1, 0), new ItemStack(ModMahMeat.meat, 1, 1), 0.35F);
  }
Пример #2
0
  public static void oreCompressedCraft(Item item, Block block, Block ore, float exp) {

    if (ore != null) GameRegistry.addSmelting(ore, new ItemStack(item), exp);

    GameRegistry.addRecipe(new ItemStack(block), new Object[] {"###", "###", "###", '#', item});
    GameRegistry.addShapelessRecipe(new ItemStack(item, 9), new Object[] {block});
  }
Пример #3
0
 @Override
 public void fire(FMLInitializationEvent e) {
   if (e.getSide() == Side.CLIENT) this.registerRender();
   if (this.recipe != null) {
     if (this.isShapeless) GameRegistry.addShapelessRecipe(new ItemStack(this), this.recipe);
     else GameRegistry.addRecipe(new ItemStack(this), this.recipe);
   }
 }
  @Override
  public void registerRecipes() {

    // todo: make it work with knifes
    GameRegistry.addShapelessRecipe(
        new ItemStack(this),
        new ItemStack(ReforgedRegistry.MUSKET),
        materialDefinition.getRepairMaterial());
  }
 public static void addRecipe(
     ItemFoodAppleMagic apple, ItemStack ingredient, boolean isExpensive) {
   int refund = 8;
   if (isExpensive) {
     GameRegistry.addRecipe(
         new ItemStack(apple), "lll", "lal", "lll", 'l', ingredient, 'a', Items.APPLE);
   } else {
     GameRegistry.addShapelessRecipe(new ItemStack(apple), ingredient, Items.APPLE);
     refund = 1;
   }
   GameRegistry.addSmelting(
       apple, new ItemStack(ingredient.getItem(), refund, ingredient.getMetadata()), smeltexp);
 }
Пример #6
0
  public static void makeRecipes() {

    // 2 items shapeless is 1 block

    GameRegistry.addShapelessRecipe(
        new ItemStack(MyBlocks.block_light), MyItems.item_ring, MyItems.item_ring);

    // 4 items in pattern results in 3 blocks
    GameRegistry.addRecipe(
        new ItemStack(MyBlocks.block_light, 3), "## ", " ##", '#', MyItems.item_ring);

    // Lapiz in furnace = item_ring
    // last argument is XP, iron (0.7), gold/diamond/em ore (1) beef/meat (0.35)
    GameRegistry.addSmelting(
        new ItemStack(Items.dye, 1, 4), new ItemStack(MyItems.item_ring), 0.5f);
  }
Пример #7
0
  private static void addShapelessRecipe(ItemStack itemStack, ItemStack... w) {
    GameRegistry.addShapelessRecipe(itemStack, (Object[]) w);
    ItemStack is2 = new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage());

    ItemStack[][] ls = new ItemStack[w.length][1];

    int index = 0;
    for (ItemStack is : w) {

      ls[index][0] = is;
      index++;
    }

    shapeless.put(is2.getUnlocalizedName(), ls);

    // System.out.println(ls);

  }
  /**
   * Registers a valid dust into the RunesOfWizardry system. MUST EXTEND IDUST!! <br>
   * Note: also registers it as an Item in the GameRegistry, sets up its unlocalized name and
   * creative tab.
   */
  public static void registerDust(final IDust dustclass) {
    // add it to our list of dusts
    dusts.add(dustclass);

    dustclass.setUnlocalizedName(dustclass.getmodid() + "_" + dustclass.getName());
    dustclass.setCreativeTab(dustclass.creativeTab());

    GameRegistry.registerItem(dustclass, dustclass.getName());

    // list of subItems
    List<ItemStack> subDusts = new ArrayList<ItemStack>(15);
    // get the subDusts. hopefully, tabAllSearch is the right one
    dustclass.getSubItems(dustclass, CreativeTabs.tabAllSearch, subDusts);

    // create the block form of the dust
    if (!dustclass.hasCustomBlock()) {
      Block dustBlock =
          new IDustStorageBlock(Material.sand) {

            @Override
            public IDust getIDust() {
              return dustclass;
            }
          };

      // Crafting
      // hopefully this is enough for metadata
      for (ItemStack i : subDusts) {
        GameRegistry.addShapedRecipe(
            new ItemStack(dustBlock, 1, i.getItemDamage()),
            new Object[] {"XXX", "XXX", "XXX", 'X', i});
        GameRegistry.addShapelessRecipe(i, new ItemStack(dustBlock, 1, i.getItemDamage()));
      }
    }

    // register the recipes for this dust
    // TODO use a custom RecipeHandler
    for (ItemStack i : subDusts) {
      ItemStack[] items = dustclass.getInfusionItems(i);
      if (items != null) {
        recipes.put(items, i);
      }
    }
  }
Пример #9
0
  {
    // Blocks
    // oreRuby = new OreRuby();
    // oreTitanium = new OreTitanium();
    // GameRegistry.registerBlock(oreRuby, "oreRuby");
    // GameRegistry.registerBlock(oreTitanium, "oreTitanium");

    // Items
    ingotRubium = new IngotRubium();
    gemRuby = new GemRuby();
    ingotTitanium = new IngotTitanium();
    GameRegistry.registerItem(gemRuby, "gemRuby");
    GameRegistry.registerItem(ingotTitanium, "ingotTitanium");
    GameRegistry.registerItem(ingotRubium, "ingotRubium");
    LanguageRegistry.addName(ingotRubium, "Rubium Ingot");
    LanguageRegistry.addName(gemRuby, "Ruby Gem");
    LanguageRegistry.addName(ingotTitanium, "Titanium Ingot");

    // Crafting
    GameRegistry.addShapelessRecipe(
        new ItemStack(ingotRubium), new Object[] {new ItemStack(gemRuby), ingotTitanium});
  }
Пример #10
0
  public static void registerVanillaCraftingRecipes() {
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.chitinHelm), "AAA", "A A", 'A', GlobalAdditions.chitin);
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.chitinChest),
        "A A",
        "AAA",
        "AAA",
        'A',
        GlobalAdditions.chitin);
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.chitinLegs),
        "AAA",
        "A A",
        "A A",
        'A',
        GlobalAdditions.chitin);
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.chitinBoots),
        "   ",
        "A A",
        "A A",
        'A',
        GlobalAdditions.chitin);
    // Iron Pike
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.ironPike),
        "  A",
        " B ",
        "B  ",
        'A',
        Items.iron_ingot,
        'B',
        Items.stick);

    // Stone Spear
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.stoneSpear),
        "  A",
        " B ",
        "B  ",
        'A',
        Blocks.stone,
        'B',
        Items.stick);

    // Cobble Ball
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.cobble_ball, 4),
        " B ",
        "BAB",
        " B ",
        'B',
        Blocks.stone,
        'A',
        Blocks.cobblestone);

    // Slingshot
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.slingshot),
        "ACA",
        "B B",
        " B ",
        'A',
        GlobalAdditions.fiber,
        'B',
        Items.stick,
        'C',
        Items.leather);

    // Motar and Pestle
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.pestle),
        "   ",
        "ABA",
        " A ",
        'A',
        Blocks.stone,
        'B',
        Blocks.cobblestone);

    // Smithy
    GameRegistry.addRecipe(
        new ItemStack(GlobalAdditions.smithy),
        "AAA",
        "B B",
        "B B",
        'A',
        Blocks.iron_block,
        'B',
        Blocks.planks);

    // Tranc Arrow
    GameRegistry.addShapelessRecipe(
        new ItemStack(GlobalAdditions.tranq_arrow), GlobalAdditions.narcotics, Items.arrow);

    // Pistol
    // GameRegistry.addRecipe(new ItemStack(GlobalAdditions.),
    //		"AAA",
    //		"A  ",
    //		"   ",
    //		'A', Items.iron_ingot);

    // Ammo
    // GameRegistry.addShapelessRecipe(new ItemStack(GlobalAdditions. ,3), Items.gunpowder,
    // Items.iron_ingot);

    /*
    GameRegistry.addShapelessRecipe(new ItemStack(GlobalAdditions.narcotics, 1), new ItemStack(Items.bowl), new ItemStack(GlobalAdditions.narcoBerry), new ItemStack(GlobalAdditions.fiber,1));
    GameRegistry.addRecipe(new ItemStack(GlobalAdditions.stoneSpear), "B  ", " A ", "  A", 'A', new ItemStack(Items.stick), 'B', new ItemStack(Blocks.stone));
    GameRegistry.addRecipe(new ItemStack(GlobalAdditions.ironPike), "B  ", " A ", "  A", 'A', new ItemStack(Items.stick), 'B', new ItemStack(Items.iron_ingot));
    GameRegistry.addRecipe(new ItemStack(GlobalAdditions.cobble_ball), "BB ", "BB ", 'B', new ItemStack(Blocks.cobblestone));
    */
    //			GameRegistry.addShapelessRecipe(new ItemStack(GlobalAdditions.saddle_small, 1),
    // Items.leather, Items.iron_ingot,
    //					GlobalAdditions.fiber, GlobalAdditions.fiber, GlobalAdditions.fiber,
    // GlobalAdditions.fiber, GlobalAdditions.fiber);
  }