mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Make meta comparison ignore ingredients that don't match the meta instead of rejecting the transaction
This commit is contained in:
parent
b26f185de2
commit
5d1a1ad642
@ -970,11 +970,8 @@ public class ShopTrait extends Trait {
|
||||
if (action instanceof ItemAction) {
|
||||
ItemAction ia = (ItemAction) action;
|
||||
for (ItemStack stack : ia.items) {
|
||||
ItemStack ingredient = stack.clone();
|
||||
if (!ia.compareSimilarity) {
|
||||
ingredient.setItemMeta(Bukkit.getItemFactory().getItemMeta(ingredient.getType()));
|
||||
}
|
||||
recipe.addIngredient(ingredient);
|
||||
stack = stack.clone();
|
||||
recipe.addIngredient(stack);
|
||||
if (recipe.getIngredients().size() == 2)
|
||||
break;
|
||||
}
|
||||
|
@ -174,7 +174,9 @@ public class ItemAction extends NPCShopAction {
|
||||
return false;
|
||||
Map<String, Object> nextAcc = (Map<String, Object>) acc;
|
||||
Map<String, Object> nextCmp = (Map<String, Object>) cmp;
|
||||
if (!nextAcc.containsKey(parts[i]) || !nextCmp.containsKey(parts[i]))
|
||||
if (!nextAcc.containsKey(parts[i]))
|
||||
break;
|
||||
if (!nextCmp.containsKey(parts[i]))
|
||||
return false;
|
||||
acc = nextAcc.get(parts[i]);
|
||||
cmp = nextCmp.get(parts[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user