diff --git a/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch b/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch index 74393b2c8..9bf68e92e 100644 --- a/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch +++ b/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch @@ -92,13 +92,12 @@ itemstack1 = ItemStack.EMPTY; } -@@ -285,11 +294,12 @@ +@@ -285,12 +294,13 @@ EnchantmentManager.setEnchantments(itemstack1, itemenchantments_a.toImmutable()); } - this.resultSlots.setItem(0, itemstack1); + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit -+ sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client this.broadcastChanges(); } else { - this.resultSlots.setItem(0, ItemStack.EMPTY); @@ -106,8 +105,10 @@ + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit + this.cost.set(DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item } ++ sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686, SPIGOT-7931: Always send completed inventory to stay in sync with client } + public static int calculateIncreasedRepairCost(int i) { @@ -329,4 +339,19 @@ public int getCost() { return this.cost.get();