public class ChestMenu
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ChestMenu.MenuClickHandler |
static interface |
ChestMenu.MenuCloseHandler |
static interface |
ChestMenu.MenuOpeningHandler |
| Constructor and Description |
|---|
ChestMenu(java.lang.String title)
Creates a new ChestMenu with the specified
Title
|
| Modifier and Type | Method and Description |
|---|---|
ChestMenu |
addItem(int slot,
org.bukkit.inventory.ItemStack item)
Adds an Item to the Inventory in that Slot
|
ChestMenu |
addItem(int slot,
org.bukkit.inventory.ItemStack item,
ChestMenu.MenuClickHandler clickHandler)
Adds an Item to the Inventory in that Slot
as well as a Click Handler
|
ChestMenu |
addMenuClickHandler(int slot,
ChestMenu.MenuClickHandler handler)
Executes a certain Action upon clicking an
Item in the Menu
|
ChestMenu |
addMenuCloseHandler(ChestMenu.MenuCloseHandler handler)
Executes a certain Action upon closing
this Menu
|
ChestMenu |
addMenuOpeningHandler(ChestMenu.MenuOpeningHandler handler)
Executes a certain Action upon opening
this Menu
|
ChestMenu |
build()
Deprecated.
|
org.bukkit.inventory.ItemStack[] |
getContents()
Returns an Array containing the Contents
of this Inventory
|
org.bukkit.inventory.ItemStack |
getItemInSlot(int slot)
Returns the ItemStack in that Slot
|
ChestMenu.MenuClickHandler |
getMenuClickHandler(int slot)
Returns the MenuClickHandler which was registered for the specified Slot
|
ChestMenu.MenuCloseHandler |
getMenuCloseHandler()
Returns the registered MenuCloseHandler
|
boolean |
isPlayerInventoryClickable()
Returns whether the Player's Inventory is
accessible while viewing this Menu
|
void |
open(org.bukkit.entity.Player... players)
Opens this Menu for the specified Player/s
|
void |
replaceExistingItem(int slot,
org.bukkit.inventory.ItemStack item)
Modifies an ItemStack in an ALREADY OPENED ChestMenu
|
void |
reset()
Resets this ChestMenu to a Point BEFORE the User interacted with it
|
ChestMenu |
setPlayerInventoryClickable(boolean clickable)
Toggles whether Players can access there
Inventory while viewing this Menu
|
org.bukkit.inventory.Inventory |
toInventory()
Converts this ChestMenu Instance into a
normal Inventory
|
public ChestMenu(java.lang.String title)
title - The title of the Menupublic ChestMenu setPlayerInventoryClickable(boolean clickable)
clickable - Whether the Player can access his Inventorypublic boolean isPlayerInventoryClickable()
public ChestMenu addItem(int slot, org.bukkit.inventory.ItemStack item)
slot - The Slot in the Inventoryitem - The Item for that Slotpublic ChestMenu addItem(int slot, org.bukkit.inventory.ItemStack item, ChestMenu.MenuClickHandler clickHandler)
slot - The Slot in the Inventoryitem - The Item for that Slothandler - The MenuClickHandler for that Slotpublic org.bukkit.inventory.ItemStack getItemInSlot(int slot)
slot - The Slot in the Inventorypublic ChestMenu addMenuClickHandler(int slot, ChestMenu.MenuClickHandler handler)
slot - The Slot in the Inventoryhandler - The MenuClickHandlerpublic ChestMenu addMenuOpeningHandler(ChestMenu.MenuOpeningHandler handler)
handler - The MenuOpeningHandlerpublic ChestMenu addMenuCloseHandler(ChestMenu.MenuCloseHandler handler)
handler - The MenuCloseHandler@Deprecated public ChestMenu build()
public org.bukkit.inventory.ItemStack[] getContents()
public void reset()
public void replaceExistingItem(int slot,
org.bukkit.inventory.ItemStack item)
slot - The Slot of the Item which will be replaceditem - The new Itempublic void open(org.bukkit.entity.Player... players)
players - The Players who will see this Menupublic ChestMenu.MenuClickHandler getMenuClickHandler(int slot)
slot - The Slot in the Inventorypublic ChestMenu.MenuCloseHandler getMenuCloseHandler()
public org.bukkit.inventory.Inventory toInventory()