Java Code Examples for mezz.jei.api.IModRegistry#addRecipes()

The following examples show how to use mezz.jei.api.IModRegistry#addRecipes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiblockInfoCategory.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void registerRecipes(IModRegistry registry) {
    registry.addRecipes(Lists.newArrayList(
        new MultiblockInfoRecipeWrapper(new PrimitiveBlastFurnaceInfo()),
        new MultiblockInfoRecipeWrapper(new CokeOvenInfo()),
        new MultiblockInfoRecipeWrapper(new VacuumFreezerInfo()),
        new MultiblockInfoRecipeWrapper(new ImplosionCompressorInfo()),
        new MultiblockInfoRecipeWrapper(new PyrolyzeOvenInfo()),
        new MultiblockInfoRecipeWrapper(new CrackerUnitInfo()),
        new MultiblockInfoRecipeWrapper(new DieselEngineInfo()),
        new MultiblockInfoRecipeWrapper(new DistillationTowerInfo()),
        new MultiblockInfoRecipeWrapper(new ElectricBlastFurnaceInfo()),
        new MultiblockInfoRecipeWrapper(new MultiSmelterInfo()),
        new MultiblockInfoRecipeWrapper(new LargeBoilerInfo(MetaTileEntities.LARGE_BRONZE_BOILER)),
        new MultiblockInfoRecipeWrapper(new LargeBoilerInfo(MetaTileEntities.LARGE_STEEL_BOILER)),
        new MultiblockInfoRecipeWrapper(new LargeBoilerInfo(MetaTileEntities.LARGE_TITANIUM_BOILER)),
        new MultiblockInfoRecipeWrapper(new LargeBoilerInfo(MetaTileEntities.LARGE_TUNGSTENSTEEL_BOILER)),
        new MultiblockInfoRecipeWrapper(new LargeTurbineInfo(MetaTileEntities.LARGE_STEAM_TURBINE)),
        new MultiblockInfoRecipeWrapper(new LargeTurbineInfo(MetaTileEntities.LARGE_GAS_TURBINE)),
        new MultiblockInfoRecipeWrapper(new LargeTurbineInfo(MetaTileEntities.LARGE_PLASMA_TURBINE))
    ), "gregtech:multiblock_info");
}
 
Example 2
Source File: JEICompat.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
	
	registry.addRecipes(CrusherRecipeMaker.getRecipes(jeiHelpers),"tofucraft.crusher");
	registry.addRecipes(CompressorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.compressor");
	registry.addRecipes(AggregatorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.aggregator");
	registry.addRecipes(AdvancedAggregatorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.advanced_aggregator");

	registry.addRecipeClickArea(GuiTFCrasher.class, 68,15, 28, 17,"tofucraft.crusher");
	registry.addRecipeClickArea(GuiTFCompressor.class, 68,15, 28, 17,"tofucraft.compressor");
	registry.addRecipeClickArea(GuiTFAggreagator.class, 73,31, 30, 20,"tofucraft.aggregator");
	registry.addRecipeClickArea(GuiTFAdvancedAggreagator.class, 80,27, 30, 20,"tofucraft.advanced_aggregator");
	registry.addRecipeClickArea(GuiTFOven.class, 68,15, 28, 17,VanillaRecipeCategoryUid.SMELTING);

	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFCrasher.class,"tofucraft.crusher", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFCompressor.class,"tofucraft.compressor", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFAggregator.class,"tofucraft.aggregator", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFAdvancedAggregator.class,"tofucraft.advanced_aggregator", 0, 4, 5, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFOven.class,VanillaRecipeCategoryUid.SMELTING, 0, 1, 2, 36);
	
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFCRASHER),"tofucraft.crusher");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFCOMPRESSOR),"tofucraft.compressor");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFAGGREGATOR),"tofucraft.aggregator");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFAdvancedAGGREGATOR),"tofucraft.advanced_aggregator");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFOVEN),VanillaRecipeCategoryUid.SMELTING);
}
 
Example 3
Source File: JEICompat.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
	
	registry.addRecipes(PotRecipeMaker.getRecipes(jeiHelpers),"sakura.cooking_pot");
	registry.addRecipes(MortarRecipeMaker.getRecipes(jeiHelpers),"sakura.mortar");
	registry.addRecipes(BarrelRecipeMaker.getRecipes(jeiHelpers),"sakura.barrel");
	registry.addRecipes(DistillationRecipeMaker.getRecipes(jeiHelpers),"sakura.distillation");
	registry.addRecipes(L2ISRecipeMaker.getRecipes(jeiHelpers),"sakura.liquid_item");

	registry.addRecipeClickArea(GuiCampfirePot.class, 91, 41, 28, 23,"sakura.cooking_pot");
	registry.addRecipeClickArea(GuiStoneMortar.class, 77, 32, 28, 23,"sakura.mortar");
	registry.addRecipeClickArea(GuiBarrel.class, 62, 33, 24, 21,"sakura.barrel");
	registry.addRecipeClickArea(GuiDistillation.class, 62, 33, 24, 21,"sakura.distillation");
	registry.addRecipeClickArea(GuiBarrel.class, 130, 29, 18, 21,"sakura.liquid_item");
	registry.addRecipeClickArea(GuiDistillation.class, 130, 29, 18, 21,"sakura.liquid_item");
	
	recipeTransferRegistry.addRecipeTransferHandler(ContainerCampfirePot.class,"sakura.cooking_pot", 0, 9, 10, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerStoneMortar.class,"sakura.mortar", 0, 4, 6, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerBarrel.class,"sakura.barrel", 0, 3, 5, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerDistillation.class,"sakura.distillation", 0, 3, 5, 36);

	registry.addRecipeCatalyst(new ItemStack(ItemLoader.POT),"sakura.cooking_pot");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.STONEMORTAR),"sakura.mortar");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.BARREL),"sakura.barrel");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.BARREL_DISTILLATION),"sakura.distillation");
	
}
 
Example 4
Source File: GTJeiPlugin.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void wrapperUtil(@Nonnull IModRegistry registry, GTRecipeMultiInputList list, Block catalyst,
		Class gui, int clickX, int clickY, int sizeX, int sizeY) {
	String recipeList = list.getCategory();
	registry.handleRecipes(GTRecipeMultiInputList.MultiRecipe.class, GTJeiMultiRecipeWrapper::new, recipeList);
	registry.addRecipes(list.getRecipeList(), recipeList);
	registry.addRecipeCatalyst(new ItemStack(catalyst), recipeList);
	if (gui != null) {
		registry.addRecipeClickArea(gui, clickX, clickY, sizeX, sizeY, recipeList);
	}
}
 
Example 5
Source File: WizardryJEIPlugin.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {
	registry.addRecipes(FireRecipes.RECIPES.entrySet().stream()
					.map(FireRecipeJEI::new).collect(Collectors.toList()),
			fireCategory.getUid());

	registry.addRecipes(ManaRecipes.RECIPE_REGISTRY.values().stream()
					.filter(recipe -> !recipe.getOutput().isEmpty() || recipe.getFluidOutput() != null)
					.map(FluidRecipeJEI::new).collect(Collectors.toList()),
			manaCategory.getUid());

	registry.addRecipeCatalyst(new ItemStack(Items.FIRE_CHARGE), fireCategory.getUid());
	registry.addRecipeCatalyst(new ItemStack(ModItems.ORB, 1, 1), manaCategory.getUid());
}
 
Example 6
Source File: BaseMetalsJEIPlugin.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {

	IItemRegistry itemRegistry = registry.getItemRegistry();
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
	
	registry.addRecipeCategories(new JEICrusherRecipeCategory(guiHelper));
	registry.addRecipeHandlers(new CrusherRecipeHandler());
	
	registry.addRecipes(CrusherRecipeRegistry.getInstance().getAllRecipes().stream()
			.map((ICrusherRecipe in)->new CrusherRecipeJEI(Arrays.asList(in.getValidInputs().toArray(new ItemStack[0])), in.getOutput()))
			.collect(Collectors.toList()));
}
 
Example 7
Source File: JEIIntegration.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public void register(IModRegistry registry) {
    EmergingTechnology.logger.info("Registering with JEI...");

    helpers = registry.getJeiHelpers();

    registry.handleRecipes(SimpleRecipe.class, ProcessorRecipeWrapper::new, MachineReference.PROCESSOR_UID);
    registry.addRecipes(ProcessorRecipes.getRecipes(), MachineReference.PROCESSOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.processor), MachineReference.PROCESSOR_UID);
    registry.addRecipeClickArea(ProcessorGui.class, 39, 38, 34, 10, MachineReference.PROCESSOR_UID);

    registry.handleRecipes(SimpleRecipe.class, ShredderRecipeWrapper::new, MachineReference.SHREDDER_UID);
    registry.addRecipes(ShredderRecipes.getRecipes(), MachineReference.SHREDDER_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.shredder), MachineReference.SHREDDER_UID);
    registry.addRecipeClickArea(ShredderGui.class, 39, 38, 34, 10, MachineReference.SHREDDER_UID);

    registry.handleRecipes(SimpleRecipe.class, CookerRecipeWrapper::new, MachineReference.COOKER_UID);
    registry.addRecipes(CookerRecipes.getRecipes(), MachineReference.COOKER_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.cooker), MachineReference.COOKER_UID);
    registry.addRecipeClickArea(CookerGui.class, 39, 38, 34, 10, MachineReference.COOKER_UID);

    registry.handleRecipes(FabricatorRecipe.class, FabricatorRecipeWrapper::new, MachineReference.FABRICATOR_UID);
    registry.addRecipes(FabricatorRecipes.getRecipes(), MachineReference.FABRICATOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.fabricator), MachineReference.FABRICATOR_UID);
    registry.addRecipeClickArea(FabricatorGui.class, 39, 38, 34, 10, MachineReference.FABRICATOR_UID);

    registry.handleRecipes(SimpleRecipe.class, BioreactorRecipeWrapper::new, MachineReference.BIOREACTOR_UID);
    registry.addRecipes(BioreactorRecipes.getRecipes(), MachineReference.BIOREACTOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.bioreactor), MachineReference.BIOREACTOR_UID);
    registry.addRecipeClickArea(BioreactorGui.class, 39, 38, 34, 10, MachineReference.BIOREACTOR_UID);

    registry.handleRecipes(SimpleRecipe.class, ScaffolderRecipeWrapper::new, MachineReference.SCAFFOLDER_UID);
    registry.addRecipes(ScaffolderRecipes.getRecipes(), MachineReference.SCAFFOLDER_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.scaffolder), MachineReference.SCAFFOLDER_UID);
    registry.addRecipeClickArea(ScaffolderGui.class, 39, 38, 34, 10, MachineReference.SCAFFOLDER_UID);

    registry.handleRecipes(SimpleRecipe.class, CollectorRecipeWrapper::new, MachineReference.COLLECTOR_UID);
    registry.addRecipes(CollectorRecipes.getRecipes(), MachineReference.COLLECTOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.collector), MachineReference.COLLECTOR_UID);
    registry.addRecipeClickArea(CollectorGui.class, 39, 38, 34, 10, MachineReference.COLLECTOR_UID);

    registry.handleRecipes(SimpleRecipe.class, BiomassRecipeWrapper::new, MachineReference.BIOMASS_UID);
    registry.addRecipes(BiomassRecipes.getRecipes(), MachineReference.BIOMASS_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.biomassgenerator), MachineReference.BIOMASS_UID);
    registry.addRecipeClickArea(BiomassGeneratorGui.class, 39, 38, 34, 10, MachineReference.BIOMASS_UID);

    registry.handleRecipes(SimpleRecipe.class, ScrubberRecipeWrapper::new, MachineReference.SCRUBBER_UID);
    registry.addRecipes(ScrubberRecipes.getRecipes(), MachineReference.SCRUBBER_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.scrubber), MachineReference.SCRUBBER_UID);
    registry.addRecipeClickArea(ScrubberGui.class, 39, 38, 34, 10, MachineReference.SCRUBBER_UID);

    registry.handleRecipes(SimpleRecipe.class, AlgaeBioreactorRecipeWrapper::new,
            MachineReference.ALGAEBIOREACTOR_UID);
    registry.addRecipes(AlgaeBioreactorRecipes.getRecipes(), MachineReference.ALGAEBIOREACTOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.algaebioreactor), MachineReference.ALGAEBIOREACTOR_UID);
    registry.addRecipeClickArea(AlgaeBioreactorGui.class, 39, 38, 34, 10, MachineReference.ALGAEBIOREACTOR_UID);

    registry.handleRecipes(SimpleRecipe.class, InjectorRecipeWrapper::new, MachineReference.INJECTOR_UID);
    registry.addRecipes(InjectorRecipes.getRecipes(), MachineReference.INJECTOR_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.injector), MachineReference.INJECTOR_UID);
    registry.addRecipeClickArea(InjectorGui.class, 39, 38, 34, 10, MachineReference.INJECTOR_UID);

    registry.handleRecipes(SimpleRecipe.class, HydroponicRecipeWrapper::new, MachineReference.HYDROPONIC_UID);
    registry.addRecipes(HydroponicRecipes.getRecipes(), MachineReference.HYDROPONIC_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.hydroponic), MachineReference.HYDROPONIC_UID);
    registry.addRecipeClickArea(HydroponicGui.class, 39, 38, 34, 10, MachineReference.HYDROPONIC_UID);

    registry.handleRecipes(SimpleRecipe.class, LightRecipeWrapper::new, MachineReference.LIGHT_UID);
    registry.addRecipes(LightRecipes.getRecipes(), MachineReference.LIGHT_UID);
    registry.addRecipeCatalyst(new ItemStack(ModBlocks.light), MachineReference.LIGHT_UID);
    registry.addRecipeClickArea(LightGui.class, 39, 38, 34, 10, MachineReference.LIGHT_UID);

    EmergingTechnology.logger.info("Successfully registered with JEI.");
}
 
Example 8
Source File: GTJeiPlugin.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void register(@Nonnull IModRegistry registry) {
	if (SubModul.load) {
		for (GTJeiEntry entry : GTJeiHandler.getRegistry()) {
			wrapperUtil(registry, entry.getRecipeList(), entry.getCatalyst(), entry.getGuiClass(), entry.getClickX(), entry.getClickY(), entry.getSizeX(), entry.getSizeY());
		}
		// More Vanilla Crafting
		IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
		recipeTransferRegistry.addRecipeTransferHandler(GTContainerWorktable.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 58);
		registry.addRecipeCatalyst(new ItemStack(GTBlocks.tileWorktable), new String[] { "minecraft.crafting" });
		registry.addRecipeCatalyst(new ItemStack(GTBlocks.tileAutocrafter), new String[] { "minecraft.crafting" });
		// Amplifier
		registry.handleRecipes(MultiRecipe.class, GTJeiUUAmplifierWrapper::new, "gt.uuamplifier");
		registry.addRecipes(GTTileMatterFabricator.RECIPE_LIST.getRecipeList(), "gt.uuamplifier");
		registry.addRecipeCatalyst(new ItemStack(GTBlocks.tileFabricator), "gt.uuamplifier");
		registry.addRecipeClickArea(GTMatterFabricatorGui.class, 105, 34, 62, 22, "gt.uuamplifier");
		// Magic Fuel
		registry.handleRecipes(MultiRecipe.class, GTJeiMagicFuelWrapper::new, "gt.magicfuels");
		registry.addRecipes(GTTileMagicEnergyConverter.RECIPE_LIST.getRecipeList(), "gt.magicfuels");
		registry.addRecipeCatalyst(new ItemStack(GTBlocks.tileMagicEnergyConverter), "gt.magicfuels");
		registry.addRecipeClickArea(GTMagicEnergyConverterGui.class, 78, 35, 16, 17, "gt.magicfuels");
		// Mortar
		registry.handleRecipes(GTRecipeMultiInputList.MultiRecipe.class, GTJeiMortarWrapper::new, "gt.mortar");
		registry.addRecipes(GTBlockMortar.RECIPE_LIST.getRecipeList(), "gt.mortar");
		registry.addRecipeCatalyst(GTMaterialGen.get(GTBlocks.flintMortar), "gt.mortar");
		registry.addRecipeCatalyst(GTMaterialGen.get(GTBlocks.ironMortar), "gt.mortar");
		// Blacklist
		IIngredientBlacklist blacklist = registry.getJeiHelpers().getIngredientBlacklist();
		blacklist.addIngredientToBlacklist(GTMaterialGen.get(GTBlocks.lightSource));
		blacklist.addIngredientToBlacklist(GTMaterialGen.get(GTItems.orbDataStorage));
		if (Loader.isModLoaded(GTValues.MOD_ID_GTCX)){
			blacklist.addIngredientToBlacklist(GTMaterialGen.get(GTBlocks.tileFusionReactor));
		}
		if (GTConfig.general.hideBedrockOresInJei) {
			for (Block block : GTBedrockOreHandler.getBedrockOreMap().keySet()) {
				if (GTBedrockOreHandler.shouldGTCHandleGeneration(block)) {
					blacklist.addIngredientToBlacklist(new ItemStack(block));
				}
			}
		}
	}
}