mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
SPIGOT-4651: MerchantRecipe.setIngredients() allows more than 2 ingredients
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user