本文整理汇总了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;
}
示例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);
});
}
示例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);
});
}
示例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;
}
示例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;
}
示例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(),});
}