Package me.hsgamer.bettergui.menu
Class BaseMenu
- java.lang.Object
-
- me.hsgamer.bettergui.api.menu.Menu
-
- me.hsgamer.bettergui.api.menu.StandardMenu
-
- me.hsgamer.bettergui.menu.BaseMenu
-
- Direct Known Subclasses:
BaseInventoryMenu
public abstract class BaseMenu extends StandardMenu
AStandardMenu
with some basic features. Included: -open-action
: The action to run when the menu is opened. Need to be called manually. -close-action
: The action to run when the menu is closed. Need to be called manually. -view-requirement
: The requirement to view the menu -close-requirement
: The requirement to close the menu. Need to be called manually. -permission
: The permission to view the menu -argument-processor
: The argument processor for the menu -command
: The command to open the menu
-
-
Field Summary
Fields Modifier and Type Field Description protected ArgumentHandler
argumentHandler
protected ActionApplier
closeActionApplier
protected RequirementApplier
closeRequirementApplier
protected ActionApplier
openActionApplier
protected List<org.bukkit.permissions.Permission>
permissions
protected RequirementApplier
viewRequirementApplier
-
Fields inherited from class me.hsgamer.bettergui.api.menu.StandardMenu
configSettings, menuSettings
-
Fields inherited from class me.hsgamer.bettergui.api.menu.Menu
config, MENU_SETTINGS_PATH, variableManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
create(org.bukkit.entity.Player player, String[] args, boolean bypass)
Called when opening the menu for the playerprotected abstract boolean
createChecked(org.bukkit.entity.Player player, String[] args, boolean bypass)
Create the menu after checking the conditionsArgumentHandler
getArgumentHandler()
List<String>
tabComplete(org.bukkit.entity.Player player, String[] args)
Called when the player hit TAB when typing the command to open the menu-
Methods inherited from class me.hsgamer.bettergui.api.menu.Menu
close, closeAll, getConfig, getName, getParentMenu, getVariableManager, setParentMenu, update
-
-
-
-
Field Detail
-
openActionApplier
protected final ActionApplier openActionApplier
-
closeActionApplier
protected final ActionApplier closeActionApplier
-
viewRequirementApplier
protected final RequirementApplier viewRequirementApplier
-
closeRequirementApplier
protected final RequirementApplier closeRequirementApplier
-
permissions
protected final List<org.bukkit.permissions.Permission> permissions
-
argumentHandler
protected final ArgumentHandler argumentHandler
-
-
Constructor Detail
-
BaseMenu
protected BaseMenu(Config config)
-
-
Method Detail
-
createChecked
protected abstract boolean createChecked(org.bukkit.entity.Player player, String[] args, boolean bypass)
Create the menu after checking the conditions- Parameters:
player
- the playerargs
- the argumentsbypass
- if the requirement should be bypassed- Returns:
- true if the menu is created
- See Also:
create(Player, String[], boolean)
-
create
public boolean create(org.bukkit.entity.Player player, String[] args, boolean bypass)
Description copied from class:Menu
Called when opening the menu for the player
-
tabComplete
public List<String> tabComplete(org.bukkit.entity.Player player, String[] args)
Description copied from class:Menu
Called when the player hit TAB when typing the command to open the menu- Overrides:
tabComplete
in classMenu
- Parameters:
player
- the player involved inargs
- the arguments from the open command- Returns:
- the list of suggestions
-
getArgumentHandler
public ArgumentHandler getArgumentHandler()
-
-