Class ButtonMapMask

java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.BaseMask
me.hsgamer.hscore.minecraft.gui.mask.impl.ButtonMapMask
All Implemented Interfaces:
Mask, Initializable

public class ButtonMapMask extends BaseMask
The mask with a map of slot and button
  • Constructor Details

    • ButtonMapMask

      public ButtonMapMask(@NotNull @NotNull String name)
      Create a new mask
      Parameters:
      name - the name of the mask
  • Method Details

    • addButton

      @Contract("_, _ -> this") public ButtonMapMask addButton(@NotNull @NotNull Button button, @NotNull @NotNull List<@NotNull Integer> slots)
      Add a button to the mask
      Parameters:
      button - the button
      slots - the slots
      Returns:
      this instance
    • addButton

      @Contract("_, _ -> this") public ButtonMapMask addButton(@NotNull @NotNull Button button, int... slots)
      Add a button to the mask
      Parameters:
      button - the button
      slots - the slots
      Returns:
      this instance
    • getButtons

      @NotNull public @NotNull List<Button> getButtons()
      Get the buttons
      Returns:
      the buttons
    • getButtonMap

      @NotNull public @NotNull Map<Integer,Button> getButtonMap()
      Get the button map
      Returns:
      the button map
    • generateButtons

      public Optional<Map<Integer,Button>> generateButtons(@NotNull @NotNull UUID uuid, @NotNull @NotNull InventorySize inventorySize)
      Description copied from interface: Mask
      Generate the buttons for the unique id
      Parameters:
      uuid - the unique id
      inventorySize - the size of the inventory
      Returns:
      the map contains the slots and the buttons
    • init

      public void init()
      Description copied from interface: Initializable
      Initialize some properties for the object
    • stop

      public void stop()
      Description copied from interface: Initializable
      Stop the object