fix creating complex recipes that have air results

Fixes #10715
This commit is contained in:
Jake Potrebic 2024-05-13 06:16:45 -07:00
parent 0c984809fd
commit 036a488ef5

View file

@ -177,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*/
@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;