Categories (Just Enough Items)
Description
Modify the Categories visible in JEI, each of which contain recipes and are associated with specific blocks, typically machines.
Note
Hidden Categories will still take up load time, and recipes contained within can still be processed. This only prevents seeing Categories.
Identifier
Refer to this via any of the following:
mods.hei.category
mods.hei.Category
mods.jei.category/* Used as page default */
mods.jei.Category
Adding Entries
Recipe Builder
Just like other recipe types, the Categories also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.jei.category.categoryBuilder()
String
. Sets the ID of the Category, which must be unique among all other Categories. Requires not empty.groovyid(String)
List<IRecipeWrapper>
. Sets theIRecipeWrapper
s used by the Category to generate entries.groovywrapper(IRecipeWrapper) wrapper(IRecipeWrapper...) wrapper(Collection<? extends IRecipeWrapper>)
List<Object>
. Sets the catalyst ingredients of the Category, which must belong to a class that has ingredient handling in JEI.groovycatalyst(Object) catalyst(Object...) catalyst(Collection<Object>)
Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>
. Sets the function used to generate the category. Must be a Function accepting a single input parameterIGuiHelper
and creating the class, which itself must extendIRecipeCategory
. Requires not null.groovycategory(Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>)
First validates the builder, returning
null
and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnull
orcom.cleanroommc.groovyscript.compat.mods.jei.Category$CustomCategory
).groovyregister()
Example
mods.jei.category.categoryBuilder()
.id(classes.GenericRecipeCategory.UID)/* Note that `classes.GenericRecipeCategory` must be defined elsewhere, and this example presumes certain fields and methods exist. */
.category(guiHelper -> new classes.GenericRecipeCategory(guiHelper))
.catalyst(item('minecraft:clay'))
.wrapper(classes.GenericRecipeCategory.getRecipeWrappers())
.register()
Removing Entries
Adds a new Category to JEI in the format
id
,category
,catalsyts
,wrappers
:groovymods.jei.category.add(Category.CustomCategory)
Adds a new Category to JEI in the format
id
,category
,catalsyts
,wrappers
:groovymods.jei.category.add(String, Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>, List<?>, List<? extends IRecipeWrapper>)
Hides the given category from JEI:
groovymods.jei.category.hideCategory(String)
Hides the given category from JEI:
groovymods.jei.category.remove(String)
Hides all categories from JEI:
groovymods.jei.category.hideAll()
Example
mods.jei.category.hideCategory('minecraft.fuel')
mods.jei.category.hideAll()