Class AnimatedMask

java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.BaseMask
me.hsgamer.hscore.minecraft.gui.mask.impl.AnimatedMask
All Implemented Interfaces:
Mask, me.hsgamer.hscore.ui.property.IdentifiedUpdatable, me.hsgamer.hscore.ui.property.Initializable

public class AnimatedMask extends BaseMask implements me.hsgamer.hscore.ui.property.IdentifiedUpdatable
The animated mask with child masks as frames
  • Constructor Details

    • AnimatedMask

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

    • addMask

      @Contract("_ -> this") public <T extends Mask> AnimatedMask 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 AnimatedMask addMask(@NotNull @NotNull Mask... mask)
      Add mask(s)
      Parameters:
      mask - the mask (or frame)
      Returns:
      this instance
    • setPeriodMillis

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

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

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

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

      public boolean canView(@NotNull @NotNull UUID uuid)
      Description copied from interface: Mask
      Check if the target can view the mask
      Specified by:
      canView in interface Mask
      Parameters:
      uuid - the unique id of the target
      Returns:
      true if the target can view the mask
    • init

      public void init()
      Specified by:
      init in interface me.hsgamer.hscore.ui.property.Initializable
    • stop

      public void stop()
      Specified by:
      stop in interface me.hsgamer.hscore.ui.property.Initializable
    • update

      public void update(@NotNull @NotNull UUID uuid)
      Specified by:
      update in interface me.hsgamer.hscore.ui.property.IdentifiedUpdatable