Class HotbarMenu
java.lang.Object
net.playavalon.mythicdungeons.player.Hotbar
net.playavalon.mythicdungeons.menu.HotbarMenu
- All Implemented Interfaces:
org.bukkit.event.Listener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMenuItem
(int slot, MenuItem item) void
addMenuItem
(MenuItem item) void
Used to build and populate the hotbar with items.void
Used to set up and assign code to perform upon a chat message being sent while the chat listener is active.void
WARNING :: UNIMPLEMENTED Used to set up and assign code to perform upon scrolling over to a hotbar menu item.void
Used to set up and assign code to perform upon a button being selected.void
onChat
(org.bukkit.event.player.AsyncPlayerChatEvent event) void
onClickHotbarItem
(org.bukkit.event.inventory.InventoryClickEvent event) void
onClickHotbarItem
(org.bukkit.event.inventory.InventoryCreativeEvent event) void
onDragHotbarItem
(org.bukkit.event.inventory.InventoryDragEvent event) void
onHover
(org.bukkit.event.player.PlayerItemHeldEvent event) void
onSlotSelect
(org.bukkit.event.player.PlayerInteractAtEntityEvent event) void
onSlotSelect
(org.bukkit.event.player.PlayerInteractEvent event) void
removeMenuItem
(int slot) void
setHotbar
(org.bukkit.inventory.PlayerInventory inv) void
setHotbar
(org.bukkit.inventory.PlayerInventory inv, boolean setHand) void
updateMenu
(MythicPlayer aPlayer) Methods inherited from class net.playavalon.mythicdungeons.player.Hotbar
addItem, empty, getItem, getItems, setItem, setItems, updateItems, updateSlot
-
Constructor Details
-
HotbarMenu
public HotbarMenu()
-
-
Method Details
-
setHotbar
public void setHotbar(org.bukkit.inventory.PlayerInventory inv) -
setHotbar
public void setHotbar(org.bukkit.inventory.PlayerInventory inv, boolean setHand) -
removeMenuItem
public void removeMenuItem(int slot) -
buildMenu
public void buildMenu()Used to build and populate the hotbar with items. This is where you set up and assign the buttons. Use `setItem(slot, button.getItem())` to assign the button to a slot, where `slot` = the position in the hotbar (0-8), and `button` = a MenuButton object.- See Also:
-
updateMenu
-
initSelectActions
public void initSelectActions()Used to set up and assign code to perform upon a button being selected. You can use `AvalonPlayer.setChatListening(true)` in here if you want to allow player input via text. Override `initChatActions` to use the chat message. Use `selectActions.put(buttonID, clickEvent -> { [code here] })` to assign an action to a buttonID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon this button being right-clicked. `clickEvent` corresponds with the PlayerInteractEvent associated with this message. You can use it to retrieve the player and other data about the right-click. -
initChatActions
public void initChatActions()Used to set up and assign code to perform upon a chat message being sent while the chat listener is active. Use `chatActions.put(buttonID, chatEvent -> { [code here] })` to assign an action to a buttonID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon the player submitting a chat message. `chatEvent` corresponds with the AsyncPlayerChatEvent associated with this message. You can use it to retrieve the player, message, etc. -
initHoverActions
public void initHoverActions()WARNING :: UNIMPLEMENTED Used to set up and assign code to perform upon scrolling over to a hotbar menu item. Use `hoverActions.put(buttonID, hoverEvent -> { [code here] })` to assign an action to a button ID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon the player hovering over this hotbar slot. Useful for informing the player of information about the option they hovered over. `hoverEvent` corresponds with a PlayerItemHeldEvent associated with this message. You can use it to retrieve the player and other data about the slots. -
onSlotSelect
public void onSlotSelect(org.bukkit.event.player.PlayerInteractEvent event) -
onSlotSelect
public void onSlotSelect(org.bukkit.event.player.PlayerInteractAtEntityEvent event) -
onChat
public void onChat(org.bukkit.event.player.AsyncPlayerChatEvent event) -
onClickHotbarItem
public void onClickHotbarItem(org.bukkit.event.inventory.InventoryClickEvent event) -
onClickHotbarItem
public void onClickHotbarItem(org.bukkit.event.inventory.InventoryCreativeEvent event) -
onDragHotbarItem
public void onDragHotbarItem(org.bukkit.event.inventory.InventoryDragEvent event) -
onHover
public void onHover(org.bukkit.event.player.PlayerItemHeldEvent event)
-