diff options
author | booky10 <[email protected]> | 2023-11-04 20:20:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-04 20:20:01 +0100 |
commit | f78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807 (patch) | |
tree | 8e7abee5129e15a919630824c4f194a2811f7242 /patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch | |
parent | 44057da46727138e19d951b56e98ad8c25c1f869 (diff) | |
download | Paper-f78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807.tar.gz Paper-f78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807.zip |
Remove "fix-curing-zombie-villager-discount" exploit option (#9895)
Diffstat (limited to 'patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch')
-rw-r--r-- | patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch new file mode 100644 index 0000000000..2450152a70 --- /dev/null +++ b/patches/server/0697-Fix-merchant-inventory-not-closing-on-entity-removal.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Thu, 2 Sep 2021 00:24:06 -0700 +Subject: [PATCH] Fix merchant inventory not closing on entity removal + + +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index 7580fbc59780161946d9dc65587b6c6aea81671b..38931091d573059d7e265fd86a704b96f48bdc48 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -2642,6 +2642,11 @@ public class ServerLevel extends Level implements WorldGenLevel { + // Spigot end + // Spigot Start + if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message ++ // Paper start ++ if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { ++ merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); ++ } ++ // Paper end + for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { + h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper + } |