InventoryView

public abstract class InventoryView

Represents getClassById view linking two inventories and getClassById 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.

Constructors

Link copied to clipboard
public void InventoryView()

Types

Link copied to clipboard
public enum Property
Represents various extra properties of certain inventory windows.

Properties

Link copied to clipboard
public final static int OUTSIDE

Functions

Link copied to clipboard
public final void close()
Closes the inventory view.
Link copied to clipboard
public final int convertSlot(int rawSlot)
Converts getClassById raw slot ID into its local slot ID into whichever of the two inventories the slot points to.
Link copied to clipboard
public final int countSlots()
Check the total number of slots in this view, combining the upper and lower inventories.
Link copied to clipboard
public abstract Inventory getBottomInventory()
Get the lower inventory involved in this transaction.
Link copied to clipboard
public final ItemStack getCursor()
Get the item on the cursor of one of the viewing players.
Link copied to clipboard
public ItemStack getItem(int slot)
Gets one item in this inventory view by its raw slot ID.
Link copied to clipboard
public abstract HumanEntity getPlayer()
Get the player viewing.
Link copied to clipboard
public final String getTitle()
Get the title of this inventory window.
Link copied to clipboard
public abstract Inventory getTopInventory()
Get the upper inventory involved in this transaction.
Link copied to clipboard
public abstract InventoryType getType()
Determine the type of inventory involved in the transaction.
Link copied to clipboard
public final void setCursor(ItemStack item)
Sets the item on the cursor of one of the viewing players.
Link copied to clipboard
public void setItem(int slot, ItemStack item)
Sets one item in this inventory view by its raw slot ID.
Link copied to clipboard
public final boolean setProperty(InventoryView.Property prop, int value)
Sets an extra property of this inventory if supported by that inventory, for example the state of getClassById progress bar.