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-07-04 10:22:56 +02:00
|
|
|
index 3680f101036d98814fe47b707baeeb8e55bfc4b7..471ae4458e7ea7c29d7551b32cec98180fbccd4e 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
|
2023-03-24 21:38:40 +01:00
|
|
|
@@ -450,6 +450,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() {
|