mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
SPIGOT-4651: MerchantRecipe.setIngredients() allows more than 2 ingredients
By: md_5 <git@md-5.net>
This commit is contained in:
parent
a9891b05f1
commit
57acb14157
1 changed files with 2 additions and 1 deletions
|
@ -43,7 +43,7 @@ public class MerchantRecipe implements Recipe {
|
|||
}
|
||||
|
||||
public void addIngredient(ItemStack item) {
|
||||
Preconditions.checkState(ingredients.size() < 2, "MerchantRecipe can only have 2 ingredients");
|
||||
Preconditions.checkState(ingredients.size() < 2, "MerchantRecipe can only have maximum 2 ingredients");
|
||||
ingredients.add(item.clone());
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ public class MerchantRecipe implements Recipe {
|
|||
}
|
||||
|
||||
public void setIngredients(List<ItemStack> ingredients) {
|
||||
Preconditions.checkState(ingredients.size() <= 2, "MerchantRecipe can only have maximum 2 ingredients");
|
||||
this.ingredients = new ArrayList<ItemStack>();
|
||||
for (ItemStack item : ingredients) {
|
||||
this.ingredients.add(item.clone());
|
||||
|
|
Loading…
Reference in a new issue