Interface IRecipeManager<T extends net.minecraft.world.item.crafting.Recipe<?>>
- All Superinterfaces:
CommandStringDisplayable,Iterable<T>
- All Known Subinterfaces:
ICookingRecipeManager<T>
- All Known Implementing Classes:
BlastFurnaceRecipeManager,CampFireRecipeManager,CraftingTableRecipeManager,FurnaceRecipeManager,RecipeManagerWrapper,SmithingRecipeManager,SmokerRecipeManager,StoneCutterManager
@ZenRegister
public interface IRecipeManager<T extends net.minecraft.world.item.crafting.Recipe<?>>
extends CommandStringDisplayable, Iterable<T>
Default interface for Registry based handlers as they can all remove recipes by ResourceLocation.
- DocParam:
- this craftingTable
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddJsonRecipe(String name, MapData mapData) Adds a recipe based on a provided IData.default StringfixRecipeName(String name) Fixes and logs some common errors that people run into with recipe namesdefault net.minecraft.resources.ResourceLocationGets the resource location to get this Recipe handler Default just looks up the Recipe Type key from the registrydefault StringReturns the BEP to get this thingydefault TgetRecipeByName(String name) default RecipeList<T>Gets aRecipeListwhich can be used to change recipes for this manager.Returns a map of all known recipes.Gets the recipes for this RecipeManager.getRecipesByOutput(IIngredient output) net.minecraft.world.item.crafting.RecipeType<T>Gets the recipe type for the registry to remove from.iterator()default voidremove(IIngredient output) Remove a recipe based on it's output.default voidRemove all recipes in this registrydefault voidremoveByInput(IItemStack input) Removes all recipes where the input contains the given IItemStack.default voidremoveByModid(String modid, Predicate<String> exclude) Remove recipe based on Registry name modiddefault voidremoveByName(String name) Deprecated, for removal: This API element is subject to removal in a future version.default voidremoveByName(String... names) Remove recipes based on Registry namesdefault voidremoveByRegex(String regex, Predicate<String> exclude) Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
JSON_RECIPE_GSON
static final com.google.gson.Gson JSON_RECIPE_GSON
-
-
Method Details
-
addJsonRecipe
Adds a recipe based on a provided IData. The provided IData should represent a DataPack json, this effectively allows you to register recipes for any DataPack supporting RecipeType systems.- Parameters:
name- name of the recipemapData- data representing the json file- DocParam:
- name "recipe_name", mapData { ingredient: <item:minecraft:gold_ore>, result: <item:minecraft:cooked_porkchop>.registryName, experience: 0.35 as float, cookingtime:100 }
-
getRecipeByName
-
getRecipesByOutput
-
getAllRecipes
-
getRecipeMap
Returns a map of all known recipes.- Returns:
- A Map of recipe name to recipe of all known recipes.
-
remove
Remove a recipe based on it's output.- Parameters:
output- output of the recipe- DocParam:
- output <tag:items:minecraft:wool>
-
removeByInput
Removes all recipes where the input contains the given IItemStack.- Parameters:
input- The input IItemStack.- DocParam:
- input <item:minecraft:iron_ingot>
-
removeByName
Deprecated, for removal: This API element is subject to removal in a future version.UseremoveByName(String...)insteadRemove recipe based on Registry name- Parameters:
name- registry name of recipe to remove- DocParam:
- name "minecraft:furnace"
-
removeByName
Remove recipes based on Registry names- Parameters:
names- registry names of recipes to remove- DocParam:
- name "minecraft:furnace", "minecraft:bow"
-
removeByModid
Remove recipe based on Registry name modid- Parameters:
modid- modid of the recipes to remove- DocParam:
- modid "minecraft"
-
removeByRegex
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified.- Parameters:
regex- regex to match against- DocParam:
- regex "\\d_\\d", exclude (name as string) => {return name == "orange_wool";}
-
removeAll
default void removeAll()Remove all recipes in this registry -
getRecipeType
net.minecraft.world.item.crafting.RecipeType<T> getRecipeType()Gets the recipe type for the registry to remove from.- Returns:
- IRecipeType of this registry.
-
getRecipeList
Gets aRecipeListwhich can be used to change recipes for this manager. Changes made through aRecipeListare applied to all the places that vanilla keeps track of recipes.- Returns:
- A
RecipeListfor this manager.
-
getRecipes
Gets the recipes for this RecipeManager. This should only be used to view recipes, if you need to change the map, usegetRecipeList()In the future this method will either be removed or made to return an immutable map.- Returns:
- A map of name to recipe for the manager type.
-
getBracketResourceLocation
default net.minecraft.resources.ResourceLocation getBracketResourceLocation()Gets the resource location to get this Recipe handler Default just looks up the Recipe Type key from the registry -
getCommandString
Description copied from interface:CommandStringDisplayableReturns the BEP to get this thingy- Specified by:
getCommandStringin interfaceCommandStringDisplayable
-
fixRecipeName
Fixes and logs some common errors that people run into with recipe names- Parameters:
name- name to check- Returns:
- fixed name
-
iterator
-
removeByName(String...)instead