本文整理汇总了Java中mezz.jei.api.gui.IRecipeLayout类的典型用法代码示例。如果您正苦于以下问题:Java IRecipeLayout类的具体用法?Java IRecipeLayout怎么用?Java IRecipeLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IRecipeLayout类属于mezz.jei.api.gui包,在下文中一共展示了IRecipeLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, AlchemicalMixerWrapper recipeWrapper, IIngredients ingredients) {
IGuiFluidStackGroup fluid = recipeLayout.getFluidStacks();
fluid.init(0, true, 26, 3, 16, 16, 16, true, null);
fluid.init(1, true, 26, 45, 16, 16, 16, true, null);
fluid.init(2, true, 66, 3, 16, 16, 16, true, null);
fluid.init(3, true, 66, 45, 16, 16, 16, true, null);
fluid.init(4, false, 89, 16, 16, 32, 16, true, null);
List<List<FluidStack>> inputs = ingredients.getInputs(FluidStack.class);
int size = inputs.size();
for(int i = 0; i < Math.min(size,4); i++)
{
fluid.set(i, inputs.get(i));
}
fluid.set(4, ingredients.getOutputs(FluidStack.class).get(0));
lastRecipe = recipeWrapper.recipe;
}
示例2: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的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));
}
示例3: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, SimpleSteelJEIWrapper.BlastFurnace recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup group = recipeLayout.getItemStacks();
group.init(TileBlastFurnace.INPUT1, true, 1, 1);
group.set(TileBlastFurnace.INPUT1, recipeWrapper.recipe.getInputs()[0].getListForJEI());
if(recipeWrapper.recipe.getInputs()[1] != OreDictStack.EMPTY){
group.init(TileBlastFurnace.INPUT2, true, 21, 1);
group.set(TileBlastFurnace.INPUT2, recipeWrapper.recipe.getInputs()[1].getListForJEI());
}
if(recipeWrapper.recipe.getInputs()[2] != OreDictStack.EMPTY){
group.init(TileBlastFurnace.INPUT3, true, 21, 1);
group.set(TileBlastFurnace.INPUT3, recipeWrapper.recipe.getInputs()[2].getListForJEI());
}
group.init(TileBlastFurnace.OUTPUT1, false, 11, 47);
group.set(TileBlastFurnace.OUTPUT1, recipeWrapper.recipe.getOutputs()[0]);
if(!recipeWrapper.recipe.getOutputs()[1].isEmpty()){
group.init(TileBlastFurnace.OUTPUT2, false, 31, 47);
group.set(TileBlastFurnace.OUTPUT2, recipeWrapper.recipe.getOutputs()[1]);
}
}
示例4: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout layout, WrapperArcaneTransfiguration wrapper, IIngredients ingredients)
{
IGuiIngredientGroup<ItemStack> stacks = layout.getIngredientsGroup(ItemStack.class);
wrapper.setRecipe(layout, ingredients);
stacks.init(0, false, 94, 18);
ItemStack output = ingredients.getOutputs(ItemStack.class).get(0).get(0);
stacks.set(0, output);
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
for (int i = 0; i < 9; i++)
{
stacks.init(i + 1, true, (i % 3) * 18, (i / 3) * 18);
stacks.set(i + 1, inputs.get(i));
}
}
示例5: 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));
}
示例6: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的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);
}
}
示例7: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, FusionJEIRecipe recipeWrapper, IIngredients arg2) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
int x = 36;
int y = 36;
guiItemStacks.init(0, false, x+55, y);
guiItemStacks.init(1, true, x, y);
int inputSize = recipeWrapper.recipe.getInputs().size();
double theta = ((Math.PI*2)/inputSize);
for(int i = 0; i < inputSize; i++){
double angle = theta * i;
guiItemStacks.init(2+i, true, x + (int)(30.0D * Math.cos(angle)), y - 1 + (int)(30.0D * Math.sin(angle)));
}
guiItemStacks.set(arg2);
}
示例8: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ManaRecipeJEI recipeWrapper, @Nonnull IIngredients ingredients) {
recipeLayout.getItemStacks().init(0, true, 0, 13);
recipeLayout.getFluidStacks().init(0, true, 30, 14);
recipeLayout.getItemStacks().init(1, true, 11, 46);
recipeLayout.getItemStacks().init(2, true, 29, 46);
recipeLayout.getItemStacks().init(3, true, 47, 46);
recipeLayout.getItemStacks().init(4, true, 11, 64);
recipeLayout.getItemStacks().init(5, true, 29, 64);
recipeLayout.getItemStacks().init(6, true, 47, 64);
recipeLayout.getItemStacks().init(7, true, 11, 82);
recipeLayout.getItemStacks().init(8, true, 29, 82);
recipeLayout.getItemStacks().init(9, true, 47, 82);
if (recipeWrapper.isFluidOutput())
recipeLayout.getFluidStacks().init(1, false, 59, 14);
else
recipeLayout.getItemStacks().init(10, false, 58, 13);
recipeLayout.getItemStacks().set(ingredients);
recipeLayout.getFluidStacks().set(ingredients);
}
示例9: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(final IRecipeLayout recipeLayout, final QBarJEIRecipeWrapper recipeWrapper,
final IIngredients ingredients)
{
final IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
slots.forEach(slot -> {
guiItemStacks.init(this.slots.indexOf(slot), slot.isInput(), slot.getX(), slot.getY());
int count = this.getSlotCount(slot);
if (slot.isInput())
{
if (ingredients.getInputs(ItemStack.class).size() > count)
guiItemStacks.set(this.slots.indexOf(slot), ingredients.getInputs(ItemStack.class).get(count));
}
else
{
if (ingredients.getOutputs(ItemStack.class).size() > count)
guiItemStacks.set(this.slots.indexOf(slot), ingredients.getOutputs(ItemStack.class).get(count));
}
});
}
示例10: transferRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public IRecipeTransferError transferRecipe(Container container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer,
boolean doTransfer) {
if (doTransfer) {
Map<Integer, ? extends IGuiIngredient<ItemStack>> inputs = recipeLayout.getItemStacks().getGuiIngredients();
NBTTagCompound recipe = new NBTTagCompound();
for (Slot slot : (List<Slot>) container.inventorySlots) {
if (slot.inventory instanceof InventoryCrafting) {
IGuiIngredient<ItemStack> ingredient = inputs.get(slot.getSlotIndex()+1);
if (ingredient != null) {
List<ItemStack> possibleItems = ingredient.getAllIngredients();
NBTTagList tags = new NBTTagList();
for (ItemStack is : possibleItems) {
NBTTagCompound tag = new NBTTagCompound();
is.writeToNBT(tag);
tags.appendTag(tag);
}
recipe.setTag("#" + slot.getSlotIndex(), tags);
}
}
}
EZStorage.instance.networkWrapper.sendToServer(new RecipeMessage(recipe));
}
return null;
}
示例11: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, MixerRecipeJEI recipe, IIngredients ingredients) {
int x = 21;
int y = 21;
int tankY = 10;
recipeLayout.getItemStacks().init(0, true, x, y);
recipeLayout.getItemStacks().init(1, true, x + 18, y);
recipeLayout.getItemStacks().init(2, true, x, y + 18);
recipeLayout.getItemStacks().init(3, true, x + 18, y + 18);
for (int i = 0;i < 4;i++)
recipeLayout.getIngredientsGroup(ItemStack.class).set(i, getItemStack(((List<?>) recipe.recipe[0]).get(i)));
recipeLayout.getFluidStacks().init(0, true, -23, tankY, 12, 47, 10000, true, tankOverlay);
recipeLayout.getFluidStacks().init(1, false, 80, tankY, 12, 47, 10000, true, tankOverlay);
if ((Boolean) recipe.recipe[2])
recipeLayout.getFluidStacks().init(2, true, 0, tankY, 12, 47, 10000, true, tankOverlay);
recipeLayout.getFluidStacks().set(0, (FluidStack) ((Object[][]) recipe.recipe[1])[0][0]);
recipeLayout.getFluidStacks().set(1, (FluidStack) ((Object[][]) recipe.recipe[1])[1][0]);
if ((Boolean) recipe.recipe[2]) {
Object[][] d = (Object[][]) recipe.recipe[1];
if (d.length > 2)
recipeLayout.getFluidStacks().set(2, (FluidStack) d[2][0]);
}
}
示例12: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, PlasticRecipeJEI recipe, IIngredients ingredients) {
int x = 5;
int y = 60;
int tankY = 0;
recipeLayout.getItemStacks().init(0, true, x, y);
recipeLayout.getItemStacks().init(1, true, x + 18, y);
recipeLayout.getItemStacks().init(2, true, x + 73, y);
for (int i = 0;i < 2;i++)
recipeLayout.getIngredientsGroup(ItemStack.class).set(i, recipe.inputs.get(i));
recipeLayout.getItemStacks().set(2, recipe.output);
recipeLayout.getFluidStacks().init(0, true, 0, tankY, 12, 47, 20000, true, tankOverlay);
recipeLayout.getFluidStacks().init(1, true, 22, tankY, 12, 47, 10000, true, tankOverlay);
recipeLayout.getFluidStacks().init(2, true, 44, tankY, 12, 47, 10000, true, tankOverlay);
recipeLayout.getFluidStacks().init(3, true, 66, tankY, 12, 47, 10000, true, tankOverlay);
recipeLayout.getFluidStacks().set(0, recipe.fluidInputs.get(0));
recipeLayout.getFluidStacks().set(1, recipe.fluidInputs.get(1));
recipeLayout.getFluidStacks().set(2, recipe.fluidInputs.get(2));
recipeLayout.getFluidStacks().set(3, recipe.fluidInputs.get(3));
}
示例13: apply
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public ItemStack[] apply(IRecipeLayout t, Boolean u) {
List<ItemStack> inputs = new ArrayList<>();
List<ItemStack> outputs = new ArrayList<>();
IGuiItemStackGroup itemStackGroup = t.getItemStacks();
for (IGuiIngredient<ItemStack> ingredient : itemStackGroup.getGuiIngredients().values()) {
if (ingredient.isInput()) {
if (!ingredient.getAllIngredients().isEmpty() && ingredient.getAllIngredients().get(0) != null) {
inputs.add(ingredient.getAllIngredients().get(0));
} else {
inputs.add(ItemStack.EMPTY);
}
} else {
if (!ingredient.getAllIngredients().isEmpty() && ingredient.getAllIngredients().get(0) != null) {
outputs.add(ingredient.getAllIngredients().get(0));
} else {
outputs.add(ItemStack.EMPTY);
}
}
}
return u ? outputs.toArray(new ItemStack[]{}) : inputs.toArray(new ItemStack[]{});
}
示例14: 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();
}
示例15: setRecipe
import mezz.jei.api.gui.IRecipeLayout; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout layout,
GeoCraftingCategory.Wrapper wrapper, IIngredients ingredients) {
IGuiItemStackGroup stacks = layout.getItemStacks();
stacks.init(OUTPUT_I, false, OUTPUT_X, OUTPUT_Y);
for (int y = 0; y < CRAFT_ROWS; y++) {
for (int x = 0; x < CRAFT_COLS; x++) {
int index = x + (y * CRAFT_COLS);
stacks.init(index, true, x * SLOT_SIZE, y * SLOT_SIZE);
}
}
stacks.set(ingredients);
}