Paper/patches/server/0615-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
2022-12-07 21:16:54 +01:00
index 7271cf41d9ad153ce10b5b5e08ebcdbb3bc65be9..59457378820d7f2899254a6aeef4c30c926ce543 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() {