diff options
author | Nassim Jahnke <[email protected]> | 2022-03-13 08:47:54 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-13 08:47:54 +0100 |
commit | 1358d1e9146ca80d0ff84a644c7796d20b39765c (patch) | |
tree | b387981c9a67bfad7e649813c1f1ea30fecfb4d9 /patches/server/0775-Fix-merchant-inventory-not-closing-on-entity-removal.patch | |
parent | ab03538fa1af67a941ad0a9de75d367f13046c8d (diff) | |
download | Paper-1358d1e9146ca80d0ff84a644c7796d20b39765c.tar.gz Paper-1358d1e9146ca80d0ff84a644c7796d20b39765c.zip |
Updated Upstream (CraftBukkit/Spigot) (#7580)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
881e06e5 PR-725: Add Item Unlimited Lifetime APIs
CraftBukkit Changes:
74c08312 SPIGOT-6962: Call EntityChangeBlockEvent when when FallingBlockEntity starts to fall
64db5126 SPIGOT-6959: Make /loot command ignore empty items for spawn
2d760831 Increase outdated build delay
9ed7e4fb SPIGOT-6138, SPIGOT-6415: Don't call CreatureSpawnEvent after cross-dimensional travel
fc4ad813 SPIGOT-6895: Trees grown with applyBoneMeal() don't fire the StructureGrowthEvent
59733a2e SPIGOT-6961: Actually return a copy of the ItemMeta
Spigot Changes:
ffceeae3 SPIGOT-6956: Drop unload queue patch as attempt at fixing stop issue
e19ddabd PR-1011: Add Item Unlimited Lifetime APIs
34d40b0e SPIGOT-2942: give command fires PlayerDropItemEvent, cancelling it causes Item Duplication
Diffstat (limited to 'patches/server/0775-Fix-merchant-inventory-not-closing-on-entity-removal.patch')
-rw-r--r-- | patches/server/0775-Fix-merchant-inventory-not-closing-on-entity-removal.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0775-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0775-Fix-merchant-inventory-not-closing-on-entity-removal.patch new file mode 100644 index 0000000000..cbc189593a --- /dev/null +++ b/patches/server/0775-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 0a11eeaefe39d637fe2f9243b0f8a4b2d9734446..1e2c430a8df6afde91e3c5169d2d7b501acdec7f 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -2485,6 +2485,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 + } |