From 35852775ed8d064de274008ebf3b1906949c2d4a Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 17 Mar 2012 10:37:22 -0400 Subject: [PATCH] [Bleeding] Add iterator() with starting index. Addresses BUKKIT-1246 By: Celtic Minstrel --- .../src/main/java/org/bukkit/inventory/Inventory.java | 9 +++++++++ 1 file changed, 9 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 c5dc995cad..6016b1f6a3 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java @@ -272,4 +272,13 @@ public interface Inventory extends Iterable { public InventoryHolder getHolder(); public ListIterator iterator(); + + /** + * Returns an iterator starting at the given index. If the index is positive, then the first + * call to next() will return the item at that index; if it is negative, the first call to + * previous will return the item at index (getSize() + index). + * @param index The index. + * @return An iterator. + */ + public ListIterator iterator(int index); }