Class PredicateMask

java.lang.Object
io.github.projectunified.craftux.mask.PredicateMask
All Implemented Interfaces:
Element, Mask

public class PredicateMask extends Object implements Element, Mask
The mask with predicate
  • Constructor Details

    • PredicateMask

      public PredicateMask()
  • Method Details

    • setViewPredicate

      public void setViewPredicate(@NotNull @NotNull Predicate<@NotNull UUID> viewPredicate)
      Set the view predicate
      Parameters:
      viewPredicate - the view predicate
    • getMask

      @NotNull public @NotNull Mask getMask()
      Get the mask
      Returns:
      the mask
    • setMask

      public void setMask(@NotNull @NotNull Mask mask)
      Set the mask
      Parameters:
      mask - the mask
    • getFallbackMask

      @NotNull public @NotNull Mask getFallbackMask()
      Get the fallback mask
      Returns:
      the fallback mask
    • setFallbackMask

      public void setFallbackMask(@NotNull @NotNull Mask fallbackMask)
      Set the fallback mask
      Parameters:
      fallbackMask - the fallback mask
    • init

      public void init()
      Description copied from interface: Element
      Initialize the element. Should be called before adding to the GUI.
      Specified by:
      init in interface Element
    • stop

      public void stop()
      Description copied from interface: Element
      Stop the element. Should be called after removing from the GUI.
      Specified by:
      stop in interface Element
    • apply

      @Nullable public @Nullable Map<Position,Consumer<ActionItem>> apply(@NotNull @NotNull UUID uuid)
      Description copied from interface: Mask
      Get a map of positions to action item consumers
      Specified by:
      apply in interface Mask
      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)