Skip to content
ColonelHedgehog edited this page Jan 27, 2015 · 1 revision

Menu

How to use Menus

Read: Creating an Empty Menu

Reference

Initializers

Type A

Menu(Inventory inv)

inv: The Inventory you're using as a menu.

Methods

getInventory();

Return type: Inventory
Modifiers: public

Returns the Inventory assigned to the Menu object.

setInventory(Inventory inv);

Return type: void
Modifiers: public

inv: The Inventory to replace the exiting inventory with.

Replaces the existing Inventory associated with the Menu object.

getItemAt(Coordinates coordinates);

Return type: MenuObject
Modifiers: public

coordinates: The coordinates on the Menu to get the MenuObject from.

setMenuObjectAt(Coordinates coordinates, MenuObject, menuObject);

Return type: void
Modifiers: public

coordinates: Where to place the MenuObject.
menuObject: The MenuObject to place at the coordinates.

Places (or replaces) a MenuObject at a location.

removeMenuObjectAt(Coordinates coordinates);

Return type: void
Modifiers: public

coordinates: Where to remove the MenuObject from.

Removes all MenuObject data from a specific location (unless no MenuObject is present).

addMenuObject(MenuObject... menuObject);

Return type: void
Modifiers: public

menuObject: The MenuObject(s) to place in the Menu. Can be several, seperated by commas.

Places MenuObject(s) at the first available spot in the Menu.

@Deprecated: close();

Return type: void
Modifiers: @Deprecated, public

Closes and deregisters the Menu and deletes all data from it.

close(Player p);

Return type: void
Modifiers: public

p: The Player to close the Inventory for.

Closes the Menu's Inventory for a specific Player. If nobody is viewing the Inventory, it is deregistered and deleted.

getObjects();

Return type: HashMap<Integer, MenuObject>
Modifiers: public

Gets a HashMap with each slot and its respective MenuObject.

Clone this wiki locally