From 5165e97c74569a16abe400af0c67993a52d1dea8 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 18 Jan 2024 22:19:05 +1100 Subject: [PATCH] SPIGOT-7570: PrepareItemCraftEvent#isRepair() always returns false By: md_5 --- .../net/minecraft/world/inventory/ContainerWorkbench.patch | 2 +- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch index 8ed346b3b1..7c32f5f318 100644 --- a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch +++ b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch @@ -45,7 +45,7 @@ } } } -+ itemstack = org.bukkit.craftbukkit.event.CraftEventFactory.callPreCraftEvent(inventorycrafting, inventorycraftresult, itemstack, container.getBukkitView(), optional.map(RecipeHolder::toBukkitRecipe).orElse(null) instanceof RecipeRepair); // CraftBukkit ++ itemstack = org.bukkit.craftbukkit.event.CraftEventFactory.callPreCraftEvent(inventorycrafting, inventorycraftresult, itemstack, container.getBukkitView(), optional.map(RecipeHolder::value).orElse(null) instanceof RecipeRepair); // CraftBukkit inventorycraftresult.setItem(0, itemstack); container.setRemoteSlot(0, itemstack); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 9cb58095c4..115f65ad88 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1416,7 +1416,7 @@ public final class CraftServer implements Server { } // Call Bukkit event to check for matrix/result changes. - net.minecraft.world.item.ItemStack result = CraftEventFactory.callPreCraftEvent(inventoryCrafting, craftResult, itemstack, container.getBukkitView(), recipe.map(RecipeHolder::toBukkitRecipe).orElse(null) instanceof RecipeRepair); + net.minecraft.world.item.ItemStack result = CraftEventFactory.callPreCraftEvent(inventoryCrafting, craftResult, itemstack, container.getBukkitView(), recipe.map(RecipeHolder::value).orElse(null) instanceof RecipeRepair); return createItemCraftResult(CraftItemStack.asBukkitCopy(result), inventoryCrafting, craftWorld.getHandle()); }