From 616ec5f700b93f0c3a155112ae59b92e29fdefa7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 7 Sep 2024 18:57:55 +1000 Subject: [PATCH] SPIGOT-7891: Can't remove second ingredient of MerchantRecipe By: md_5 --- .../org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java index 9fe2855ab9..f7b28b2f23 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java @@ -120,6 +120,8 @@ public class CraftMerchantRecipe extends MerchantRecipe { if (ingredients.size() > 1) { net.minecraft.world.item.ItemStack costB = CraftItemStack.asNMSCopy(ingredients.get(1)); handle.costB = Optional.of(new ItemCost(costB.getItemHolder(), costB.getCount(), DataComponentPredicate.allOf(costB.getComponents()), costB)); + } else { + handle.costB = Optional.empty(); } return handle; }