Class OneTimeAnimatedMask
java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.BaseMask
me.hsgamer.hscore.minecraft.gui.mask.impl.OneTimeAnimatedMask
- All Implemented Interfaces:
Mask,me.hsgamer.hscore.ui.property.IdentifiedUpdatable,me.hsgamer.hscore.ui.property.Initializable
public class OneTimeAnimatedMask
extends BaseMask
implements me.hsgamer.hscore.ui.property.IdentifiedUpdatable
The animated mask with child masks as frames, but only run once
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Mask>
OneTimeAnimatedMaskaddMask(@NotNull Collection<@NotNull T> masks) Add mask(s)Add mask(s)generateButtons(@NotNull UUID uuid, @NotNull InventorySize inventorySize) Generate the buttons for the unique idgetMasks()Get the list of masksvoidinit()voidReset the animation for the unique idsetPeriodMillis(long periodMillis) Set the period of the animationsetPeriodTicks(long periodTicks) Set the period of the animationsetViewLast(boolean viewLast) Set whether to view the last frame when the animation is finishedvoidstop()void
-
Constructor Details
-
OneTimeAnimatedMask
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
Add mask(s)- Parameters:
mask- the mask (or frame)- Returns:
- this instance
-
setPeriodMillis
Set the period of the animation- Parameters:
periodMillis- the period in milliseconds- Returns:
- this instance
-
setPeriodTicks
Set the period of the animation- Parameters:
periodTicks- the period in ticks- Returns:
- this instance
-
setViewLast
Set whether to view the last frame when the animation is finished- Parameters:
viewLast- true to view the last frame
-
getMasks
Get the list of masks- Returns:
- the masks
-
reset
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:MaskGenerate the buttons for the unique id- Specified by:
generateButtonsin interfaceMask- Parameters:
uuid- the unique idinventorySize- the size of the inventory- Returns:
- the map contains the slots and the buttons
-
update
- Specified by:
updatein interfaceme.hsgamer.hscore.ui.property.IdentifiedUpdatable
-
init
public void init()- Specified by:
initin interfaceme.hsgamer.hscore.ui.property.Initializable
-
stop
public void stop()- Specified by:
stopin interfaceme.hsgamer.hscore.ui.property.Initializable
-