From b70d1e8bdc728c425b7ee9aefb2e47aca559d5de Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 11 May 2021 14:54:56 -0700 Subject: [PATCH] Inventory#close --- .../org/bukkit/craftbukkit/inventory/CraftInventory.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index f3a1859a1c..bc5ec42a54 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -439,6 +439,14 @@ public class CraftInventory implements Inventory { this.clear(i); } } + // 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 iterator() {