![]() |
Bukkit
1.4.7-R1.0
|
Represents a view linking two inventories and a single player (whose inventory may or may not be one of the two) More...
Classes | |
| enum | Property |
| Represents various extra properties of certain inventory windows. More... | |
Public Member Functions | |
| abstract Inventory | getTopInventory () |
| Get the upper inventory involved in this transaction. | |
| abstract Inventory | getBottomInventory () |
| Get the lower inventory involved in this transaction. | |
| abstract HumanEntity | getPlayer () |
| Get the player viewing. | |
| abstract InventoryType | getType () |
| Determine the type of inventory involved in the transaction. | |
| void | setItem (int slot, ItemStack item) |
| Sets one item in this inventory view by its raw slot ID. | |
| ItemStack | getItem (int slot) |
| Gets one item in this inventory view by its raw slot ID. | |
| final void | setCursor (ItemStack item) |
| Sets the item on the cursor of one of the viewing players. | |
| final ItemStack | getCursor () |
| Get the item on the cursor of one of the viewing players. | |
| final int | convertSlot (int rawSlot) |
| Converts a raw slot ID into its local slot ID into whichever of the two inventories the slot points to. | |
| final void | close () |
| Closes the inventory view. | |
| final int | countSlots () |
| Check the total number of slots in this view, combining the upper and lower inventories. | |
| final boolean | setProperty (Property prop, int value) |
| final String | getTitle () |
| Get the title of this inventory window. | |
Static Public Attributes | |
| static final int | OUTSIDE = -999 |
Represents a view linking two inventories and a single player (whose inventory may or may not be one of the two)
Note: If you implement this interface but fail to satisfy the expected contracts of certain methods, there's no guarantee that the game will work as it should.
Definition at line 14 of file InventoryView.java.
| final void org.bukkit.inventory.InventoryView.close | ( | ) |
Closes the inventory view.
Definition at line 168 of file InventoryView.java.
References org.bukkit.entity.HumanEntity.closeInventory(), and org.bukkit.inventory.InventoryView.getPlayer().
| final int org.bukkit.inventory.InventoryView.convertSlot | ( | int | rawSlot | ) |
Converts a raw slot ID into its local slot ID into whichever of the two inventories the slot points to.
If the raw slot refers to the upper inventory, it will be returned unchanged and thus be suitable for getTopInventory().getItem(); if it refers to the lower inventory, the output will differ from the input and be suitable for getBottomInventory().getItem().
| rawSlot | The raw slot ID. |
Definition at line 150 of file InventoryView.java.
References org.bukkit.event.inventory.InventoryType.CRAFTING, org.bukkit.inventory.Inventory.getSize(), org.bukkit.inventory.InventoryView.getTopInventory(), and org.bukkit.inventory.InventoryView.getType().
Referenced by org.bukkit.inventory.InventoryView.getItem(), org.bukkit.event.inventory.InventoryClickEvent.InventoryClickEvent(), and org.bukkit.inventory.InventoryView.setItem().
| final int org.bukkit.inventory.InventoryView.countSlots | ( | ) |
Check the total number of slots in this view, combining the upper and lower inventories.
Note though that it's possible for this to be greater than the sum of the two inventories if for example some slots are not being used.
Definition at line 178 of file InventoryView.java.
References org.bukkit.inventory.InventoryView.getBottomInventory(), org.bukkit.inventory.Inventory.getSize(), and org.bukkit.inventory.InventoryView.getTopInventory().
|
pure virtual |
Get the lower inventory involved in this transaction.
Referenced by org.bukkit.inventory.InventoryView.countSlots(), org.bukkit.inventory.InventoryView.getItem(), and org.bukkit.inventory.InventoryView.setItem().
| final ItemStack org.bukkit.inventory.InventoryView.getCursor | ( | ) |
Get the item on the cursor of one of the viewing players.
Definition at line 137 of file InventoryView.java.
References org.bukkit.entity.HumanEntity.getItemOnCursor(), and org.bukkit.inventory.InventoryView.getPlayer().
Referenced by org.bukkit.event.inventory.InventoryClickEvent.getCursor().
| ItemStack org.bukkit.inventory.InventoryView.getItem | ( | int | slot | ) |
Gets one item in this inventory view by its raw slot ID.
| slot | The ID as returned by InventoryClickEvent.getRawSlot() |
Definition at line 114 of file InventoryView.java.
References org.bukkit.inventory.InventoryView.convertSlot(), org.bukkit.inventory.InventoryView.getBottomInventory(), org.bukkit.inventory.Inventory.getItem(), org.bukkit.inventory.InventoryView.getTopInventory(), and org.bukkit.inventory.InventoryView.OUTSIDE.
Referenced by org.bukkit.event.inventory.InventoryClickEvent.getCurrentItem().
|
pure virtual |
Get the player viewing.
Referenced by org.bukkit.inventory.InventoryView.close(), org.bukkit.inventory.InventoryView.getCursor(), org.bukkit.event.inventory.InventoryCloseEvent.getPlayer(), org.bukkit.event.inventory.InventoryOpenEvent.getPlayer(), org.bukkit.event.inventory.InventoryClickEvent.getWhoClicked(), org.bukkit.inventory.InventoryView.setCursor(), org.bukkit.inventory.InventoryView.setItem(), and org.bukkit.inventory.InventoryView.setProperty().
| final String org.bukkit.inventory.InventoryView.getTitle | ( | ) |
Get the title of this inventory window.
Definition at line 190 of file InventoryView.java.
References org.bukkit.inventory.Inventory.getTitle(), and org.bukkit.inventory.InventoryView.getTopInventory().
|
pure virtual |
Get the upper inventory involved in this transaction.
Referenced by org.bukkit.inventory.InventoryView.convertSlot(), org.bukkit.inventory.InventoryView.countSlots(), org.bukkit.event.inventory.InventoryEvent.getInventory(), org.bukkit.inventory.InventoryView.getItem(), org.bukkit.inventory.InventoryView.getTitle(), org.bukkit.event.inventory.InventoryEvent.getViewers(), and org.bukkit.inventory.InventoryView.setItem().
|
pure virtual |
Determine the type of inventory involved in the transaction.
This indicates the window style being shown. It will never return PLAYER, since that is common to all windows.
Referenced by org.bukkit.inventory.InventoryView.convertSlot().
| final void org.bukkit.inventory.InventoryView.setCursor | ( | ItemStack | item | ) |
Sets the item on the cursor of one of the viewing players.
| item | The item to put on the cursor, or null to remove the item on their cursor. |
Definition at line 129 of file InventoryView.java.
References org.bukkit.inventory.InventoryView.getPlayer(), and org.bukkit.entity.HumanEntity.setItemOnCursor().
Referenced by org.bukkit.event.inventory.InventoryClickEvent.setCursor().
| void org.bukkit.inventory.InventoryView.setItem | ( | int | slot, |
| ItemStack | item | ||
| ) |
Sets one item in this inventory view by its raw slot ID.
Note: If slot ID -999 is chosen, it may be expected that the item is dropped on the ground. This is not required behaviour, however.
| slot | The ID as returned by InventoryClickEvent.getRawSlot() |
| item | The new item to put in the slot, or null to clear it. |
Definition at line 97 of file InventoryView.java.
References org.bukkit.inventory.InventoryView.convertSlot(), org.bukkit.World.dropItemNaturally(), org.bukkit.inventory.InventoryView.getBottomInventory(), org.bukkit.inventory.InventoryView.getPlayer(), org.bukkit.inventory.InventoryView.getTopInventory(), org.bukkit.entity.Entity.getWorld(), org.bukkit.inventory.InventoryView.OUTSIDE, and org.bukkit.inventory.Inventory.setItem().
Referenced by org.bukkit.event.inventory.InventoryClickEvent.setCurrentItem().
| final boolean org.bukkit.inventory.InventoryView.setProperty | ( | Property | prop, |
| int | value | ||
| ) |
Definition at line 182 of file InventoryView.java.
References org.bukkit.inventory.InventoryView.getPlayer(), and org.bukkit.entity.HumanEntity.setWindowProperty().
|
static |
Definition at line 15 of file InventoryView.java.
Referenced by org.bukkit.inventory.InventoryView.getItem(), and org.bukkit.inventory.InventoryView.setItem().