Search in sources :

Example 6 with IRecipeTransferRegistry

use of mezz.jei.api.recipe.transfer.IRecipeTransferRegistry in project artisan-worktables by codetaylor.

the class PluginJEI method register.

@Override
public void register(IModRegistry registry) {
    for (EnumTier tier : EnumTier.values()) {
        if (!ModuleWorktablesConfig.isTierEnabled(tier)) {
            continue;
        }
        for (String name : ArtisanAPI.getWorktableNames()) {
            registry.addRecipeCatalyst(this.getWorktableAsItemStack(name, tier), PluginJEI.createUID(name, tier));
        }
        for (String name : ArtisanAPI.getWorktableNames()) {
            registry.handleRecipes(ArtisanRecipe.class, JEIRecipeWrapper::new, PluginJEI.createUID(name, tier));
        }
        IRecipeTransferRegistry transferRegistry = registry.getRecipeTransferRegistry();
        for (String name : ArtisanAPI.getWorktableNames()) {
            transferRegistry.addRecipeTransferHandler(new JEIRecipeTransferInfoWorktable(name, PluginJEI.createUID(name, tier), tier));
        }
        for (String name : ArtisanAPI.getWorktableNames()) {
            List<IArtisanRecipe> recipeList = new ArrayList<>();
            RecipeRegistry recipeRegistry = ArtisanAPI.getWorktableRecipeRegistry(name);
            recipeList = recipeRegistry.getRecipeListByTier(recipeList, tier);
            registry.addRecipes(recipeList, PluginJEI.createUID(name, tier));
        }
    }
}
Also used : IArtisanRecipe(com.codetaylor.mc.artisanworktables.api.recipe.IArtisanRecipe) ArrayList(java.util.ArrayList) EnumTier(com.codetaylor.mc.artisanworktables.api.internal.reference.EnumTier) IRecipeTransferRegistry(mezz.jei.api.recipe.transfer.IRecipeTransferRegistry) IRecipeRegistry(mezz.jei.api.IRecipeRegistry) RecipeRegistry(com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeRegistry)

Example 7 with IRecipeTransferRegistry

use of mezz.jei.api.recipe.transfer.IRecipeTransferRegistry in project ForestryMC by ForestryMC.

the class FactoryJeiPlugin method register.

@Override
public void register(IModRegistry registry) {
    registry.addAdvancedGuiHandlers(new ForestryAdvancedGuiHandler());
    if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
        return;
    }
    jeiHelpers = registry.getJeiHelpers();
    registry.addRecipes(BottlerRecipeMaker.getBottlerRecipes(registry.getIngredientRegistry()), ForestryRecipeCategoryUid.BOTTLER);
    registry.addRecipes(CarpenterRecipeMaker.getCarpenterRecipes(), ForestryRecipeCategoryUid.CARPENTER);
    registry.addRecipes(CentrifugeRecipeMaker.getCentrifugeRecipe(), ForestryRecipeCategoryUid.CENTRIFUGE);
    registry.addRecipes(FabricatorRecipeMaker.getFabricatorRecipes(), ForestryRecipeCategoryUid.FABRICATOR);
    registry.addRecipes(FermenterRecipeMaker.getFermenterRecipes(jeiHelpers.getStackHelper()), ForestryRecipeCategoryUid.FERMENTER);
    registry.addRecipes(MoistenerRecipeMaker.getMoistenerRecipes(), ForestryRecipeCategoryUid.MOISTENER);
    registry.addRecipes(RainmakerRecipeMaker.getRecipes(), ForestryRecipeCategoryUid.RAINMAKER);
    registry.addRecipes(SqueezerRecipeMaker.getSqueezerRecipes(), ForestryRecipeCategoryUid.SQUEEZER);
    registry.addRecipes(SqueezerRecipeMaker.getSqueezerContainerRecipes(registry.getIngredientRegistry()), ForestryRecipeCategoryUid.SQUEEZER);
    registry.addRecipes(StillRecipeMaker.getStillRecipes(), ForestryRecipeCategoryUid.STILL);
    registry.addRecipeClickArea(GuiBottler.class, 107, 33, 26, 22, ForestryRecipeCategoryUid.BOTTLER);
    registry.addRecipeClickArea(GuiBottler.class, 45, 33, 26, 22, ForestryRecipeCategoryUid.BOTTLER);
    registry.addRecipeClickArea(GuiCarpenter.class, 98, 48, 21, 26, ForestryRecipeCategoryUid.CARPENTER);
    registry.addRecipeClickArea(GuiCentrifuge.class, 38, 22, 38, 14, ForestryRecipeCategoryUid.CENTRIFUGE);
    registry.addRecipeClickArea(GuiCentrifuge.class, 38, 54, 38, 14, ForestryRecipeCategoryUid.CENTRIFUGE);
    registry.addRecipeClickArea(GuiFabricator.class, 121, 53, 18, 18, ForestryRecipeCategoryUid.FABRICATOR);
    registry.addRecipeClickArea(GuiFermenter.class, 72, 40, 32, 18, ForestryRecipeCategoryUid.FERMENTER);
    registry.addRecipeClickArea(GuiMoistener.class, 123, 35, 19, 21, ForestryRecipeCategoryUid.MOISTENER);
    registry.addRecipeClickArea(GuiSqueezer.class, 76, 41, 43, 16, ForestryRecipeCategoryUid.SQUEEZER);
    registry.addRecipeClickArea(GuiStill.class, 73, 17, 33, 57, ForestryRecipeCategoryUid.STILL);
    BlockRegistryFactory blocks = ModuleFactory.getBlocks();
    Preconditions.checkNotNull(blocks);
    registry.addRecipeCatalyst(new ItemStack(blocks.bottler), ForestryRecipeCategoryUid.BOTTLER);
    registry.addRecipeCatalyst(new ItemStack(blocks.carpenter), ForestryRecipeCategoryUid.CARPENTER);
    registry.addRecipeCatalyst(new ItemStack(blocks.centrifuge), ForestryRecipeCategoryUid.CENTRIFUGE);
    registry.addRecipeCatalyst(new ItemStack(blocks.fabricator), ForestryRecipeCategoryUid.FABRICATOR);
    registry.addRecipeCatalyst(new ItemStack(blocks.fermenter), ForestryRecipeCategoryUid.FERMENTER);
    registry.addRecipeCatalyst(new ItemStack(blocks.moistener), ForestryRecipeCategoryUid.MOISTENER);
    registry.addRecipeCatalyst(new ItemStack(blocks.rainmaker), ForestryRecipeCategoryUid.RAINMAKER);
    registry.addRecipeCatalyst(new ItemStack(blocks.squeezer), ForestryRecipeCategoryUid.SQUEEZER);
    registry.addRecipeCatalyst(new ItemStack(blocks.still), ForestryRecipeCategoryUid.STILL);
    IRecipeTransferRegistry transferRegistry = registry.getRecipeTransferRegistry();
    transferRegistry.addRecipeTransferHandler(new CarpenterRecipeTransferHandler(), ForestryRecipeCategoryUid.CARPENTER);
    transferRegistry.addRecipeTransferHandler(new FabricatorRecipeTransferHandler(), ForestryRecipeCategoryUid.FABRICATOR);
    JeiUtil.addDescription(registry, blocks.raintank);
}
Also used : BlockRegistryFactory(forestry.factory.blocks.BlockRegistryFactory) ResourceLocation(net.minecraft.util.ResourceLocation) FabricatorRecipeTransferHandler(forestry.factory.recipes.jei.fabricator.FabricatorRecipeTransferHandler) ItemStack(net.minecraft.item.ItemStack) IRecipeTransferRegistry(mezz.jei.api.recipe.transfer.IRecipeTransferRegistry) CarpenterRecipeTransferHandler(forestry.factory.recipes.jei.carpenter.CarpenterRecipeTransferHandler)

Example 8 with IRecipeTransferRegistry

use of mezz.jei.api.recipe.transfer.IRecipeTransferRegistry in project RFTools by McJty.

the class RFToolsJeiPlugin method register.

@Override
public void register(@Nonnull IModRegistry registry) {
    IRecipeTransferRegistry transferRegistry = registry.getRecipeTransferRegistry();
    if (CrafterConfiguration.enabled)
        CrafterRecipeTransferHandler.register(transferRegistry);
    ModularStorageRecipeTransferHandler.register(transferRegistry);
    ModularStorageItemRecipeTransferHandler.register(transferRegistry);
    RemoteStorageItemRecipeTransferHandler.register(transferRegistry);
    StorageScannerRecipeTransferHandler.register(transferRegistry);
}
Also used : IRecipeTransferRegistry(mezz.jei.api.recipe.transfer.IRecipeTransferRegistry)

Example 9 with IRecipeTransferRegistry

use of mezz.jei.api.recipe.transfer.IRecipeTransferRegistry 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

IRecipeTransferRegistry (mezz.jei.api.recipe.transfer.IRecipeTransferRegistry)9 ItemStack (net.minecraft.item.ItemStack)6 ArrayList (java.util.ArrayList)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 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 PrivateCraftingTeachingTransferHandler (com.minecolonies.coremod.compatibility.jei.transer.PrivateCraftingTeachingTransferHandler)1 BlockRegistryFactory (forestry.factory.blocks.BlockRegistryFactory)1 CarpenterRecipeTransferHandler (forestry.factory.recipes.jei.carpenter.CarpenterRecipeTransferHandler)1 FabricatorRecipeTransferHandler (forestry.factory.recipes.jei.fabricator.FabricatorRecipeTransferHandler)1 BlockRegistryWorktable (forestry.worktable.blocks.BlockRegistryWorktable)1 Nullable (javax.annotation.Nullable)1 ImbuingRecipeWrapper (lumien.randomthings.handler.compability.jei.imbuing.ImbuingRecipeWrapper)1 AnvilRecipe (lumien.randomthings.recipes.anvil.AnvilRecipe)1 mezz.jei.api (mezz.jei.api)1 IGuiHelper (mezz.jei.api.IGuiHelper)1 IRecipeRegistry (mezz.jei.api.IRecipeRegistry)1 IAdvancedGuiHandler (mezz.jei.api.gui.IAdvancedGuiHandler)1 IRecipeWrapper (mezz.jei.api.recipe.IRecipeWrapper)1