Search in sources :

Example 6 with IRecipeWrapper

use of mezz.jei.api.recipe.IRecipeWrapper in project Binnie by ForestryMC.

the class MultiFenceRecipeRegistryPlugin method getRecipes.

private List<IRecipeWrapper> getRecipes(IFocus<ItemStack> focus) {
    ItemStack ingredient = focus.getValue();
    List<IRecipeWrapper> recipes = new ArrayList<>();
    if (focus.getMode() == Mode.INPUT) {
        IPlankType plankType = WoodManager.getPlankType(ingredient);
        if (plankType != null) {
            for (MultiFenceRecipePattern pattern : MultiFenceRecipePattern.VALUES) {
                recipes.add(new MultiFenceRecipeSizeWrapper(pattern, plankType));
            }
            for (int size = 0; size < 3; size++) {
                for (final boolean solid : new boolean[] { false, true }) {
                    recipes.add(new MultiFenceRecipeEmbeddedWrapper(plankType, new FenceType(size, solid, false)));
                }
            }
        } else {
            FenceDescription desc = WoodManager.getFenceDescription(ingredient);
            if (desc != null) {
                if (!desc.getFenceType().isEmbossed()) {
                    recipes.add(new MultiFenceRecipeEmbeddedWrapper(desc));
                }
                if (!desc.getFenceType().isSolid()) {
                    recipes.add(new MultiFenceRecipeSolidWrapper(desc));
                }
            }
        }
    } else {
        FenceDescription desc = WoodManager.getFenceDescription(ingredient);
        if (desc != null) {
            int size = desc.getFenceType().getSize();
            recipes.add(new MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern.VALUES[size * 2], desc.getPlankType(), desc.getSecondaryPlankType()));
            recipes.add(new MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern.VALUES[size * 2 + 1], desc.getPlankType(), desc.getSecondaryPlankType()));
            if (desc.getFenceType().isEmbossed()) {
                recipes.add(new MultiFenceRecipeEmbeddedWrapper(desc));
            }
            if (desc.getFenceType().isSolid()) {
                recipes.add(new MultiFenceRecipeSolidWrapper(desc));
            }
        }
    }
    return recipes;
}
Also used : IPlankType(binnie.extratrees.wood.planks.IPlankType) ArrayList(java.util.ArrayList) IRecipeWrapper(mezz.jei.api.recipe.IRecipeWrapper) FenceType(binnie.extratrees.blocks.decor.FenceType) FenceDescription(binnie.extratrees.blocks.decor.FenceDescription) MultiFenceRecipePattern(binnie.extratrees.blocks.decor.MultiFenceRecipePattern) ItemStack(net.minecraft.item.ItemStack)

Example 7 with IRecipeWrapper

use of mezz.jei.api.recipe.IRecipeWrapper in project Random-Things by lumien231.

the class RandomThingsPlugin method register.

@Override
public void register(IModRegistry registry) {
    this.jeiHelpers = registry.getJeiHelpers();
    RandomThingsPlugin.stackHelper = jeiHelpers.getStackHelper();
    IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
    registry.handleRecipes(ImbuingRecipe.class, (recipe) -> (new ImbuingRecipeWrapper(recipe.getIngredients(), recipe.toImbue(), recipe.getResult())), IMBUE_ID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.imbuingStation), IMBUE_ID);
    IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
    recipeTransferRegistry.addRecipeTransferHandler(ContainerImbuingStation.class, IMBUE_ID, 0, 4, 5, 36);
    registry.addRecipes(lumien.randomthings.recipes.imbuing.ImbuingRecipeHandler.imbuingRecipes, IMBUE_ID);
    List<IRecipeWrapper> anvilRecipes = new ArrayList<IRecipeWrapper>();
    for (AnvilRecipe ar : lumien.randomthings.recipes.anvil.AnvilRecipeHandler.getAllRecipes()) {
        anvilRecipes.add(jeiHelpers.getVanillaRecipeFactory().createAnvilRecipe(ar.getFirst(), Lists.newArrayList(ar.getSecond()), Lists.newArrayList(ar.getOutput())));
    }
    registry.addRecipes(anvilRecipes, VanillaRecipeCategoryUid.ANVIL);
    registry.addRecipeClickArea(GuiImbuingStation.class, 99, 54, 22, 16, IMBUE_ID);
    DescriptionHandler.addDescriptions(registry);
}
Also used : IGuiHelper(mezz.jei.api.IGuiHelper) ImbuingRecipeWrapper(lumien.randomthings.handler.compability.jei.imbuing.ImbuingRecipeWrapper) ArrayList(java.util.ArrayList) AnvilRecipe(lumien.randomthings.recipes.anvil.AnvilRecipe) IRecipeWrapper(mezz.jei.api.recipe.IRecipeWrapper) ItemStack(net.minecraft.item.ItemStack) IRecipeTransferRegistry(mezz.jei.api.recipe.transfer.IRecipeTransferRegistry)

Aggregations

IRecipeWrapper (mezz.jei.api.recipe.IRecipeWrapper)7 ItemStack (net.minecraft.item.ItemStack)4 ArrayList (java.util.ArrayList)3 IGuiHelper (mezz.jei.api.IGuiHelper)2 IVanillaRecipeFactory (mezz.jei.api.recipe.IVanillaRecipeFactory)2 InfuserRecipeWrapper (betterwithaddons.interaction.jei.wrapper.InfuserRecipeWrapper)1 FenceDescription (binnie.extratrees.blocks.decor.FenceDescription)1 FenceType (binnie.extratrees.blocks.decor.FenceType)1 MultiFenceRecipePattern (binnie.extratrees.blocks.decor.MultiFenceRecipePattern)1 IPlankType (binnie.extratrees.wood.planks.IPlankType)1 RecipeRegistry (com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeRegistry)1 EnumTier (com.codetaylor.mc.artisanworktables.api.internal.reference.EnumTier)1 IArtisanRecipe (com.codetaylor.mc.artisanworktables.api.recipe.IArtisanRecipe)1 IRequirement (com.codetaylor.mc.artisanworktables.api.recipe.requirement.IRequirement)1 GameStagesRequirementContext (com.codetaylor.mc.artisanworktables.modules.requirement.gamestages.requirement.GameStagesRequirementContext)1 NNList (com.enderio.core.common.util.NNList)1 IDarkSteelItem (crazypants.enderio.api.upgrades.IDarkSteelItem)1 UpgradePath (crazypants.enderio.base.handler.darksteel.DarkSteelRecipeManager.UpgradePath)1 List (java.util.List)1 ImbuingRecipeWrapper (lumien.randomthings.handler.compability.jei.imbuing.ImbuingRecipeWrapper)1