当前位置: 首页>>代码示例>>Java>>正文


Java IRecipeCategory类代码示例

本文整理汇总了Java中mezz.jei.api.recipe.IRecipeCategory的典型用法代码示例。如果您正苦于以下问题:Java IRecipeCategory类的具体用法?Java IRecipeCategory怎么用?Java IRecipeCategory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IRecipeCategory类属于mezz.jei.api.recipe包,在下文中一共展示了IRecipeCategory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CraftingControl

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
public <T extends IRecipeWrapper> CraftingControl(IRecipeCategory<T> category, T wrapper, ResourceLocation border, int borderSize)
{
    super(border, 2);
    this.title = category.getTitle();
    off = DrawingTools.getStringHeight(title) + 2;
    IRecipeRegistry reg = PMJeiPlugin.RUNTIME.getRecipeRegistry();
    IRecipeLayoutDrawable draw = reg.createRecipeLayoutDrawable(category, wrapper, reg.createFocus(IFocus.Mode.OUTPUT, new ItemStack(Items.STICK /*hack*/)));
    setWidth(category.getBackground().getWidth() + size * 2);
    setHeight(category.getBackground().getHeight() + size * 2);
    draw.setPosition(size, size);
    this.draw = draw;
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:13,代码来源:CraftingControl.java

示例2: fromCrafting

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
public static <T extends ICraftingRecipeWrapper> Supplied<CraftingControl> fromCrafting(String category, ResourceLocation id, ResourceLocation border, int borderSize)
{
    return new Supplied<>(() ->
    {
        IRecipeCategory cat = PMJeiPlugin.RUNTIME.getRecipeRegistry().getRecipeCategory(category);
        List<T> lst = PMJeiPlugin.RUNTIME.getRecipeRegistry().getRecipeWrappers(cat);
        T rec = null;
        for (T wr : lst)
        {
            if (wr.getRegistryName().equals(id))
            {
                rec = wr;
                break;
            }
        }
        return new CraftingControl(cat, rec, border, borderSize);
    });
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:19,代码来源:CraftingControl.java

示例3: fromSmelting

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
public static <T extends IRecipeWrapper> Supplied<CraftingControl> fromSmelting(ItemStack input)
{
    return new Supplied<>(() ->
    {
        IRecipeCategory cat = PMJeiPlugin.RUNTIME.getRecipeRegistry().getRecipeCategory(VanillaRecipeCategoryUid.SMELTING);
        List<T> lst = PMJeiPlugin.RUNTIME.getRecipeRegistry().getRecipeWrappers(cat);
        T rec = null;
        try
        {
            IIngredients holder = INGREDIENTS.newInstance();
            recipeLoop:
            for (T wr : lst)
            {
                wr.getIngredients(holder);
                List<List<ItemStack>> inp = holder.getInputs(ItemStack.class);
                if (inp.size() > 0)
                {
                    List<ItemStack> i = inp.get(0);
                    for (ItemStack is : i)
                    {
                        if (ItemStack.areItemStacksEqual(is, input))
                        {
                            rec = wr;
                            break recipeLoop;
                        }
                    }
                }
            }
        }
        catch (InstantiationException | IllegalAccessException e)
        {
            throw new ReportedException(CrashReport.makeCrashReport(e, "Something went wrong when creating furnace recipe renderer"));
        }
        return new CraftingControl(cat, rec, BORDER_VANILLA, BORDER_VANILLA_SIZE);
    });
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:37,代码来源:CraftingControl.java

示例4: getDrawableFromItem

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
public static IRecipeLayoutDrawable getDrawableFromItem(ItemStack stack) {
	if (stack != null) {
		IRecipeRegistry registry = JEIRefractionPlugin.jeiRuntime.getRecipeRegistry();
		IFocus<ItemStack> focus = registry.createFocus(IFocus.Mode.OUTPUT, stack);
		for (IRecipeCategory<?> category : registry.getRecipeCategories(focus)) {
			if (category.getUid().equals(Constants.MOD_ID + ".assembly_table")
					|| category.getUid().equals(VanillaRecipeCategoryUid.CRAFTING)) {
				List<IRecipeLayoutDrawable> layouts = getLayouts(registry, category, focus);
				if (!layouts.isEmpty())
					return layouts.get(0);
			}
		}
	}
	return null;
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:16,代码来源:JEIRefractionPlugin.java

示例5: getLayouts

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
private static <T extends IRecipeWrapper> List<IRecipeLayoutDrawable> getLayouts(IRecipeRegistry registry, IRecipeCategory<T> category, IFocus<ItemStack> focus) {
	List<IRecipeLayoutDrawable> layouts = new ArrayList<>();
	List<T> wrappers = registry.getRecipeWrappers(category, focus);
	for (T wrapper : wrappers) {
		IRecipeLayoutDrawable layout = registry.createRecipeLayoutDrawable(category, wrapper, focus);
		layouts.add(layout);
	}
	return layouts;
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:10,代码来源:JEIRefractionPlugin.java

示例6: registerCategories

import mezz.jei.api.recipe.IRecipeCategory; //导入依赖的package包/类
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {
	jeiHelper = registry.getJeiHelpers();
	registry.addRecipeCategories(new IRecipeCategory[]{new CustomCraftingRecipeCategory(), new CrusherRecipeCategory(), new WireMillRecipeCategory(), new PlateBlenderRecipeCategory(), new AlloySmelterRecipeCategory(), new BlastFurnaceRecipeCategory(), new CoilerRecipeCategory(), mixerRecipeCategory = new MixerRecipeCategory(), new PlasticRecipeCategory(), new RubberBoilerRecipeCategory(), new RubberProcessorRecipeCategory(),});
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:JEIHandler.java


注:本文中的mezz.jei.api.recipe.IRecipeCategory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。