13
0
geforkt von Mirrors/Paper

#714: Added getRecipe() method to retrieve a Recipe by it's NamespacedKey

By: jameslfc19 <jameslfc19@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2020-07-22 18:14:58 +10:00
Ursprung 95dbba65c7
Commit 70fb3b5056

Datei anzeigen

@ -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();