Trial clearing meta if compare similarity set to false in trading inventory. This is to use Citizens logic instead of Minecraft logic for trade selection

This commit is contained in:
fullwall 2024-09-09 02:09:13 +08:00
parent 91e4fb10fc
commit b26f185de2

View File

@ -968,8 +968,13 @@ public class ShopTrait extends Trait {
MerchantRecipe recipe = new MerchantRecipe(result.clone(), 100000000);
for (NPCShopAction action : item.cost) {
if (action instanceof ItemAction) {
for (ItemStack stack : ((ItemAction) action).items) {
recipe.addIngredient(stack.clone());
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);
if (recipe.getIngredients().size() == 2)
break;
}