|
|
final Player | player |
|
final Inventory | inventory |
|
int | size |
| final Map< Integer, MenuInteractable > | buttons = new HashMap<>() |
◆ HopperLibMenu()
| cc.mrcl.hopperlib.Menus.HopperLibMenu.HopperLibMenu |
( |
Player | player, |
|
|
boolean | initializeImmediately ) |
|
protected |
- Parameters
-
| player | player to display the menu to. |
| initializeImmediately | whether the menu will initialize in the constructor, use "false" if your implementation will contain parameters that need to not be null on menu creation and call "initializeMenu()" as the last method in the constructor. |
◆ addInteraction()
| void cc.mrcl.hopperlib.Menus.HopperLibMenu.addInteraction |
( |
ItemStack | itemStack, |
|
|
int | slot, |
|
|
@Nullable MenuInteractable | interactable ) |
|
protected |
Adds an item to the inventory and their interactions.
◆ createListener()
| Listener cc.mrcl.hopperlib.Menus.HopperLibMenu.createListener |
( |
| ) |
|
|
protected |
Method to override the listener if you want a very specific implementation.
◆ getMenuSize()
| abstract int cc.mrcl.hopperlib.Menus.HopperLibMenu.getMenuSize |
( |
| ) |
|
|
abstractprotected |
- Returns
- The size of the menu, must be a multiple of 9 and between 9-54 (inclusive)
◆ getMenuTitle()
| abstract Component cc.mrcl.hopperlib.Menus.HopperLibMenu.getMenuTitle |
( |
| ) |
|
|
abstractprotected |
◆ getSlot()
| int cc.mrcl.hopperlib.Menus.HopperLibMenu.getSlot |
( |
int | x, |
|
|
int | y ) throws IllegalArgumentException |
|
protected |
Convenient method to get the correct slot in a square inventory. Index starting in the top-left corner of the inventory, x and y start at 1, not 0.
◆ initializeMenu()
| void cc.mrcl.hopperlib.Menus.HopperLibMenu.initializeMenu |
( |
| ) |
|
Initializes the menu, usually you want this to be the last method you call in a constructor
◆ populateMenu()
| abstract void cc.mrcl.hopperlib.Menus.HopperLibMenu.populateMenu |
( |
| ) |
|
|
abstractprotected |
◆ stopMenu()
| void cc.mrcl.hopperlib.Menus.HopperLibMenu.stopMenu |
( |
boolean | closes | ) |
|
|
protected |
Stops the menu
- Parameters
-
| closes | Whether the menu will close for the user. Useful to chain multiple menus together. |
◆ buttons
| final Map<Integer,MenuInteractable> cc.mrcl.hopperlib.Menus.HopperLibMenu.buttons = new HashMap<>() |
|
protected |
Represents the items in the inventory and their actions. Key: The slot integer. Value: The runnables per action that will be executed when the item is clicked. May be null to not possess an interaction.
The documentation for this class was generated from the following file:
- src/main/java/cc/mrcl/hopperlib/Menus/HopperLibMenu.java