#714: Added getRecipe() method to retrieve a Recipe by it's NamespacedKey
By: jameslfc19 <jameslfc19@gmail.com>
This commit is contained in:
@@ -1208,6 +1208,13 @@ public final class CraftServer implements Server {
|
|||||||
return results;
|
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
|
@Override
|
||||||
public Iterator<Recipe> recipeIterator() {
|
public Iterator<Recipe> recipeIterator() {
|
||||||
return new RecipeIterator();
|
return new RecipeIterator();
|
||||||
|
|||||||
Reference in New Issue
Block a user