public class Menu
extends java.lang.Object
implements org.bukkit.inventory.InventoryHolder
| Constructor and Description |
|---|
Menu(java.lang.String title,
int rows)
Creates a standard menu object
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMenuItem(MenuItem item,
int index)
Adds a menu item.
|
boolean |
addMenuItem(MenuItem item,
int x,
int y)
Adds a menu item to the row and slot.
|
void |
closeMenu(org.bukkit.entity.Player player)
Closes the menu of a player.
|
boolean |
exitOnClickOutside()
Get's the exitOnClickOuside, used in if() statements.
|
org.bukkit.inventory.Inventory |
getInventory() |
MenuCloseBehaviour |
getMenuCloseBehaviour()
Get's whether the menu is closed when clicked outside the border.
|
void |
openMenu(org.bukkit.entity.Player player)
Show's the menu to a player.
|
boolean |
removeMenuItem(int index)
Removes an item from the menu.
|
boolean |
removeMenuItem(int x,
int y)
Removes a menu item from a row and slot.
|
void |
setExitOnClickOutside(boolean exit)
Determines whether the menu is closed when clicked outside the border.
|
void |
setMenuCloseBehaviour(MenuCloseBehaviour menuCloseBehaviour)
Set's the menu close behavior.
|
void |
switchMenu(org.bukkit.entity.Player player,
Menu toMenu)
Switches the menu object to a different menu.
|
void |
updateMenu() |
public Menu(java.lang.String title,
int rows)
title - The title of the menu, in a string.rows - The number of rows.public void setMenuCloseBehaviour(MenuCloseBehaviour menuCloseBehaviour)
menuCloseBehaviour - The menu close behavior.public MenuCloseBehaviour getMenuCloseBehaviour()
public void setExitOnClickOutside(boolean exit)
exit - exitOnClickOutsidepublic boolean addMenuItem(MenuItem item, int x, int y)
item - MenuItemx - Sloty - Rowpublic boolean addMenuItem(MenuItem item, int index)
item - MenuItemindex - Slotpublic boolean removeMenuItem(int x,
int y)
x - Sloty - Rowpublic boolean removeMenuItem(int index)
index - Slotpublic void openMenu(org.bukkit.entity.Player player)
player - Playerpublic void closeMenu(org.bukkit.entity.Player player)
player - Playerpublic void switchMenu(org.bukkit.entity.Player player,
Menu toMenu)
player - PlayertoMenu - Menu to switch to. Menu Objectpublic org.bukkit.inventory.Inventory getInventory()
getInventory in interface org.bukkit.inventory.InventoryHolderpublic boolean exitOnClickOutside()
public void updateMenu()