Paper/patches/server/0612-Inventory-close.patch

26 lines
1.0 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 11 May 2021 14:54:56 -0700
Subject: [PATCH] Inventory#close
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
2023-03-14 21:25:13 +01:00
index 513f3311a9009996c27604f2ba7d60c80c7a2060..00959a31e172632d9bf047347f345140fca3198c 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
2022-12-07 21:16:54 +01:00
@@ -449,6 +449,14 @@ public class CraftInventory implements Inventory {
2021-06-15 04:59:31 +02:00
this.clear(i);
2021-06-11 14:02:28 +02:00
}
}
+ // Paper start
+ @Override
+ public int close() {
+ int count = this.inventory.getViewers().size();
+ com.google.common.collect.Lists.newArrayList(this.inventory.getViewers()).forEach(HumanEntity::closeInventory);
+ return count;
+ }
+ // Paper end
@Override
public ListIterator<ItemStack> iterator() {