Class SingleMask
java.lang.Object
io.github.projectunified.craftux.mask.SingleMask
A mask that places a single button at a specified position.
Useful for creating simple GUI elements with one interactive item.
Example usage:
SingleMask mask = new SingleMask(Position.of(0, 0), new SimpleButton(new ItemStack(Material.ANVIL)));
Map<Position, Consumer<ActionItem>> actions = mask.apply(playerUUID);
-
Field Details
-
position
-
button
-
-
Constructor Details
-
SingleMask
Create a new mask- Parameters:
position- the positionbutton- the button
-
-
Method Details
-
init
public void init()Description copied from interface:ElementInitialize the element. Should be called before adding to the GUI. -
stop
public void stop()Description copied from interface:ElementStop the element. Should be called after removing from the GUI. -
apply
Description copied from interface:MaskGet a map of positions to action item consumers
-