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 Configconfigstatic StringMENU_SETTINGS_PATHThe path of the menu settingsprotected VariableManagervariableManager
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclose(org.bukkit.entity.Player player)Close the menuabstract voidcloseAll()Close/Clear all inventories of the typeabstract booleancreate(org.bukkit.entity.Player player, String[] args, boolean bypass)Called when opening the menu for the playerConfiggetConfig()Get the configStringgetName()Get the nameOptional<Menu>getParentMenu(UUID uuid)Get the former menu that opened this menuVariableManagergetVariableManager()Get the variable managervoidsetParentMenu(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 voidupdate(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
-
-