diff --git a/paper-api/src/main/java/org/bukkit/inventory/RecipeChoice.java b/paper-api/src/main/java/org/bukkit/inventory/RecipeChoice.java index 6734bc9d7a..5b7ddf5f3e 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/RecipeChoice.java +++ b/paper-api/src/main/java/org/bukkit/inventory/RecipeChoice.java @@ -13,7 +13,8 @@ import org.jetbrains.annotations.NotNull; /** * Represents a potential item match within a recipe. All choices within a - * recipe must be satisfied for it to be craftable. + * recipe must be satisfied for it to be craftable. Choices must never be + * null or air. * * This class is not legal for implementation by plugins! */ @@ -66,6 +67,7 @@ public interface RecipeChoice extends Predicate, Cloneable { Preconditions.checkArgument(!choices.isEmpty(), "Must have at least one choice"); for (Material choice : choices) { Preconditions.checkArgument(choice != null, "Cannot have null choice"); + Preconditions.checkArgument(!choice.isAir(), "Cannot have empty/air choice"); } this.choices = new ArrayList<>(choices); @@ -166,6 +168,7 @@ public interface RecipeChoice extends Predicate, Cloneable { Preconditions.checkArgument(!choices.isEmpty(), "Must have at least one choice"); for (ItemStack choice : choices) { Preconditions.checkArgument(choice != null, "Cannot have null choice"); + Preconditions.checkArgument(!choice.getType().isAir(), "Cannot have empty/air choice"); } this.choices = new ArrayList<>(choices);