Search in sources :

Example 1 with MultiblockInfoRecipeWrapper

use of gregtech.integration.jei.multiblock.MultiblockInfoRecipeWrapper in project GregTech by GregTechCEu.

the class JEIOptional method getWorldSceneRenderer.

@Optional.Method(modid = "jei")
public static WorldSceneRenderer getWorldSceneRenderer(MultiblockControllerBase controllerBase) {
    IRecipeRegistry rr = GTJeiPlugin.jeiRuntime.getRecipeRegistry();
    IFocus<ItemStack> focus = rr.createFocus(IFocus.Mode.INPUT, controllerBase.getStackForm());
    return rr.getRecipeCategories(focus).stream().map(c -> (IRecipeCategory<IRecipeWrapper>) c).map(c -> rr.getRecipeWrappers(c, focus)).flatMap(List::stream).filter(MultiblockInfoRecipeWrapper.class::isInstance).findFirst().map(MultiblockInfoRecipeWrapper.class::cast).map(MultiblockInfoRecipeWrapper::getCurrentRenderer).orElse(null);
}
Also used : IFocus(mezz.jei.api.recipe.IFocus) ItemStack(net.minecraft.item.ItemStack) List(java.util.List) MultiblockControllerBase(gregtech.api.metatileentity.multiblock.MultiblockControllerBase) WorldSceneRenderer(gregtech.client.renderer.scene.WorldSceneRenderer) MultiblockInfoRecipeWrapper(gregtech.integration.jei.multiblock.MultiblockInfoRecipeWrapper) Optional(net.minecraftforge.fml.common.Optional) IRecipeRegistry(mezz.jei.api.IRecipeRegistry) IRecipeCategory(mezz.jei.api.recipe.IRecipeCategory) IRecipeWrapper(mezz.jei.api.recipe.IRecipeWrapper) IRecipeRegistry(mezz.jei.api.IRecipeRegistry) MultiblockInfoRecipeWrapper(gregtech.integration.jei.multiblock.MultiblockInfoRecipeWrapper) IRecipeCategory(mezz.jei.api.recipe.IRecipeCategory) ItemStack(net.minecraft.item.ItemStack)

Aggregations

MultiblockControllerBase (gregtech.api.metatileentity.multiblock.MultiblockControllerBase)1 WorldSceneRenderer (gregtech.client.renderer.scene.WorldSceneRenderer)1 MultiblockInfoRecipeWrapper (gregtech.integration.jei.multiblock.MultiblockInfoRecipeWrapper)1 List (java.util.List)1 IRecipeRegistry (mezz.jei.api.IRecipeRegistry)1 IFocus (mezz.jei.api.recipe.IFocus)1 IRecipeCategory (mezz.jei.api.recipe.IRecipeCategory)1 IRecipeWrapper (mezz.jei.api.recipe.IRecipeWrapper)1 ItemStack (net.minecraft.item.ItemStack)1 Optional (net.minecraftforge.fml.common.Optional)1