diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 03793b777a..3eccc275b8 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -716,6 +716,17 @@ public final class Bukkit { return server.getRecipesFor(result); } + /** + * Get the {@link Recipe} for the given key. + * + * @param recipeKey the key of the recipe to return + * @return the recipe for the given key or null. + */ + @Nullable + public static Recipe getRecipe(@NotNull NamespacedKey recipeKey) { + return server.getRecipe(recipeKey); + } + /** * Get an iterator through the list of crafting recipes. * diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 7a97a26b5b..a1a179fb04 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -601,6 +601,15 @@ public interface Server extends PluginMessageRecipient { @NotNull public List getRecipesFor(@NotNull ItemStack result); + /** + * Get the {@link Recipe} for the given key. + * + * @param recipeKey the key of the recipe to return + * @return the recipe for the given key or null. + */ + @Nullable + public Recipe getRecipe(@NotNull NamespacedKey recipeKey); + /** * Get an iterator through the list of crafting recipes. *