diff --git a/paper-api/src/main/java/org/bukkit/inventory/SmithingRecipe.java b/paper-api/src/main/java/org/bukkit/inventory/SmithingRecipe.java new file mode 100644 index 0000000000..af04071d37 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/inventory/SmithingRecipe.java @@ -0,0 +1,63 @@ +package org.bukkit.inventory; + +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a smithing recipe. + */ +public class SmithingRecipe implements Recipe, Keyed { + + private final NamespacedKey key; + private final ItemStack result; + private final RecipeChoice base; + private final RecipeChoice addition; + + /** + * Create a smithing recipe to produce the specified result ItemStack. + * + * @param key The unique recipe key + * @param result The item you want the recipe to create. + * @param base The base ingredient + * @param addition The addition ingredient + */ + public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition) { + this.key = key; + this.result = result; + this.base = base; + this.addition = addition; + } + + /** + * Get the base recipe item. + * + * @return base choice + */ + @NotNull + public RecipeChoice getBase() { + return base.clone(); + } + + /** + * Get the addition recipe item. + * + * @return addition choice + */ + @NotNull + public RecipeChoice getAddition() { + return addition.clone(); + } + + @NotNull + @Override + public ItemStack getResult() { + return result.clone(); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return this.key; + } +}