Package noppes.npcs.api.handler
Interface IRecipeHandler
-
public interface IRecipeHandlerHandles custom crafting recipes and anvil recipes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAnvilRecipe(String name, boolean global, net.minecraft.item.ItemStack itemToRepair, net.minecraft.item.ItemStack repairMaterial, int xpCost, float repairPercentage)Adds a custom anvil recipe.voidaddRecipe(String name, boolean global, net.minecraft.item.ItemStack result, int width, int height, net.minecraft.item.ItemStack... items)Adds a shaped crafting recipe with explicit dimensions.voidaddRecipe(String name, boolean global, net.minecraft.item.ItemStack result, Object... recipe)Adds a shaped crafting recipe.IRecipedelete(int id)Deletes a crafting recipe by ID.IAnvilRecipedeleteAnvil(int id)Deletes an anvil recipe by ID.List<IAnvilRecipe>getAnvilList()List<IRecipe>getCarpentryList()List<IRecipe>getGlobalList()
-
-
-
Method Detail
-
getAnvilList
List<IAnvilRecipe> getAnvilList()
- Returns:
- all custom anvil recipes.
-
addRecipe
void addRecipe(String name, boolean global, net.minecraft.item.ItemStack result, Object... recipe)
Adds a shaped crafting recipe.- Parameters:
name- the recipe name.global- true for global (vanilla workbench); false for carpentry.result- the resulting item stack.recipe- the recipe pattern and ingredient mappings.
-
addRecipe
void addRecipe(String name, boolean global, net.minecraft.item.ItemStack result, int width, int height, net.minecraft.item.ItemStack... items)
Adds a shaped crafting recipe with explicit dimensions.- Parameters:
name- the recipe name.global- true for global; false for carpentry.result- the resulting item stack.width- the recipe grid width.height- the recipe grid height.items- the ingredient item stacks.
-
delete
IRecipe delete(int id)
Deletes a crafting recipe by ID.- Parameters:
id- the recipe ID.- Returns:
- the deleted recipe, or null if not found.
-
deleteAnvil
IAnvilRecipe deleteAnvil(int id)
Deletes an anvil recipe by ID.- Parameters:
id- the recipe ID.- Returns:
- the deleted anvil recipe, or null if not found.
-
addAnvilRecipe
void addAnvilRecipe(String name, boolean global, net.minecraft.item.ItemStack itemToRepair, net.minecraft.item.ItemStack repairMaterial, int xpCost, float repairPercentage)
Adds a custom anvil recipe.- Parameters:
name- the recipe name.global- true for global; false for carpentry.itemToRepair- the item to be repaired.repairMaterial- the material used for repair.xpCost- the experience cost.repairPercentage- the percentage of durability restored per material.
-
-