Class PlaceholderMask

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

public class PlaceholderMask extends BaseMask
The placeholder mask
Used for per-user masks
  • Field Details

    • userMasks

      protected final Map<UUID,Mask> userMasks
    • defaultMask

      protected Mask defaultMask
    • initDefaultMask

      protected boolean initDefaultMask
  • Constructor Details

    • PlaceholderMask

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

    • 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
    • setMask

      public void setMask(@NotNull @NotNull UUID uuid, @Nullable @Nullable Mask mask)
      Set the mask for the unique id
      Parameters:
      uuid - the unique id
      mask - the mask
    • getMask

      @Nullable public @Nullable Mask getMask(@NotNull @NotNull UUID uuid)
      Get the mask for the unique id
      Parameters:
      uuid - the unique id
      Returns:
      the mask
    • getDefaultMask

      @NotNull public @NotNull Mask getDefaultMask()
      Get the default mask
      Returns:
      the default mask
    • setDefaultMask

      @Contract("_ -> this") public PlaceholderMask setDefaultMask(@NotNull @NotNull Mask defaultMask)
      Set the default mask
      Parameters:
      defaultMask - the default mask
      Returns:
      this instance
    • setInitDefaultMask

      @Contract("_ -> this") public PlaceholderMask setInitDefaultMask(boolean initDefaultMask)
      Should the default mask be initialized?
      Parameters:
      initDefaultMask - true if yes
      Returns:
      this instance
    • getUserMasks

      @NotNull public @NotNull Map<@NotNull UUID,@NotNull Mask> getUserMasks()
      Get the user-mask map
      Returns:
      the user-mask map