Class PetrolparkCategoryBuilder<R extends net.minecraft.world.item.crafting.Recipe<?>,C extends PetrolparkCategoryBuilder<R,C>>
java.lang.Object
com.petrolpark.compat.jei.category.builder.PetrolparkCategoryBuilder<R,C>
public class PetrolparkCategoryBuilder<R extends net.minecraft.world.item.crafting.Recipe<?>,C extends PetrolparkCategoryBuilder<R,C>>
extends Object
Used to generate JEI Categories for Petrolpark mods.
Basically all copied from the
Create source code.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected mezz.jei.api.gui.drawable.IDrawableprotected final Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>>protected Predicate<com.simibubi.create.infrastructure.config.CRecipes>static mezz.jei.api.helpers.IJeiHelpersprotected mezz.jei.api.gui.drawable.IDrawableprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionPetrolparkCategoryBuilder(String modid, Class<? extends R> recipeClass, Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>> categoryAdder) -
Method Summary
Modifier and TypeMethodDescriptionaddRecipes(Supplier<Collection<? extends R>> collection) Adds a List of Recipes to this Category.addTypedRecipes(com.simibubi.create.foundation.recipe.IRecipeTypeInfo recipeTypeEntry) Adds all Recipes of a given Recipe Type to this Category.addTypedRecipesIf(Supplier<net.minecraft.world.item.crafting.RecipeType<? extends R>> recipeType, Predicate<net.minecraft.world.item.crafting.Recipe<?>> pred) Adds all Recipes of a given Recipe Type to this Category, given that each recipe matches the given condition.<R2 extends net.minecraft.world.item.crafting.Recipe<?>>
CaddTypedRecipesIf(Supplier<net.minecraft.world.item.crafting.RecipeType<R2>> recipeType, Function<R2, ? extends R> recipeTransformer, Predicate<R2> pred) Transforms all Recipes of a given Type to the correct Recipe amd then adds them to this Category.com.simibubi.create.compat.jei.category.CreateRecipeCategory<R>build(String name, PetrolparkRecipeCategory.Factory<R> factory) Builds this Category.Adds a given Item as a Catalyst for all Recipes of this Category.catalysts(Collection<Supplier<net.minecraft.world.item.ItemStack>> catalystStackSuppliers) Adds a given collection of Item Stacks as catalysts for all Recipes of this Category.doubleItemIcon(Supplier<net.minecraft.world.item.ItemStack> bigItem, Supplier<net.minecraft.world.item.ItemStack> smallItem) Sets the given pair of Items as the icon for this Category.doubleItemIcon(net.minecraft.world.level.ItemLike bigItem, net.minecraft.world.level.ItemLike smallItem) Sets the given pair of Items as the icon for this Category.emptyBackground(int width, int height) Sets the size of the Background for this Category.enableIfCreateConfig(Function<com.simibubi.create.infrastructure.config.CRecipes, net.createmod.catnip.config.ConfigBase.ConfigBool> configValue) Only enable this Recipe Category if the given test of Create's config options are true.protected voidfinalizeBuilding(mezz.jei.api.recipe.RecipeType<R> type, com.simibubi.create.compat.jei.category.CreateRecipeCategory<R> category, Class<? extends R> trueClass) Sets the given Item as the icon for this Category.itemIcon(net.minecraft.world.level.ItemLike item) Sets the given Item as the icon for this Category.
-
Field Details
-
helpers
public static mezz.jei.api.helpers.IJeiHelpers helpers -
modid
-
categoryAdder
protected final Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>> categoryAdder -
recipeClass
-
background
protected mezz.jei.api.gui.drawable.IDrawable background -
icon
protected mezz.jei.api.gui.drawable.IDrawable icon -
recipeListConsumers
-
catalysts
-
createConfigPredicate
-
-
Constructor Details
-
PetrolparkCategoryBuilder
-
-
Method Details
-
addRecipes
Adds a List of Recipes to this Category.- Parameters:
collection- The List of Recipes- Returns:
- This Category Builder
-
addTypedRecipes
Adds all Recipes of a given Recipe Type to this Category.- Parameters:
recipeTypeEntry- The Recipe Type- Returns:
- This Category Builder
-
addTypedRecipesIf
public C addTypedRecipesIf(Supplier<net.minecraft.world.item.crafting.RecipeType<? extends R>> recipeType, Predicate<net.minecraft.world.item.crafting.Recipe<?>> pred) Adds all Recipes of a given Recipe Type to this Category, given that each recipe matches the given condition.- Parameters:
recipeType- The Recipe Typepred- The Condition a Recipe must match to be added- Returns:
- This Category Builder
-
addTypedRecipesIf
public <R2 extends net.minecraft.world.item.crafting.Recipe<?>> C addTypedRecipesIf(Supplier<net.minecraft.world.item.crafting.RecipeType<R2>> recipeType, Function<R2, ? extends R> recipeTransformer, Predicate<R2> pred) Transforms all Recipes of a given Type to the correct Recipe amd then adds them to this Category.- Parameters:
recipeType-recipeTransformer- Turns a Recipe into anotherpred- Whether to transform and then add a Recipe- Returns:
- This Category Builder
-
catalysts
Adds a given collection of Item Stacks as catalysts for all Recipes of this Category.- Parameters:
catalystStackSuppliers- A collection of suppliers of catalyst Item Stacks- Returns:
- This Category Builder
-
catalyst
Adds a given Item as a Catalyst for all Recipes of this Category. Useful for adding the required machines for a Category of Recipe.- Parameters:
itemSupplier- A Supplier of the catalyst Item- Returns:
- This Category Builder
-
itemIcon
Sets the given Item as the icon for this Category.- Parameters:
item- Typically this will be the machine required for this Type of Recipe- Returns:
- This Category Builder
-
itemIcon
Sets the given Item as the icon for this Category.- Parameters:
item- Typically this will be the machine required for this Type of Recipe- Returns:
- This Category Builder
-
doubleItemIcon
public C doubleItemIcon(net.minecraft.world.level.ItemLike bigItem, net.minecraft.world.level.ItemLike smallItem) Sets the given pair of Items as the icon for this Category.- Parameters:
bigItem- Typically this will be the machine required for this Type of RecipesmallItem- Typically this will be a way to differentiate this use from other uses of the same machine- Returns:
- This Category Builder
-
doubleItemIcon
public C doubleItemIcon(Supplier<net.minecraft.world.item.ItemStack> bigItem, Supplier<net.minecraft.world.item.ItemStack> smallItem) Sets the given pair of Items as the icon for this Category.- Parameters:
bigItem- Typically this will be the machine required for this Type of RecipesmallItem- Typically this will be a way to differentiate this use from other uses of the same machine- Returns:
- This Category Builder
-
emptyBackground
Sets the size of the Background for this Category.- Parameters:
width-height-- Returns:
- This Category Builder
-
enableIfCreateConfig
public C enableIfCreateConfig(Function<com.simibubi.create.infrastructure.config.CRecipes, net.createmod.catnip.config.ConfigBase.ConfigBool> configValue) Only enable this Recipe Category if the given test of Create's config options are true.- Returns:
- This Category Builder
-
build
public com.simibubi.create.compat.jei.category.CreateRecipeCategory<R> build(String name, PetrolparkRecipeCategory.Factory<R> factory) Builds this Category.- Parameters:
name- The Resource Location (e.g. for use in language file)factory- Initializer of the Category class- Returns:
- This Category
-
finalizeBuilding
-