--- a/net/minecraft/world/item/crafting/ShapelessRecipe.java
+++ b/net/minecraft/world/item/crafting/ShapelessRecipe.java
@@ -31,6 +_,21 @@
         this.ingredients = ingredients;
     }
 
+    // CraftBukkit start
+    @Override
+    public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe(org.bukkit.NamespacedKey id) {
+        org.bukkit.craftbukkit.inventory.CraftItemStack result = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this.result);
+        org.bukkit.craftbukkit.inventory.CraftShapelessRecipe recipe = new org.bukkit.craftbukkit.inventory.CraftShapelessRecipe(id, result, this);
+        recipe.setGroup(this.group);
+        recipe.setCategory(org.bukkit.craftbukkit.inventory.CraftRecipe.getCategory(this.category()));
+
+        for (Ingredient list : this.ingredients) {
+            recipe.addIngredient(org.bukkit.craftbukkit.inventory.CraftRecipe.toBukkit(list));
+        }
+        return recipe;
+    }
+    // CraftBukkit end
+
     @Override
     public RecipeSerializer<ShapelessRecipe> getSerializer() {
         return RecipeSerializer.SHAPELESS_RECIPE;
@@ -57,13 +_,18 @@
 
     @Override
     public boolean matches(CraftingInput input, Level level) {
+        // Paper start - Improve exact choice recipe ingredients & unwrap ternary
         if (input.ingredientCount() != this.ingredients.size()) {
             return false;
-        } else {
-            return input.size() == 1 && this.ingredients.size() == 1
-                ? this.ingredients.getFirst().test(input.getItem(0))
-                : input.stackedContents().canCraft(this, null);
-        }
+        }
+        if (input.size() == 1 && this.ingredients.size() == 1) {
+            return this.ingredients.getFirst().test(input.getItem(0));
+        }
+        input.stackedContents().initializeExtras(this, input);
+        boolean canCraft = input.stackedContents().canCraft(this, null);
+        input.stackedContents().resetExtras();
+        return canCraft;
+        // Paper end - Improve exact choice recipe ingredients & unwrap ternary
     }
 
     @Override
