mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-27 09:42:37 +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) {
|
if (action instanceof ItemAction) {
|
||||||
ItemAction ia = (ItemAction) action;
|
ItemAction ia = (ItemAction) action;
|
||||||
for (ItemStack stack : ia.items) {
|
for (ItemStack stack : ia.items) {
|
||||||
ItemStack ingredient = stack.clone();
|
stack = stack.clone();
|
||||||
if (!ia.compareSimilarity) {
|
recipe.addIngredient(stack);
|
||||||
ingredient.setItemMeta(Bukkit.getItemFactory().getItemMeta(ingredient.getType()));
|
|
||||||
}
|
|
||||||
recipe.addIngredient(ingredient);
|
|
||||||
if (recipe.getIngredients().size() == 2)
|
if (recipe.getIngredients().size() == 2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,9 @@ public class ItemAction extends NPCShopAction {
|
|||||||
return false;
|
return false;
|
||||||
Map<String, Object> nextAcc = (Map<String, Object>) acc;
|
Map<String, Object> nextAcc = (Map<String, Object>) acc;
|
||||||
Map<String, Object> nextCmp = (Map<String, Object>) cmp;
|
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;
|
return false;
|
||||||
acc = nextAcc.get(parts[i]);
|
acc = nextAcc.get(parts[i]);
|
||||||
cmp = nextCmp.get(parts[i]);
|
cmp = nextCmp.get(parts[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user