當前位置: 首頁>>代碼示例>>Java>>正文


Java IRecipeLayout.setShapeless方法代碼示例

本文整理匯總了Java中mezz.jei.api.gui.IRecipeLayout.setShapeless方法的典型用法代碼示例。如果您正苦於以下問題:Java IRecipeLayout.setShapeless方法的具體用法?Java IRecipeLayout.setShapeless怎麽用?Java IRecipeLayout.setShapeless使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mezz.jei.api.gui.IRecipeLayout的用法示例。


在下文中一共展示了IRecipeLayout.setShapeless方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
    super.setRecipe(recipeLayout, recipeWrapper, ingredients);

    IGuiItemStackGroup stacks = recipeLayout.getItemStacks();

    List<List<ItemStack>> inputItems = ingredients.getInputs(ItemStack.class);
    List<List<ItemStack>> outputItems = ingredients.getOutputs(ItemStack.class);

    initItems(stacks, true, module.rows * module.columns, 0);
    initItems(stacks, false, 1, module.rows * module.columns);

    if (recipeWrapper instanceof IShapedCraftingRecipeWrapper)
    {
        IShapedCraftingRecipeWrapper wrapper = (IShapedCraftingRecipeWrapper) recipeWrapper;
        craftingGridHelper.setInputs(stacks, inputItems, wrapper.getWidth(), wrapper.getHeight());
    } else
    {
        craftingGridHelper.setInputs(stacks, inputItems);
        recipeLayout.setShapeless();
    }

    stacks.set(module.rows * module.columns, outputItems.get(0));
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:26,代碼來源:CraftingRecipeCategory.java

示例2: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, CustomCrafingRecipeJEI recipe, IIngredients ingredients) {
	int x = 5;
	int y = 4;
	List<List<ItemStack>> inputs = recipe.getInputs();
	recipeLayout.getItemStacks().init(0, true, x, y);
	recipeLayout.getItemStacks().init(1, true, x + 18, y);
	recipeLayout.getItemStacks().init(2, true, x + 36, y);
	recipeLayout.getItemStacks().init(3, true, x, y + 18);
	recipeLayout.getItemStacks().init(4, true, x + 18, y + 18);
	recipeLayout.getItemStacks().init(5, true, x + 36, y + 18);
	recipeLayout.getItemStacks().init(6, true, x, y + 36);
	recipeLayout.getItemStacks().init(7, true, x + 18, y + 36);
	recipeLayout.getItemStacks().init(8, true, x + 36, y + 36);
	recipeLayout.getItemStacks().init(9, false, x + 94, y + 18);
	recipeLayout.getItemStacks().init(10, false, x + 94, y + 45);
	for (int i = 0;i < 10;i++)
		setSlot(recipeLayout, inputs, i);
	recipeLayout.getItemStacks().set(9, recipe.input.getRecipeOutput());
	if (recipe.extra != null)
		recipeLayout.getItemStacks().set(10, recipe.extra);
	if (!recipe.shaped)
		recipeLayout.setShapeless();
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:25,代碼來源:CustomCraftingRecipeCategory.java

示例3: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout lay, AbstractMagibenchRecipeWrapper wrapper, IIngredients ingredients)
{
    if(wrapper instanceof MagibenchShapelessRecipeWrapper)
        lay.setShapeless();
    IGuiItemStackGroup st = lay.getItemStacks();
    MagibenchRegistry.Tier t = PurMag.INSTANCE.getMagibenchRegistry().getTier(wrapper.recipe.getTier());
    int index = 0;
    st.init(index, false, t.getGuiResultX() - t.getGuiJeiStartX() - 1, t.getGuiResultY() - t.getGuiJeiStartY() - 1);
    st.set(index, ingredients.getOutputs(ItemStack.class).get(0));
    index++;

    List<List<ItemStack>> lst = ingredients.getInputs(ItemStack.class);
    for(int y = 0; y < t.getHeight(); y++)
    {
        for(int x = 0; x < t.getWidth(); x++)
        {
            st.init(index, true, t.getGuiGridX() - t.getGuiJeiStartX() + 18*x - 1, t.getGuiGridY() - t.getGuiJeiStartY() + 18*y - 1);
            int ind = index - 1;
            if(lst.size() > ind)
            {
                st.set(index, lst.get(ind));
            }
            index++;
        }
    }
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:28,代碼來源:MagibenchRecipeCategory.java

示例4: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
    IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();

    guiItemStacks.init(craftOutputSlot, false, 107, 29);

    for (int y = 0; y < 3; ++y) {
        for (int x = 0; x < 3; ++x) {
            int index = craftInputSlot1 + x + (y * 3);
            guiItemStacks.init(index, true, 13 + x * 18, 11 + y * 18);
        }
    }

    if(recipeWrapper instanceof InfuserRecipeWrapper) {
        IRecipeWrapper innerWrapper = ((InfuserRecipeWrapper) recipeWrapper).getInner();

        if (innerWrapper instanceof ICustomCraftingRecipeWrapper) {
            ICustomCraftingRecipeWrapper customWrapper = (ICustomCraftingRecipeWrapper) innerWrapper;
            customWrapper.setRecipe(recipeLayout, ingredients);
            return;
        }

        List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
        List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);

        if (innerWrapper instanceof IShapedCraftingRecipeWrapper) {
            IShapedCraftingRecipeWrapper wrapper = (IShapedCraftingRecipeWrapper) innerWrapper;
            craftingGridHelper.setInputs(guiItemStacks, inputs, wrapper.getWidth(), wrapper.getHeight());
        } else {
            craftingGridHelper.setInputs(guiItemStacks, inputs);
            recipeLayout.setShapeless();
        }
        guiItemStacks.set(craftOutputSlot, outputs.get(0));
    }
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:36,代碼來源:InfuserRecipeCategory.java

示例5: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper,	IIngredients ingredients) {
	IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();

	guiItemStacks.init(craftOutputSlot, false, 94, 18);

	for (int y = 0; y < 3; ++y) {
		for (int x = 0; x < 3; ++x) {
			int index = craftInputSlot1 + x + (y * 3);
			guiItemStacks.init(index, true, x * 18, y * 18);
		}
	}

	if (recipeWrapper instanceof ICustomCraftingRecipeWrapper) {
		ICustomCraftingRecipeWrapper customWrapper = (ICustomCraftingRecipeWrapper) recipeWrapper;
		customWrapper.setRecipe(recipeLayout, ingredients);
		return;
	}

	List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
	List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);

	if (recipeWrapper instanceof IShapedCraftingRecipeWrapper) {
		IShapedCraftingRecipeWrapper wrapper = (IShapedCraftingRecipeWrapper) recipeWrapper;
		craftingGridHelper.setInputs(guiItemStacks, inputs, wrapper.getWidth(), wrapper.getHeight());
	} else {
		craftingGridHelper.setInputs(guiItemStacks, inputs);
		recipeLayout.setShapeless();
	}
	guiItemStacks.set(craftOutputSlot, outputs.get(0));
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:32,代碼來源:CrystalWorkbenchCategory.java

示例6: setRecipe

import mezz.jei.api.gui.IRecipeLayout; //導入方法依賴的package包/類
@Override
public void setRecipe(IRecipeLayout layout, IIngredients input)
{
	if (recipe.isShapeless())
		layout.setShapeless();
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:7,代碼來源:WrapperArcaneTransfiguration.java


注:本文中的mezz.jei.api.gui.IRecipeLayout.setShapeless方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。