3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

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

Dieser Commit ist enthalten in:
jameslfc19 2020-07-22 18:14:58 +10:00 committet von md_5
Ursprung 6b95d595cf
Commit 8b831a9652
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: E8E901AC7C617C11

Datei anzeigen

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