diff options
author | Kobe ⑧ <[email protected]> | 2024-12-23 01:40:04 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-23 10:40:04 +0100 |
commit | 17f649de1e75bbd3d47b6a62015b15920a624405 (patch) | |
tree | b2f0f8ecc8a1c0095b72f6c00844789c45e16d06 | |
parent | cbf630d5b5423bdf3bdd366e141436eed66d6d7d (diff) | |
download | Paper-17f649de1e75bbd3d47b6a62015b15920a624405.tar.gz Paper-17f649de1e75bbd3d47b6a62015b15920a624405.zip |
Fix PlayerTradeEvent visual issue when being cancelled (#11773)
-rw-r--r-- | paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch | 4 |
1 files changed, 3 insertions, 1 deletions
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(); |