mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
#529: Added getRecipe() method to retrieve a Recipe by it's NamespacedKey
By: jameslfc19 <jameslfc19@gmail.com>
This commit is contained in:
parent
2d628bb34a
commit
2b0e21f46d
@ -716,6 +716,17 @@ public final class Bukkit {
|
|||||||
return server.getRecipesFor(result);
|
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.
|
* Get an iterator through the list of crafting recipes.
|
||||||
*
|
*
|
||||||
|
@ -601,6 +601,15 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public List<Recipe> getRecipesFor(@NotNull ItemStack result);
|
public List<Recipe> 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.
|
* Get an iterator through the list of crafting recipes.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user