--- a/net/minecraft/world/item/crafting/UpgradeRecipe.java
+++ b/net/minecraft/world/item/crafting/UpgradeRecipe.java
@@ -11,13 +11,29 @@
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.block.Blocks;
 
-public class UpgradeRecipe implements Recipe<Container> {
+// CraftBukkit start
+import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftSmithingRecipe;
+import org.bukkit.craftbukkit.v1_19_R1.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
+
+public class UpgradeRecipe implements net.minecraft.world.item.crafting.Recipe<Container> {
+
     final Ingredient base;
     final Ingredient addition;
     final ItemStack result;
     private final ResourceLocation id;
+    final boolean copyNbt; // Paper
 
     public UpgradeRecipe(ResourceLocation id, Ingredient base, Ingredient addition, ItemStack result) {
+        // Paper start
+        this(id, base, addition, result, true);
+    }
+    public UpgradeRecipe(ResourceLocation id, Ingredient base, Ingredient addition, ItemStack result, boolean copyNbt) {
+        this.copyNbt = copyNbt;
+        // Paper end
         this.id = id;
         this.base = base;
         this.addition = addition;
@@ -31,13 +47,16 @@
 
     @Override
     public ItemStack assemble(Container inventory) {
-        ItemStack itemStack = this.result.copy();
-        CompoundTag compoundTag = inventory.getItem(0).getTag();
-        if (compoundTag != null) {
-            itemStack.setTag(compoundTag.copy());
+        ItemStack itemstack = this.result.copy();
+        if (copyNbt) { // Paper - copy nbt conditionally
+        CompoundTag nbttagcompound = inventory.getItem(0).getTag();
+
+        if (nbttagcompound != null) {
+            itemstack.setTag(nbttagcompound.copy());
         }
+        } // Paper
 
-        return itemStack;
+        return itemstack;
     }
 
     @Override
@@ -76,29 +95,44 @@
 
     @Override
     public boolean isIncomplete() {
-        return Stream.of(this.base, this.addition).anyMatch((ingredient) -> {
-            return ingredient.getItems().length == 0;
+        return Stream.of(this.base, this.addition).anyMatch((recipeitemstack) -> {
+            return recipeitemstack.getItems().length == 0;
         });
     }
 
+    // CraftBukkit start
+    @Override
+    public Recipe toBukkitRecipe() {
+        CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
+
+        CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition), this.copyNbt); // Paper
+
+        return recipe;
+    }
+    // CraftBukkit end
+
     public static class Serializer implements RecipeSerializer<UpgradeRecipe> {
+
+        public Serializer() {}
+
         @Override
-        public UpgradeRecipe fromJson(ResourceLocation resourceLocation, JsonObject jsonObject) {
-            Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(jsonObject, "base"));
-            Ingredient ingredient2 = Ingredient.fromJson(GsonHelper.getAsJsonObject(jsonObject, "addition"));
-            ItemStack itemStack = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(jsonObject, "result"));
-            return new UpgradeRecipe(resourceLocation, ingredient, ingredient2, itemStack);
+        public UpgradeRecipe fromJson(ResourceLocation id, JsonObject json) {
+            Ingredient recipeitemstack = Ingredient.fromJson(GsonHelper.getAsJsonObject(json, "base"));
+            Ingredient recipeitemstack1 = Ingredient.fromJson(GsonHelper.getAsJsonObject(json, "addition"));
+            ItemStack itemstack = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "result"));
+
+            return new UpgradeRecipe(id, recipeitemstack, recipeitemstack1, itemstack);
         }
 
         @Override
-        public UpgradeRecipe fromNetwork(ResourceLocation resourceLocation, FriendlyByteBuf friendlyByteBuf) {
-            Ingredient ingredient = Ingredient.fromNetwork(friendlyByteBuf);
-            Ingredient ingredient2 = Ingredient.fromNetwork(friendlyByteBuf);
-            ItemStack itemStack = friendlyByteBuf.readItem();
-            return new UpgradeRecipe(resourceLocation, ingredient, ingredient2, itemStack);
+        public UpgradeRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf buf) {
+            Ingredient recipeitemstack = Ingredient.fromNetwork(buf);
+            Ingredient recipeitemstack1 = Ingredient.fromNetwork(buf);
+            ItemStack itemstack = buf.readItem();
+
+            return new UpgradeRecipe(id, recipeitemstack, recipeitemstack1, itemstack);
         }
 
-        @Override
         public void toNetwork(FriendlyByteBuf buf, UpgradeRecipe recipe) {
             recipe.base.toNetwork(buf);
             recipe.addition.toNetwork(buf);
