Class SimpleButtonMap
java.lang.Object
me.hsgamer.hscore.minecraft.gui.map.simple.SimpleButtonMap
- All Implemented Interfaces:
Function<@NotNull InventoryContext,,@NotNull Map<Integer, ActionItem>> GUIElement
public class SimpleButtonMap
extends Object
implements GUIElement, Function<@NotNull InventoryContext,@NotNull Map<Integer,ActionItem>>
A simple button map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Map<Integer, ActionItem> apply(@NotNull InventoryContext context) @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> Get the default buttonvoidinit()Initialize the element.voidsetButton(int x, int y, @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the buttonvoidsetButton(int slot, @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the buttonvoidsetButton(InventoryPosition position, @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the buttonvoidsetDefaultButton(@NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> defaultButton) Set the default buttonvoidstop()Stop the element.
-
Constructor Details
-
SimpleButtonMap
public SimpleButtonMap()
-
-
Method Details
-
setButton
public void setButton(int slot, @NotNull @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the button- Parameters:
slot- the slotbutton- the button
-
setButton
public void setButton(int x, int y, @NotNull @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the button- Parameters:
x- the x coordinatey- the y coordinatebutton- the button
-
setButton
public void setButton(InventoryPosition position, @NotNull @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> button) Set the button- Parameters:
position- the positionbutton- the button
-
getDefaultButton
@NotNull public @NotNull Function<@NotNull InventoryContext,@Nullable ActionItem> getDefaultButton()Get the default button- Returns:
- the button
-
setDefaultButton
public void setDefaultButton(@NotNull @NotNull Function<@NotNull InventoryContext, @Nullable ActionItem> defaultButton) Set the default button- Parameters:
defaultButton- the button
-
init
public void init()Description copied from interface:GUIElementInitialize the element. Should be called before adding to the GUI.- Specified by:
initin interfaceGUIElement
-
stop
public void stop()Description copied from interface:GUIElementStop the element. Should be called after removing from the GUI.- Specified by:
stopin interfaceGUIElement
-
apply
- Specified by:
applyin interfaceFunction<@NotNull InventoryContext,@NotNull Map<Integer, ActionItem>>
-