3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

fix creating complex recipes that have air results

Fixes #10715
Dieser Commit ist enthalten in:
Jake Potrebic 2024-05-13 06:16:45 -07:00
Ursprung 0688f212f5
Commit 218d33ccb1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27CC63F7CBC866C7

Datei anzeigen

@ -170,14 +170,14 @@ index beb798482479c58a8628c314b510ab6349576ce8..6a8195ca224790e3130ec9923188e7b5
ingredients.add(new RecipeChoice.ExactChoice(item));
}
diff --git a/src/main/java/org/bukkit/inventory/SmithingRecipe.java b/src/main/java/org/bukkit/inventory/SmithingRecipe.java
index 1ef9a715a2736e88a16083c6873803a8bd6bcf29..99e40588c10141391762f37b5a326f8df06e5276 100644
index 1ef9a715a2736e88a16083c6873803a8bd6bcf29..a8f451dc1d8d49c2080c3ed3d8348020c3d470cf 100644
--- a/src/main/java/org/bukkit/inventory/SmithingRecipe.java
+++ b/src/main/java/org/bukkit/inventory/SmithingRecipe.java
@@ -44,12 +44,13 @@ public class SmithingRecipe implements Recipe, Keyed {
*/
@Deprecated
public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition, boolean copyDataComponents) {
+ com.google.common.base.Preconditions.checkArgument(!result.isEmpty(), "Recipe cannot have an empty result."); // Paper
+ com.google.common.base.Preconditions.checkArgument(!result.isEmpty() || this instanceof ComplexRecipe, "Recipe cannot have an empty result."); // Paper
this.copyDataComponents = copyDataComponents;
// Paper end
this.key = key;