Class OneTimeAnimatedMask

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

public class OneTimeAnimatedMask extends BaseMask
The animated mask with child masks as frames, but only run once
  • Constructor Details

    • OneTimeAnimatedMask

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

    • addMask

      @Contract("_ -> this") public <T extends Mask> OneTimeAnimatedMask addMask(@NotNull @NotNull Collection<@NotNull T> masks)
      Add mask(s)
      Type Parameters:
      T - the type of the mask
      Parameters:
      masks - the mask (or frame)
      Returns:
      this instance
    • addMask

      @Contract("_ -> this") public OneTimeAnimatedMask addMask(@NotNull @NotNull Mask... mask)
      Add mask(s)
      Parameters:
      mask - the mask (or frame)
      Returns:
      this instance
    • setPeriodMillis

      @Contract("_ -> this") public OneTimeAnimatedMask setPeriodMillis(long periodMillis)
      Set the period of the animation
      Parameters:
      periodMillis - the period in milliseconds
      Returns:
      this instance
    • setPeriodTicks

      @Contract("_ -> this") public OneTimeAnimatedMask setPeriodTicks(long periodTicks)
      Set the period of the animation
      Parameters:
      periodTicks - the period in ticks
      Returns:
      this instance
    • setViewLast

      @Contract("_ -> this") public OneTimeAnimatedMask setViewLast(boolean viewLast)
      Set whether to view the last frame when the animation is finished
      Parameters:
      viewLast - true to view the last frame
    • getMasks

      @NotNull public @NotNull List<Mask> getMasks()
      Get the list of masks
      Returns:
      the masks
    • reset

      public void reset(@NotNull @NotNull UUID uuid)
      Reset the animation for the unique id
      Parameters:
      uuid - the unique id
    • generateButtons

      public Optional<Map<@NotNull Integer,@NotNull 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