Package me.hsgamer.bettergui.api.menu
Class Menu
- java.lang.Object
-
- me.hsgamer.bettergui.api.menu.Menu
-
- Direct Known Subclasses:
StandardMenu
public abstract class Menu extends Object
The menu
-
-
Field Summary
Fields Modifier and Type Field Description protected Config
config
static String
MENU_SETTINGS_PATH
The path of the menu settingsprotected VariableManager
variableManager
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close(org.bukkit.entity.Player player)
Close the menuabstract void
closeAll()
Close/Clear all inventories of the typeabstract boolean
create(org.bukkit.entity.Player player, String[] args, boolean bypass)
Called when opening the menu for the playerConfig
getConfig()
Get the configString
getName()
Get the nameOptional<Menu>
getParentMenu(UUID uuid)
Get the former menu that opened this menuVariableManager
getVariableManager()
Get the variable managervoid
setParentMenu(UUID uuid, Menu menu)
Set the former menuList<String>
tabComplete(org.bukkit.entity.Player player, String[] args)
Called when the player hit TAB when typing the command to open the menuabstract void
update(org.bukkit.entity.Player player)
Called when updating the menu
-
-
-
Field Detail
-
MENU_SETTINGS_PATH
public static final String MENU_SETTINGS_PATH
The path of the menu settings- See Also:
- Constant Field Values
-
config
protected final Config config
-
variableManager
protected final VariableManager variableManager
-
-
Constructor Detail
-
Menu
protected Menu(Config config)
Create a new menu- Parameters:
config
- the config
-
-
Method Detail
-
getName
public String getName()
Get the name- Returns:
- the name
-
getConfig
public Config getConfig()
Get the config- Returns:
- the config
-
getVariableManager
public VariableManager getVariableManager()
Get the variable manager- Returns:
- the variable manager
-
create
public abstract boolean create(org.bukkit.entity.Player player, String[] args, boolean bypass)
Called when opening the menu for the player- Parameters:
player
- the player involved inargs
- the arguments from the open commandbypass
- whether the plugin ignores the permission check- Returns:
- Whether it's successful
-
tabComplete
public List<String> tabComplete(org.bukkit.entity.Player player, String[] args)
Called when the player hit TAB when typing the command to open the menu- Parameters:
player
- the player involved inargs
- the arguments from the open command- Returns:
- the list of suggestions
-
update
public abstract void update(org.bukkit.entity.Player player)
Called when updating the menu- Parameters:
player
- the player involved in
-
close
public abstract void close(org.bukkit.entity.Player player)
Close the menu- Parameters:
player
- the player involved in
-
closeAll
public abstract void closeAll()
Close/Clear all inventories of the type
-
getParentMenu
public Optional<Menu> getParentMenu(UUID uuid)
Get the former menu that opened this menu- Parameters:
uuid
- the unique id- Returns:
- the former menu
-
-