From 4607199e45e216d7a7d86487a94348870c3a0044 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 25 Feb 2019 19:13:50 +1100 Subject: [PATCH] SPIGOT-4634: Make Inventory iteration behaviour explicit By: md_5 --- .../src/main/java/org/bukkit/inventory/Inventory.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java index 3585f1099a..bab561dc42 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java @@ -12,6 +12,16 @@ import org.bukkit.event.inventory.InventoryType; /** * Interface to the various inventories. Behavior relating to {@link * Material#AIR} is unspecified. + * + *
+ * Note that whilst {@link #iterator()} deals with the entire inventory, add + * / contains / remove methods deal only with the storage contents. + *
+ * Consider using {@link #getContents()} and {@link #getStorageContents()} for + * specific iteration. + * + * @see #getContents() + * @see #getStorageContents() */ public interface Inventory extends Iterable {