From 17f649de1e75bbd3d47b6a62015b15920a624405 Mon Sep 17 00:00:00 2001 From: Kobe ⑧ <102713261+HaHaWTH@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:40:04 -0800 Subject: Fix PlayerTradeEvent visual issue when being cancelled (#11773) --- .../net/minecraft/world/inventory/MerchantResultSlot.java.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch b/paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch index ceb2902468..66df3c79f6 100644 --- a/paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/MerchantResultSlot.java +++ b/net/minecraft/world/inventory/MerchantResultSlot.java -@@ -47,13 +_,32 @@ +@@ -47,13 +_,34 @@ @Override public void onTake(Player player, ItemStack stack) { @@ -19,6 +19,8 @@ + if (!event.callEvent()) { + stack.setCount(0); + event.getPlayer().updateInventory(); ++ int level = merchant instanceof net.minecraft.world.entity.npc.Villager villager ? villager.getVillagerData().getLevel() : 1; ++ serverPlayer.sendMerchantOffers(player.containerMenu.containerId, merchant.getOffers(), level, merchant.getVillagerXp(), merchant.showProgressBar(), merchant.canRestock()); + return; + } + activeOffer = org.bukkit.craftbukkit.inventory.CraftMerchantRecipe.fromBukkit(event.getTrade()).toMinecraft(); -- cgit v1.2.3