mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
SPIGOT-4651: MerchantRecipe.setIngredients() allows more than 2 ingredients
This commit is contained in:
parent
0b95b68f96
commit
77cbdc6134
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…
Add table
Reference in a new issue