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

26 Zeilen
1.0 KiB
Diff

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
2021-06-15 04:59:31 +02:00
index 7850dfa9130761905030856786a97a008c700687..01701e50dd0ce1c46dcc27ea7da8f51d45899a8c 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
2021-06-15 04:59:31 +02:00
@@ -447,6 +447,14 @@ public class CraftInventory implements Inventory {
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() {