ForgeAPI > ShapelessOreRecipe

OreDictionaryと連動したIOreHandlerに代わる新しいレシピ指定クラス. ShapedOreRecipeがModLoader.addRecipeに対応するように, ShapelessOreRecipeはModLoader.addShapelessRecipeに対応する. IReciepを実装しているのでGameRegistry.addRecipe()の引数にnewして渡せばよい.

ModLoader.addRecipe風に銀インゴットを使ったレシピを追加する例

GameRegistry.addRecipe(
    new ShapelessOreRecipe(
        new ItemStack(ingotSilverIron, 1),
            new Object[]
            {
                "ingotSilver", Item.ingotIron
            }));
 

コンストラクタ

public ShapelessOreRecipe(Block result, Object... recipe)
public ShapelessOreRecipe(Item  result, Object... recipe)
public ShapelessOreRecipe(ItemStack result, Object... recipe)
 
ShapedOreRecipe, ModLoader.addShapelessRecipeとほぼ同じ.

IRecipe実装メソッド

public ItemStack getCraftingResult(InventoryCrafting var1)
public int getRecipeSize()
public ItemStack getRecipeOutput()
public boolean matches(InventoryCrafting inv)
 
インタフェースIRecipeに用意されいてるメソッドを実装したもの. 上から列挙すると以下の意味.
  • 引数のインベントリに応じたクラフト結果のアイテム
  • レシピのサイズ
  • コンストラクタで指定されたレシピのクラフト結果のアイテム
  • 引数のインベントリとコンストラクタで指定したレシピが一致しているかどうか
最終更新:2012年08月30日 00:43