mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 14:04:49 +01:00
#714: Added getRecipe() method to retrieve a Recipe by it's NamespacedKey
This commit is contained in:
parent
6b95d595cf
commit
8b831a9652
1 changed files with 7 additions and 0 deletions
|
@ -1208,6 +1208,13 @@ public final class CraftServer implements Server {
|
|||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Recipe getRecipe(NamespacedKey recipeKey) {
|
||||
Preconditions.checkArgument(recipeKey != null, "recipeKey == null");
|
||||
|
||||
return getServer().getCraftingManager().a(CraftNamespacedKey.toMinecraft(recipeKey)).map(IRecipe::toBukkitRecipe).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Recipe> recipeIterator() {
|
||||
return new RecipeIterator();
|
||||
|
|
Loading…
Reference in a new issue