Package me.hsgamer.bettergui.api.menu
Class Menu
- java.lang.Object
-
- me.hsgamer.bettergui.api.menu.Menu
-
- Direct Known Subclasses:
BaseInventoryMenu,PredicateMenu
public abstract class Menu extends Object
The menu
-
-
Field Summary
Fields Modifier and Type Field Description protected Configconfigprotected List<StringReplacer>stringReplacersprotected InstanceVariableManagervariableManager
-
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 menuList<StringReplacer>getStringReplacers()Get the mutable string replacersInstanceVariableManagergetVariableManager()Get the variable managerStringreplace(String string, UUID uuid)Replace the stringvoidsetParentMenu(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
-
config
protected final Config config
-
variableManager
protected final InstanceVariableManager variableManager
-
stringReplacers
protected final List<StringReplacer> stringReplacers
-
-
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 InstanceVariableManager getVariableManager()
Get the variable manager- Returns:
- the variable manager
-
getStringReplacers
public List<StringReplacer> getStringReplacers()
Get the mutable string replacers- Returns:
- the string replacers
-
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
-
setParentMenu
public void setParentMenu(UUID uuid, Menu menu)
Set the former menu- Parameters:
uuid- the unique idmenu- the former menu
-
-