|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.inventory.InventoryView
public abstract class InventoryView
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.
Nested Class Summary | |
---|---|
static class |
InventoryView.Property
Represents various extra properties of certain inventory windows. |
Field Summary | |
---|---|
static int |
OUTSIDE
|
Constructor Summary | |
---|---|
InventoryView()
|
Method Summary | |
---|---|
void |
close()
Closes the inventory view. |
int |
convertSlot(int rawSlot)
Converts a raw slot ID into its local slot ID into whichever of the two inventories the slot points to. |
int |
countSlots()
Check the total number of slots in this view, combining the upper and lower inventories. |
abstract Inventory |
getBottomInventory()
Get the lower inventory involved in this transaction. |
ItemStack |
getCursor()
Get the item on the cursor of one of the viewing players. |
ItemStack |
getItem(int slot)
Gets one item in this inventory view by its raw slot ID. |
abstract HumanEntity |
getPlayer()
Get the player viewing. |
String |
getTitle()
Get the title of this inventory window. |
abstract Inventory |
getTopInventory()
Get the upper inventory involved in this transaction. |
abstract InventoryType |
getType()
Determine the type of inventory involved in the transaction. |
void |
setCursor(ItemStack item)
Sets the item on the cursor of one of the viewing players. |
void |
setItem(int slot,
ItemStack item)
Sets one item in this inventory view by its raw slot ID. |
boolean |
setProperty(InventoryView.Property prop,
int value)
Sets an extra property of this inventory if supported by that inventory, for example the state of a progress bar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OUTSIDE
Constructor Detail |
---|
public InventoryView()
Method Detail |
---|
public abstract Inventory getTopInventory()
public abstract Inventory getBottomInventory()
public abstract HumanEntity getPlayer()
public abstract InventoryType getType()
public void setItem(int slot, ItemStack item)
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.public ItemStack getItem(int slot)
slot
- The ID as returned by InventoryClickEvent.getRawSlot()
public final void setCursor(ItemStack item)
item
- The item to put on the cursor, or null to remove the item on their cursor.public final ItemStack getCursor()
public final int convertSlot(int rawSlot)
rawSlot
- The raw slot ID.
public final void close()
public final int countSlots()
public final boolean setProperty(InventoryView.Property prop, int value)
prop
- the window property to updatevalue
- the new value for the window property
public final String getTitle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |