zhangyuheng
83e1fe4058
All checks were successful
Java CI-CD with Gradle / build (push) Successful in 18m3s
26 lines
2.0 KiB
Diff
26 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: zhangyuheng <zhangyuheng@lunadeer.cn>
|
|
Date: Mon, 26 Feb 2024 18:03:17 +0800
|
|
Subject: [PATCH] Allow void trading
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index 90d78ddf8518c0df307cdaa8b7cfb5549491c6e5..2a3a8d9f5176ba444f401e8ac505cb7ee7d59234 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -2815,10 +2815,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
// 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
|
|
+ // DeerFolia - Allow void trading
|
|
// Paper start - Fix merchant inventory not closing on entity removal
|
|
- if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) {
|
|
- merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED);
|
|
- }
|
|
+ // if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) {
|
|
+ // merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED);
|
|
+ // }
|
|
// Paper end - Fix merchant inventory not closing on entity removal
|
|
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 - Inventory close reason
|