public final class Menu extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
Menu.ClickListener
Registered listener which passes Inventory event
information to the menu's actions.
|
static class |
Menu.InventoryRows
Helpful enumeration to enforce slot parameter contract.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
allowPickupFromMenu
Defines default item pickup behavior for top inventory.
|
boolean |
allowShiftClickLower
Defines shift-click behavior on the lower inventory.
|
boolean |
cancelClickLower
Defines whether clicks on lower inventory are cancelled.
|
Menu.InventoryRows |
numberOfRows
Number of rows in the generated Inventory.
|
String |
title
Title of generated Inventory.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Menu(MenuBuilder menuBuilder,
org.bukkit.plugin.java.JavaPlugin javaPlugin)
Create a new Menu using the data from a builder and a plugin reference.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<org.bukkit.inventory.Inventory> |
getCurrentInventory()
Gets the Inventory at this exact moment.
|
Set<org.bukkit.entity.Player> |
getViewers()
Get all Players currently viewing this menu.
|
void |
open(org.bukkit.entity.Player player)
Open this Menu for the given player.
|
public final Menu.InventoryRows numberOfRows
public final String title
public final boolean cancelClickLower
public final boolean allowPickupFromMenu
public final boolean allowShiftClickLower
protected Menu(MenuBuilder menuBuilder, org.bukkit.plugin.java.JavaPlugin javaPlugin)
menuBuilder - a MenuBuilderjavaPlugin - your pluginpublic void open(org.bukkit.entity.Player player)
player - player to open menu forpublic Optional<org.bukkit.inventory.Inventory> getCurrentInventory()
Expressed as an Optional (no viewers = no Inventory).
Not async safe.
public Set<org.bukkit.entity.Player> getViewers()
Returns an empty set if inventory == null
Copyright © 2021. All rights reserved.