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-06-13 01:51:45 +02:00
|
|
|
index 01b38b5a515c7dd0f0c79141c270d618bf3c56eb..bfac13ec6c316caa65db4a51b77f0a7045ad88ff 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() {
|