Class ItemPredicate.Builder

java.lang.Object
com.github.darksoulq.abyssallib.world.item.ItemPredicate.Builder
Enclosing class:
ItemPredicate

public static class ItemPredicate.Builder extends Object
A fluent builder pattern class designed to easily construct ItemPredicate instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • id

      public ItemPredicate.Builder id(net.kyori.adventure.key.Key id)
      Mandates that the item matches a specific base Key.
      Parameters:
      id - The Key to match.
      Returns:
      This builder instance.
    • material

      public ItemPredicate.Builder material(org.bukkit.Material material)
      Mandates that the item matches a specific vanilla material.
      Parameters:
      material - The Material to match.
      Returns:
      This builder instance.
    • without

      public ItemPredicate.Builder without(Condition<net.kyori.adventure.key.Key> condition)
      Adds an exclusionary condition requiring the absence of specific components.
      Parameters:
      condition - The Condition wrapping a component Key.
      Returns:
      This builder instance.
    • with

      public ItemPredicate.Builder with(Condition<net.kyori.adventure.key.Key> condition)
      Adds an inclusionary condition requiring the presence of specific components.
      Parameters:
      condition - The Condition wrapping a component Key.
      Returns:
      This builder instance.
    • value

      public ItemPredicate.Builder value(Condition<DataComponent<?>> condition)
      Adds a value-matching condition requiring exact component equivalence.
      Parameters:
      condition - The Condition wrapping a data component instance.
      Returns:
      This builder instance.
    • check

      public ItemPredicate.Builder check(Condition<ItemPredicate> condition)
      Adds a nested predicate condition.
      Parameters:
      condition - The Condition wrapping a nested predicate.
      Returns:
      This builder instance.
    • without

      public ItemPredicate.Builder without(net.kyori.adventure.key.Key identifier)
      Requires the strict absence of a specific component Key.
      Parameters:
      identifier - The Key of the component that must be absent.
      Returns:
      This builder instance.
    • with

      public ItemPredicate.Builder with(net.kyori.adventure.key.Key identifier)
      Requires the strict presence of a specific component Key.
      Parameters:
      identifier - The Key of the component that must be present.
      Returns:
      This builder instance.
    • value

      public <T> ItemPredicate.Builder value(DataComponent<T> component)
      Requires an exact value match against a provided data component.
      Type Parameters:
      T - The data type of the component.
      Parameters:
      component - The DataComponent to match against.
      Returns:
      This builder instance.
    • check

      public ItemPredicate.Builder check(ItemPredicate predicate)
      Evaluates a sub-predicate against the item.
      Parameters:
      predicate - The nested ItemPredicate to test.
      Returns:
      This builder instance.
    • withAny

      public ItemPredicate.Builder withAny(net.kyori.adventure.key.Key... identifiers)
      Requires the presence of at least one of the provided component Keys.
      Parameters:
      identifiers - The varargs array of component Keys to check.
      Returns:
      This builder instance.
    • withAny

      public ItemPredicate.Builder withAny(Collection<net.kyori.adventure.key.Key> identifiers)
      Requires the presence of at least one of the provided component Keys.
      Parameters:
      identifiers - The collection of component Keys to check.
      Returns:
      This builder instance.
    • valueAny

      public ItemPredicate.Builder valueAny(DataComponent<?>... components)
      Requires an exact value match against at least one of the provided components.
      Parameters:
      components - The varargs array of DataComponent instances to check.
      Returns:
      This builder instance.
    • checkAny

      public ItemPredicate.Builder checkAny(ItemPredicate... predicates)
      Requires the item to satisfy at least one of the provided sub-predicates.
      Parameters:
      predicates - The varargs array of nested ItemPredicates to check.
      Returns:
      This builder instance.
    • build

      public ItemPredicate build()
      Finalizes construction and returns the built ItemPredicate.
      Returns:
      The configured ItemPredicate instance.