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


Java IRecipeWrapper類代碼示例

本文整理匯總了Java中mezz.jei.api.recipe.IRecipeWrapper的典型用法代碼示例。如果您正苦於以下問題:Java IRecipeWrapper類的具體用法?Java IRecipeWrapper怎麽用?Java IRecipeWrapper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(!(recipeWrapper instanceof JEICauldronWrapper))
		return;
	JEICauldronWrapper wrapper = (JEICauldronWrapper) recipeWrapper;
	catalyst = wrapper.getCatalyst();
	if(!catalyst.hasState())
		currentFluid = fluidTypes.get(catalyst);
	else
		currentFluid = null;
	name = GlassContainer.getGlassContaining(catalyst);
	recipeLayout.getItemStacks().init(0, true, 66, 0);
	recipeLayout.getItemStacks().set(0, ingredients.getInputs(ItemStack.class).get(0));
	recipeLayout.getItemStacks().init(1, false, 66, 29);
	recipeLayout.getItemStacks().set(1, HarshenUtils.toArray(new ItemStack(HarshenItems.RITUAL_STICK)));
	recipeLayout.getItemStacks().init(2, false, 130, 46);
	recipeLayout.getItemStacks().set(2, ingredients.getOutputs(ItemStack.class).get(0));
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:19,代碼來源:JEICauldronCategory.java

示例2: CraftingControl

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
public <T extends IRecipeWrapper> CraftingControl(IRecipeCategory<T> category, T wrapper, ResourceLocation border, int borderSize)
{
    super(border, 2);
    this.title = category.getTitle();
    off = DrawingTools.getStringHeight(title) + 2;
    IRecipeRegistry reg = PMJeiPlugin.RUNTIME.getRecipeRegistry();
    IRecipeLayoutDrawable draw = reg.createRecipeLayoutDrawable(category, wrapper, reg.createFocus(IFocus.Mode.OUTPUT, new ItemStack(Items.STICK /*hack*/)));
    setWidth(category.getBackground().getWidth() + size * 2);
    setHeight(category.getBackground().getHeight() + size * 2);
    draw.setPosition(size, size);
    this.draw = draw;
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:13,代碼來源:CraftingControl.java

示例3: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的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

示例4: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
/** Set the recipe layout */
@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 EnchantmentUpgradeWrapper) {
		guiItemStacks.set(ingredients);
	}
}
 
開發者ID:sblectric,項目名稱:AdvancedCombat,代碼行數:19,代碼來源:EnchantmentUpgradeCategory.java

示例5: register

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void register(IModRegistry registry) {

    jeiHelpers = registry.getJeiHelpers();

    registry.addRecipes(ManaRecipes.recipesList, ManaCraftingCategory.UID);

    registry.handleRecipes(ManaCraftingRecipe.class, new IRecipeWrapperFactory<ManaCraftingRecipe>() {
        @Override
        public IRecipeWrapper getRecipeWrapper(ManaCraftingRecipe recipe) {
            return new ManaCraftingWrapper(recipe);
        }
    }, ManaCraftingCategory.UID);

    registry.addRecipeCatalyst(new ItemStack(Blocks.manaCraftingTable), ManaCraftingCategory.UID);

    registry.addRecipeClickArea(GuiManaCraftingTable.class, 90, 35, 21, 14, ManaCraftingCategory.UID);

    IIngredientBlacklist blacklist = registry.getJeiHelpers().getIngredientBlacklist();
    blacklist.addIngredientToBlacklist(new ItemStack(Blocks.researchStoneBrick));
}
 
開發者ID:Ohrm,項目名稱:Malgra,代碼行數:22,代碼來源:JEIPlugin.java

示例6: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	IGuiItemStackGroup stacks = recipeLayout.getItemStacks();
	stacks.init(INFUSE, true, 25, 20);
	stacks.init(SURROUND[0], true, 25, 0);
	stacks.init(SURROUND[1], true, 45, 20);
	stacks.init(SURROUND[2], true, 25, 40);
	stacks.init(SURROUND[3], true, 5, 20);
	stacks.init(OUTPUT, false, 102, 15);
	
	if (recipeWrapper instanceof LightningInfusionRecipeWrapper) {
		LightningInfusionRecipeWrapper lirWrapper = (LightningInfusionRecipeWrapper)recipeWrapper;
		stacks.set(INFUSE, lirWrapper.getInfuseItem());
		for(int i = 0; i < SURROUND.length; i++) {
			stacks.set(SURROUND[i], lirWrapper.getSurroundingItems().get(i));
		}
		stacks.set(OUTPUT, (ItemStack)recipeWrapper.getOutputs().get(0));
	}
}
 
開發者ID:sblectric,項目名稱:LightningCraft,代碼行數:20,代碼來源:LightningInfusionRecipeCategory.java

示例7: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
    List<List<ItemStack>> inputStackList = ingredients.getInputs(ItemStack.class);

    recipeLayout.getItemStacks().init(0, true, 6, 6);
    if(inputStackList.size() > 0)
    recipeLayout.getItemStacks().set(0, inputStackList.get(0));

    recipeLayout.getItemStacks().init(1, true, 6, 32);
    if(inputStackList.size() > 1)
        recipeLayout.getItemStacks().set(1, inputStackList.get(1));

    recipeLayout.getItemStacks().init(2, false, 77, 19);
    recipeLayout.getItemStacks().set(2, ingredients.getOutputs(ItemStack.class).get(0));
}
 
開發者ID:Lumaceon,項目名稱:ClockworkPhase2,代碼行數:17,代碼來源:AlloyFurnaceRecipeCategory.java

示例8: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
{
	for (int i = 0; i < INPUT_SLOTS.length; i++)
		recipeLayout.getItemStacks().init(INPUT_SLOTS[i], true, INPUT_SLOTS_X[i], INPUT_SLOTS_Y[i]);
       recipeLayout.getItemStacks().init(OUTPUT_SLOT, true, OUTPUT_SLOT_X, OUTPUT_SLOT_Y);
       
       if (recipeWrapper instanceof AssemblerJEIRecipe)
       {
           AssemblerJEIRecipe assemblerWrapper = (AssemblerJEIRecipe) recipeWrapper;
           
           List<ItemStack> inputs = assemblerWrapper.getInputs();
           for (int i = 0; i < Math.min(INPUT_SLOTS.length, inputs.size()); i++)
           {
           	ItemStack in = inputs.get(i);
           	if (in != null) recipeLayout.getItemStacks().set(INPUT_SLOTS[i], in);
           }
           
           List<ItemStack> outputs = assemblerWrapper.getOutputs();
           for (int i = 0; i < Math.min(1, outputs.size()); i++)
           {
           	ItemStack out = outputs.get(i);
           	if (out != null) recipeLayout.getItemStacks().set(OUTPUT_SLOT, out);
           }
       }
}
 
開發者ID:JasonYe4273,項目名稱:Minecraft-Modding,代碼行數:27,代碼來源:AssemblerJEICategory.java

示例9: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
{
	recipeLayout.getItemStacks().init(INPUT_SLOT, true, INPUT_SLOT_X, INPUT_SLOT_Y);
       recipeLayout.getItemStacks().init(JAR_INPUT_SLOT, true, JAR_INPUT_SLOT_X, JAR_INPUT_SLOT_Y);
       for (int i = 0; i < OUTPUT_SLOTS.length; i++)
       	recipeLayout.getItemStacks().init(OUTPUT_SLOTS[i], false, OUTPUT_SLOTS_X[i], OUTPUT_SLOTS_Y[i]);

       if (recipeWrapper instanceof ElectrolyzerJEIRecipe)
       {
           ElectrolyzerJEIRecipe electrolyzerWrapper = (ElectrolyzerJEIRecipe) recipeWrapper;
           
           List<ItemStack> inputs = electrolyzerWrapper.getInputs();
           int jarIdx = electrolyzerWrapper.getJarInIndex();
           if (inputs.size() > 0 && jarIdx > 0) recipeLayout.getItemStacks().set(INPUT_SLOT, inputs.get(0));
           if (jarIdx != -1) recipeLayout.getItemStacks().set(JAR_INPUT_SLOT, inputs.get(jarIdx));
           
           List<ItemStack> outputs = electrolyzerWrapper.getOutputs();
           for (int i = 0; i < outputs.size(); i++)
           {
           	ItemStack out = outputs.get(i);
           	if (out != null) recipeLayout.getItemStacks().set(OUTPUT_SLOTS[i], out);
           }
       }
}
 
開發者ID:JasonYe4273,項目名稱:Minecraft-Modding,代碼行數:26,代碼來源:ElectrolyzerJEICategory.java

示例10: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
	if(!(recipeWrapper instanceof ProcessingRecipeWrapper)) {
		Log.error("RecipeWrapper type unknown: {}", recipeWrapper);
		return;
	}

	ProcessingRecipeWrapper processingWrapper = (ProcessingRecipeWrapper)recipeWrapper;
	IProcessingRecipe recipe = processingWrapper.recipe;

	IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();

	guiItemStacks.init(slotInput, true, 4, 2);
	guiItemStacks.setFromRecipe(slotInput, recipeWrapper.getInputs());

	ChancedOutput[] co = recipe.getOutput();

	for(int i = 0; i < co.length; i++) {
		int r = i % MAX_ROWS;
		int c = i / MAX_ROWS;
		guiItemStacks.init(slotOutput + i, false, 84 + c*18, 4 + r*18);
		guiItemStacks.set(slotOutput + i, co[i].output);
	}
}
 
開發者ID:Team-IO,項目名稱:taam,代碼行數:25,代碼來源:ProcessingCategory.java

示例11: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(recipeWrapper instanceof MaterializationRecipeWrapper){
		IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();


		itemStacks.init(input1, true, 2, 2);
		itemStacks.init(input2, true, 25, 2);
		itemStacks.init(input3, true, 49, 2);
		itemStacks.init(input4, true, 72, 2);
		itemStacks.init(input5, true, 95, 2);
		itemStacks.init(output, false, 49, 54);

		itemStacks.set(ingredients);
	}
}
 
開發者ID:Shinoow,項目名稱:AbyssalCraft,代碼行數:17,代碼來源:MaterializationRecipeCategory.java

示例12: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(recipeWrapper instanceof RitualRecipeWrapper){
		IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
		int xBoost = 14, yBoost = -25;

		itemStacks.init(pedestal1, true, 58 + xBoost, 30 + yBoost);
		itemStacks.init(pedestal2, true, 84 + xBoost, 40 + yBoost);
		itemStacks.init(pedestal3, true, 94 + xBoost, 66 + yBoost);
		itemStacks.init(pedestal4, true, 84 + xBoost, 92 + yBoost);
		itemStacks.init(pedestal5, true, 58 + xBoost, 103 + yBoost);
		itemStacks.init(pedestal6, true, 32 + xBoost, 92 + yBoost);
		itemStacks.init(pedestal7, true, 22 + xBoost, 66 + yBoost);
		itemStacks.init(pedestal8, true, 32 + xBoost, 40 + yBoost);
		itemStacks.init(sacrifice, true, 58 + xBoost, 66 + yBoost);
		itemStacks.init(necronomicon, true, 0 + xBoost, 133 + yBoost);
		itemStacks.init(reward, false, 58 + xBoost, 139 + yBoost);

		itemStacks.set(ingredients);
	}
}
 
開發者ID:Shinoow,項目名稱:AbyssalCraft,代碼行數:22,代碼來源:RitualRecipeCategory.java

示例13: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(!(recipeWrapper instanceof JEIMagicTableWrapper))
		return;
	Point[] points = {new Point(67, 12), new Point(32, 47), new Point(102, 47), new Point(67, 82)};
	int listSize = ingredients.getInputs(ItemStack.class).size();
	for(int i = 0; i < listSize; i++)
	{
		recipeLayout.getItemStacks().init(i, true, points[i].x, points[i].y);
		recipeLayout.getItemStacks().set(i, ingredients.getInputs(ItemStack.class).get(i));
	}
	recipeLayout.getItemStacks().init(listSize, false, 67, 47);
	recipeLayout.getItemStacks().set(listSize, ingredients.getOutputs(ItemStack.class).get(0));
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:15,代碼來源:JEIMagicTableCategory.java

示例14: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(!(recipeWrapper instanceof JEIHereticRitualWrapper))
		return;
	JEIHereticRitualWrapper wrapper = (JEIHereticRitualWrapper) recipeWrapper;
	catalyst = wrapper.getCatalyst();
	if(!catalyst.hasState())
		currentFluid = fluidTypes.get(catalyst);
	else
		currentFluid = null;
	name = GlassContainer.getGlassContaining(catalyst);
	int index = 1;
	Point center = new Point(75, 46);
	Point point = new Point(center.x, center.y - 52);

	recipeLayout.getItemStacks().init(0, true, 7, 14);
	recipeLayout.getItemStacks().set(0, ingredients.getInputs(ItemStack.class).get(0));
	
	List<List<ItemStack>> stackList = ingredients.getInputs(ItemStack.class);
	List<List<ItemStack>> revampedList = new ArrayList<>();
	stackList.remove(0);
	for(int i = 0; i < 8; i++)
		revampedList.add(stackList.get(i));
	for(int i = 0; i < 8; i++) {
		recipeLayout.getItemStacks().init(index, true, point.x, point.y);
		recipeLayout.getItemStacks().set(index, revampedList.get(i));
		index += 1;
		point = HarshenUtils.rotatePointAbout(point, center, 45D);
	}

	recipeLayout.getItemStacks().init(index, false, 4, 88);
	recipeLayout.getItemStacks().set(index, ingredients.getOutputs(ItemStack.class).get(0));
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:34,代碼來源:JEIHereticRitualCategory.java

示例15: setRecipe

import mezz.jei.api.recipe.IRecipeWrapper; //導入依賴的package包/類
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
	if(!(recipeWrapper instanceof JEIRitualWrapper))
		return;
	JEIRitualWrapper wrapper = (JEIRitualWrapper) recipeWrapper;
	List<List<ItemStack>> stackList = ingredients.getInputs(ItemStack.class);
	for(int i = 0; i < 4; i++)
		addSlot(recipeLayout, stackList, i);
	recipeLayout.getItemStacks().init(4, false, 122, 45);
	recipeLayout.getItemStacks().set(4, ingredients.getOutputs(ItemStack.class).get(0));
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:12,代碼來源:JEIRitualCategory.java


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