Package noppes.npcs.api.handler.data
Interface IAnvilRecipe
-
public interface IAnvilRecipe
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetID()StringgetName()Returns the unique name of this anvil recipe.floatgetRepairPercentage()The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).net.minecraft.item.ItemStackgetResult(net.minecraft.item.ItemStack itemToRepair)Returns the repaired item based on the input damaged item.intgetXpCost()The XP cost per repair tick (e.g., 10 levels per tick).booleanmatches(net.minecraft.item.ItemStack itemToRepair, net.minecraft.item.ItemStack repairMaterial)Checks whether the provided item and repair material match this recipe.
-
-
-
Method Detail
-
getName
String getName()
Returns the unique name of this anvil recipe.- Returns:
- the recipe name
-
getXpCost
int getXpCost()
The XP cost per repair tick (e.g., 10 levels per tick).- Returns:
- the experience level cost
-
getRepairPercentage
float getRepairPercentage()
The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).- Returns:
- the repair percentage (0.0 to 1.0)
-
matches
boolean matches(net.minecraft.item.ItemStack itemToRepair, net.minecraft.item.ItemStack repairMaterial)Checks whether the provided item and repair material match this recipe.- Parameters:
itemToRepair- the damaged itemrepairMaterial- the material used to repair- Returns:
- true if the items match the recipe requirements
-
getResult
net.minecraft.item.ItemStack getResult(net.minecraft.item.ItemStack itemToRepair)
Returns the repaired item based on the input damaged item.- Parameters:
itemToRepair- the input damaged item- Returns:
- a copy with reduced damage
-
getID
int getID()
-
-