Interface Mask
- All Known Implementing Classes:
AnimatedMask,ButtonPaginatedMask,HybridMask,ListMask,MaskPaginatedMask,MultiMask,MultiPositionMask,PaginatedMask,PlaceholderMask,PredicateMask,SequencePaginatedMask,SimpleButtonMask,SingleMask
public interface Mask
Represents a mask that maps positions to action item consumers for a given player UUID.
Masks define the layout and behavior of GUI elements in a grid-based interface.
Example implementation:
public class MyMask implements Mask {
@Override
public Map<Position, Consumer<ActionItem>> apply(UUID uuid) {
Map<Position, Consumer<ActionItem>> map = new HashMap<>();
map.put(Position.of(0, 0), actionItem -> {
actionItem.setItem("Button at 0,0");
actionItem.setAction(event -> System.out.println("Clicked at 0,0"));
});
return map;
}
}
-
Method Summary
Modifier and TypeMethodDescription@Nullable Map<Position, Consumer<ActionItem>> Get a map of positions to action item consumersdefault @Nullable Map<Position, ActionItem> getActionMap(UUID uuid) Get a map of positions to action items
-
Method Details
-
apply
Get a map of positions to action item consumers- Parameters:
uuid- the uuid of the player- Returns:
- the map, or null if no items should be displayed. Can return null in a conditional case (e.g. predicate mask)
-
getActionMap
Get a map of positions to action items- Parameters:
uuid- the uuid of the player- Returns:
- the map, or null if no items should be displayed. Can return null in a conditional case (e.g. predicate mask)
-