public class RecipeRegistry extends java.lang.Object implements IRecipeRegistry
Constructor and Description |
---|
RecipeRegistry(java.util.List<IRecipeCategory> recipeCategories,
java.util.List<IRecipeHandler> recipeHandlers,
com.google.common.collect.ImmutableTable<java.lang.Class,java.lang.String,IRecipeTransferHandler> recipeTransferHandlers,
java.util.List<java.lang.Object> recipes,
com.google.common.collect.Multimap<java.lang.Class<? extends net.minecraft.client.gui.inventory.GuiContainer>,RecipeClickableArea> recipeClickableAreasMap,
com.google.common.collect.Multimap<java.lang.String,net.minecraft.item.ItemStack> craftItemsForCategories,
IIngredientRegistry ingredientRegistry,
java.util.List<IRecipeRegistryPlugin> plugins) |
Modifier and Type | Method and Description |
---|---|
void |
addRecipe(java.lang.Object recipe)
Add a new recipe while the game is running.
|
void |
addSmeltingRecipe(java.util.List<net.minecraft.item.ItemStack> inputs,
net.minecraft.item.ItemStack output)
Add a new smelting recipe while the game is running.
|
<V> IFocus<V> |
createFocus(IFocus.Mode mode,
V ingredient)
Returns a new focus.
|
<T extends IRecipeWrapper> |
createRecipeLayoutDrawable(IRecipeCategory<T> recipeCategory,
T recipeWrapper,
IFocus focus)
Returns a drawable recipe layout, for addons that want to draw the layouts somewhere.
|
com.google.common.collect.ImmutableCollection<RecipeClickableArea> |
getAllRecipeClickableAreas(net.minecraft.client.gui.inventory.GuiContainer gui) |
java.util.List<net.minecraft.item.ItemStack> |
getCraftingItems(IRecipeCategory recipeCategory)
Returns an unmodifiable collection of ItemStacks that can craft the recipes from recipeCategory.
|
java.util.List<net.minecraft.item.ItemStack> |
getCraftingItems(IRecipeCategory recipeCategory,
IFocus focus)
Returns an unmodifiable collection of ItemStacks that can craft the recipes from recipeCategory.
|
Ingredients |
getIngredients(IRecipeWrapper recipeWrapper) |
java.util.List<IRecipeCategory> |
getRecipeCategories()
Returns an unmodifiable list of all Recipe Categories
|
<V> java.util.List<IRecipeCategory> |
getRecipeCategories(IFocus<V> focus)
Returns a list of Recipe Categories for the focus.
|
com.google.common.collect.ImmutableList<IRecipeCategory> |
getRecipeCategories(java.util.List<java.lang.String> recipeCategoryUids)
Returns an unmodifiable list of Recipe Categories
|
RecipeClickableArea |
getRecipeClickableArea(net.minecraft.client.gui.inventory.GuiContainer gui,
int mouseX,
int mouseY) |
<T> IRecipeHandler<T> |
getRecipeHandler(java.lang.Class<? extends T> recipeClass)
Returns the IRecipeHandler associated with the recipeClass or null if there is none
|
IRecipeTransferHandler |
getRecipeTransferHandler(net.minecraft.inventory.Container container,
IRecipeCategory recipeCategory)
Returns the recipe transfer handler for the given container and category, if one exists.
|
<T extends IRecipeWrapper> |
getRecipeWrappers(IRecipeCategory<T> recipeCategory)
Returns a list of Recipe Wrappers in recipeCategory.
|
<T extends IRecipeWrapper,V> |
getRecipeWrappers(IRecipeCategory<T> recipeCategory,
IFocus<V> focus)
Returns a list of Recipe Wrappers in the recipeCategory that have the focus.
|
void |
removeRecipe(java.lang.Object recipe)
Remove a recipe while the game is running.
|
public RecipeRegistry(java.util.List<IRecipeCategory> recipeCategories, java.util.List<IRecipeHandler> recipeHandlers, com.google.common.collect.ImmutableTable<java.lang.Class,java.lang.String,IRecipeTransferHandler> recipeTransferHandlers, java.util.List<java.lang.Object> recipes, com.google.common.collect.Multimap<java.lang.Class<? extends net.minecraft.client.gui.inventory.GuiContainer>,RecipeClickableArea> recipeClickableAreasMap, com.google.common.collect.Multimap<java.lang.String,net.minecraft.item.ItemStack> craftItemsForCategories, IIngredientRegistry ingredientRegistry, java.util.List<IRecipeRegistryPlugin> plugins)
public <V> IFocus<V> createFocus(IFocus.Mode mode, V ingredient)
IRecipeRegistry
createFocus
in interface IRecipeRegistry
public void addRecipe(java.lang.Object recipe)
IRecipeRegistry
IRecipeHandler.isRecipeValid(Object)
to determine which recipes are hidden, and when a recipe becomes valid you can add it here.
(note that IRecipeHandler.isRecipeValid(Object)
must be true when the recipe is added here for it to work)addRecipe
in interface IRecipeRegistry
public Ingredients getIngredients(IRecipeWrapper recipeWrapper)
public void removeRecipe(java.lang.Object recipe)
IRecipeRegistry
removeRecipe
in interface IRecipeRegistry
public void addSmeltingRecipe(java.util.List<net.minecraft.item.ItemStack> inputs, net.minecraft.item.ItemStack output)
IRecipeRegistry
FurnaceRecipes.smeltingList
are already added by JEI.addSmeltingRecipe
in interface IRecipeRegistry
public java.util.List<IRecipeCategory> getRecipeCategories()
IRecipeRegistry
getRecipeCategories
in interface IRecipeRegistry
public com.google.common.collect.ImmutableList<IRecipeCategory> getRecipeCategories(java.util.List<java.lang.String> recipeCategoryUids)
IRecipeRegistry
getRecipeCategories
in interface IRecipeRegistry
@Nullable public <T> IRecipeHandler<T> getRecipeHandler(java.lang.Class<? extends T> recipeClass)
IRecipeRegistry
getRecipeHandler
in interface IRecipeRegistry
@Nullable public RecipeClickableArea getRecipeClickableArea(net.minecraft.client.gui.inventory.GuiContainer gui, int mouseX, int mouseY)
public com.google.common.collect.ImmutableCollection<RecipeClickableArea> getAllRecipeClickableAreas(net.minecraft.client.gui.inventory.GuiContainer gui)
public <V> java.util.List<IRecipeCategory> getRecipeCategories(IFocus<V> focus)
IRecipeRegistry
getRecipeCategories
in interface IRecipeRegistry
public <T extends IRecipeWrapper,V> java.util.List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory, IFocus<V> focus)
IRecipeRegistry
getRecipeWrappers
in interface IRecipeRegistry
public <T extends IRecipeWrapper> java.util.List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory)
IRecipeRegistry
getRecipeWrappers
in interface IRecipeRegistry
public java.util.List<net.minecraft.item.ItemStack> getCraftingItems(IRecipeCategory recipeCategory, @Nullable IFocus focus)
IRecipeRegistry
IModRegistry.addRecipeCategoryCraftingItem(ItemStack, String...)
.
This takes the current focus into account, so that if the focus mode is set to Input and the focus is included in the craftingItems, it is the only one returned.
getCraftingItems
in interface IRecipeRegistry
public java.util.List<net.minecraft.item.ItemStack> getCraftingItems(IRecipeCategory recipeCategory)
IRecipeRegistry
IModRegistry.addRecipeCategoryCraftingItem(ItemStack, String...)
.getCraftingItems
in interface IRecipeRegistry
@Nullable public IRecipeTransferHandler getRecipeTransferHandler(net.minecraft.inventory.Container container, IRecipeCategory recipeCategory)
IRecipeRegistry
getRecipeTransferHandler
in interface IRecipeRegistry
container
- The container to transfer items in.recipeCategory
- The type of recipe that the recipe transfer handler acts on.IRecipeTransferRegistry
public <T extends IRecipeWrapper> IRecipeLayoutDrawable createRecipeLayoutDrawable(IRecipeCategory<T> recipeCategory, T recipeWrapper, IFocus focus)
IRecipeRegistry
createRecipeLayoutDrawable
in interface IRecipeRegistry
recipeCategory
- the recipe category that the recipe belongs torecipeWrapper
- the specific recipe wrapper to draw.focus
- the focus of the recipe layout.