Add InventoryView#getInventory API

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2018-12-26 08:00:00 +11:00
parent e8f711959a
commit a487f8ec2b
2 changed files with 42 additions and 14 deletions

View File

@@ -157,6 +157,16 @@ public class InventoryClickEvent extends InventoryInteractEvent {
}
}
/**
* Gets the inventory corresponding to the clicked slot.
*
* @see InventoryView#getInventory(int)
* @return inventory, or null if clicked outside
*/
public Inventory getClickedInventory() {
return getView().getInventory(rawSlot);
}
/**
* The slot number that was clicked, ready for passing to
* {@link Inventory#getItem(int)}. Note that there may be two slots with