Interface AdditionsMenu
public interface AdditionsMenu
Custom AdditionsPlus menu class.
-
Method Summary
Modifier and TypeMethodDescriptionGet aList
of closing actions.long
Get the cooldown of this menu in ticks.Get the message that is sent when the menu is on cooldown for a player.getItemBySlot
(int slot) Get the item by its slot.getItems()
Get aList
ofAdditionsItem
that are in this menu.getName()
Get the identifier of this menu.getNoPermissionItemBySlot
(int slot) Get the no-permission item by its slot.Get the message that is sent when the player does not have the required permission.Get aList
of opening actions.Get the open command of this menu.Get the permission of this menu.getSize()
Get the size of this custom menu.getTitle()
Get the menu title.boolean
Get whether cancel click is enabled.boolean
Get whether cancel closing is enabled.boolean
Get whether inventory hiding is enabled.boolean
Get whether the open command should be registered to Bukkit.void
openMenu
(org.bukkit.entity.Player player, boolean performOpenActions) Open the custom menu for a player.void
openMenu
(org.bukkit.entity.Player player, boolean performOpenActions, boolean skipPermissionCheck, boolean skipCooldown) Open the custom menu for a player.
-
Method Details
-
getItemBySlot
Get the item by its slot.- Parameters:
slot
- Slot to get item of.- Returns:
AdditionsItem
when found, null otherwise.
-
getNoPermissionItemBySlot
Get the no-permission item by its slot.- Parameters:
slot
- Slot to get item of.- Returns:
AdditionsItem
when found, null otherwise.
-
getName
String getName()Get the identifier of this menu.- Returns:
- Identifier of this menu.
-
isHideInventory
boolean isHideInventory()Get whether inventory hiding is enabled.- Returns:
- True when enabled, false otherwise.
-
getPermission
String getPermission()Get the permission of this menu.- Returns:
- Permission of this menu.
-
getNoPermissionMessage
String getNoPermissionMessage()Get the message that is sent when the player does not have the required permission.- Returns:
- No permission message of this menu.
-
getOpenActions
Get aList
of opening actions.- Returns:
List
of opening actions.
-
getCloseActions
Get aList
of closing actions.- Returns:
List
of closing actions.
-
getCooldown
long getCooldown()Get the cooldown of this menu in ticks.- Returns:
- Cooldown in ticks.
-
getCooldownMessage
String getCooldownMessage()Get the message that is sent when the menu is on cooldown for a player.- Returns:
- Cooldown message of this menu.
-
getTitle
String getTitle()Get the menu title.- Returns:
- Title of the menu.
-
getOpenCommand
String getOpenCommand()Get the open command of this menu.- Returns:
- Open command of this menu.
-
isRegisterOpenCommand
boolean isRegisterOpenCommand()Get whether the open command should be registered to Bukkit.- Returns:
- True when enabled, false otherwise.
-
getSize
String getSize()Get the size of this custom menu. Size could either be anInteger
, a 'CRAFTING_TABLE', or any otherInventoryType
.- Returns:
- The size of the menu.
-
isCancelClick
boolean isCancelClick()Get whether cancel click is enabled.- Returns:
- True when enabled, false otherwise.
-
isCancelClosing
boolean isCancelClosing()Get whether cancel closing is enabled.- Returns:
- True when enabled, false otherwise.
-
getStaticSlots
- Returns:
HashMap
with the slots and its items.
-
getItems
List<AdditionsItem> getItems()Get aList
ofAdditionsItem
that are in this menu.- Returns:
List
ofAdditionsItem
.
-
openMenu
void openMenu(org.bukkit.entity.Player player, boolean performOpenActions) Open the custom menu for a player.- Parameters:
player
- Player to open for.performOpenActions
- Whether to execute the open actions.
-
openMenu
void openMenu(org.bukkit.entity.Player player, boolean performOpenActions, boolean skipPermissionCheck, boolean skipCooldown) Open the custom menu for a player.- Parameters:
player
- Player to open for.performOpenActions
- Whether to execute the open actions.skipPermissionCheck
- Whether to skip the permission check.skipCooldown
- Whether to skip the cooldown check.
-