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

    Fields
    Modifier and Type
    Field
    Description
    protected mezz.jei.api.gui.drawable.IDrawable
     
    protected final List<Supplier<? extends net.minecraft.world.item.ItemStack>>
     
    protected final Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>>
     
    protected Predicate<com.simibubi.create.infrastructure.config.CRecipes>
     
    static mezz.jei.api.helpers.IJeiHelpers
     
    protected mezz.jei.api.gui.drawable.IDrawable
     
    protected final String
     
    protected final Class<? extends R>
     
    protected final List<Consumer<List<net.minecraft.world.item.crafting.RecipeHolder<R>>>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PetrolparkCategoryBuilder(String modid, Class<? extends R> recipeClass, Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>> categoryAdder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addRecipes(Supplier<Collection<? extends net.minecraft.world.item.crafting.RecipeHolder<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.
    addTypedRecipes(Supplier<net.minecraft.world.item.crafting.RecipeType<? extends R>> recipeType)
    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.RecipeHolder<R>> 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<?>>
    C
    addTypedRecipesIf(Supplier<net.minecraft.world.item.crafting.RecipeType<R2>> recipeType, Function<net.minecraft.world.item.crafting.RecipeHolder<?>,net.minecraft.world.item.crafting.RecipeHolder<R>> recipeTransformer, Predicate<net.minecraft.world.item.crafting.RecipeHolder<?>> 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>
    Builds this Category.
    catalyst(Supplier<net.minecraft.world.level.ItemLike> itemSupplier)
    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 void
    finalizeBuilding(mezz.jei.api.recipe.RecipeType<R> type, com.simibubi.create.compat.jei.category.CreateRecipeCategory<R> category, Class<? extends R> trueClass)
     
    itemIcon(Supplier<net.minecraft.world.item.ItemStack> item)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • helpers

      public static mezz.jei.api.helpers.IJeiHelpers helpers
    • modid

      protected final String modid
    • categoryAdder

      protected final Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>> categoryAdder
    • recipeClass

      protected final Class<? extends R extends net.minecraft.world.item.crafting.Recipe<?>> recipeClass
    • background

      protected mezz.jei.api.gui.drawable.IDrawable background
    • icon

      protected mezz.jei.api.gui.drawable.IDrawable icon
    • recipeListConsumers

      protected final List<Consumer<List<net.minecraft.world.item.crafting.RecipeHolder<R extends net.minecraft.world.item.crafting.Recipe<?>>>>> recipeListConsumers
    • catalysts

      protected final List<Supplier<? extends net.minecraft.world.item.ItemStack>> catalysts
    • createConfigPredicate

      protected Predicate<com.simibubi.create.infrastructure.config.CRecipes> createConfigPredicate
  • Constructor Details

    • PetrolparkCategoryBuilder

      public PetrolparkCategoryBuilder(String modid, Class<? extends R> recipeClass, Consumer<com.simibubi.create.compat.jei.category.CreateRecipeCategory<?>> categoryAdder)
  • Method Details

    • addRecipes

      public C addRecipes(Supplier<Collection<? extends net.minecraft.world.item.crafting.RecipeHolder<R>>> collection)
      Adds a List of Recipes to this Category.
      Parameters:
      collection - The List of Recipes
      Returns:
      This Category Builder
    • addTypedRecipes

      public C addTypedRecipes(com.simibubi.create.foundation.recipe.IRecipeTypeInfo recipeTypeEntry)
      Adds all Recipes of a given Recipe Type to this Category.
      Parameters:
      recipeTypeEntry - The Recipe Type
      Returns:
      This Category Builder
    • addTypedRecipes

      public C addTypedRecipes(Supplier<net.minecraft.world.item.crafting.RecipeType<? extends R>> recipeType)
      Adds all Recipes of a given Recipe Type to this Category
      Parameters:
      recipeType - 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.RecipeHolder<R>> pred)
      Adds all Recipes of a given Recipe Type to this Category, given that each recipe matches the given condition.
      Parameters:
      recipeType - The Recipe Type
      pred - 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<net.minecraft.world.item.crafting.RecipeHolder<?>,net.minecraft.world.item.crafting.RecipeHolder<R>> recipeTransformer, Predicate<net.minecraft.world.item.crafting.RecipeHolder<?>> 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 another
      pred - Whether to transform and then add a Recipe
      Returns:
      This Category Builder
    • catalysts

      public C catalysts(Collection<Supplier<net.minecraft.world.item.ItemStack>> catalystStackSuppliers)
      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

      public C catalyst(Supplier<net.minecraft.world.level.ItemLike> itemSupplier)
      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

      public C itemIcon(net.minecraft.world.level.ItemLike item)
      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

      public C itemIcon(Supplier<net.minecraft.world.item.ItemStack> item)
      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 Recipe
      smallItem - 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 Recipe
      smallItem - Typically this will be a way to differentiate this use from other uses of the same machine
      Returns:
      This Category Builder
    • emptyBackground

      public C emptyBackground(int width, int height)
      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

      protected void finalizeBuilding(mezz.jei.api.recipe.RecipeType<R> type, com.simibubi.create.compat.jei.category.CreateRecipeCategory<R> category, Class<? extends R> trueClass)