Commits

md_5 authored 33fbc3d8622
Add getLocation() to Inventory.
No tags

src/main/java/org/bukkit/inventory/Inventory.java

Modified
1 1 package org.bukkit.inventory;
2 2
3 3 import java.util.HashMap;
4 4 import java.util.List;
5 5 import java.util.ListIterator;
6 6
7 +import org.bukkit.Location;
7 8 import org.bukkit.Material;
8 9 import org.bukkit.entity.HumanEntity;
9 10 import org.bukkit.event.inventory.InventoryType;
10 11
11 12 /**
12 13 * Interface to the various inventories. Behavior relating to {@link
13 14 * Material#AIR} is unspecified.
14 15 */
15 16 public interface Inventory extends Iterable<ItemStack> {
16 17
371 372 /**
372 373 * Returns an iterator starting at the given index. If the index is
373 374 * positive, then the first call to next() will return the item at that
374 375 * index; if it is negative, the first call to previous will return the
375 376 * item at index (getSize() + index).
376 377 *
377 378 * @param index The index.
378 379 * @return An iterator.
379 380 */
380 381 public ListIterator<ItemStack> iterator(int index);
382 +
383 + /**
384 + * Get the location of the block or entity which corresponds to this inventory. May return null if this container
385 + * was custom created or is a virtual / subcontainer.
386 + *
387 + * @return location or null if not applicable.
388 + */
389 + public Location getLocation();
381 390 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut