Class BaseTag<T extends Keyed, C extends BaseTag<T,C>>

java.lang.Object
io.papermc.paper.tag.BaseTag<T,C>
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, Keyed, Tag<T>
Direct Known Subclasses:
EntitySetTag, MaterialSetTag

public abstract class BaseTag<T extends Keyed, C extends BaseTag<T,C>> extends Object implements Tag<T>
Since:
1.16.4
  • Field Details

  • Constructor Details

    • BaseTag

      public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Predicate<T> filter)
      Since:
      1.16.4
    • BaseTag

      public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull T... values)
      Since:
      1.16.4
    • BaseTag

      public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Collection<T> values)
      Since:
      1.16.4
    • BaseTag

      public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Collection<T> values, @NotNull @NotNull Predicate<T>... globalPredicates)
      Since:
      1.16.4
  • Method Details

    • lock

      @NotNull public C lock()
      Since:
      1.18.1
    • isLocked

      public boolean isLocked()
      Since:
      1.18.1
    • getKey

      @NotNull public @NotNull NamespacedKey getKey()
      Description copied from interface: Keyed
      Return the namespaced identifier for this object.
      Specified by:
      getKey in interface Keyed
      Returns:
      this object's key
      Since:
      1.16.4
    • getValues

      @NotNull public @NotNull Set<T> getValues()
      Description copied from interface: Tag
      Gets an immutable set of all tagged items.
      Specified by:
      getValues in interface Tag<T extends Keyed>
      Returns:
      set of tagged items
      Since:
      1.16.4
    • isTagged

      public boolean isTagged(@NotNull T item)
      Description copied from interface: Tag
      Returns whether or not this tag has an entry for the specified item.
      Specified by:
      isTagged in interface Tag<T extends Keyed>
      Parameters:
      item - to check
      Returns:
      if it is tagged
      Since:
      1.16.4
    • add

      @NotNull public C add(@NotNull @NotNull Tag<T>... tags)
      Since:
      1.16.4
    • add

      @NotNull public C add(@NotNull T... values)
      Since:
      1.16.4
    • add

      @NotNull public C add(@NotNull @NotNull Collection<T> collection)
      Since:
      1.16.4
    • add

      @NotNull public C add(@NotNull @NotNull Predicate<T> filter)
      Since:
      1.16.4
    • contains

      @NotNull public C contains(@NotNull @NotNull String with)
      Since:
      1.16.4
    • endsWith

      @NotNull public C endsWith(@NotNull @NotNull String with)
      Since:
      1.16.4
    • startsWith

      @NotNull public C startsWith(@NotNull @NotNull String with)
      Since:
      1.16.4
    • not

      @NotNull public C not(@NotNull @NotNull Tag<T>... tags)
      Since:
      1.16.4
    • not

      @NotNull public C not(@NotNull T... values)
      Since:
      1.16.4
    • not

      @NotNull public C not(@NotNull @NotNull Collection<T> values)
      Since:
      1.16.4
    • not

      @NotNull public C not(@NotNull @NotNull Predicate<T> filter)
      Since:
      1.16.4
    • notContains

      @NotNull public C notContains(@NotNull @NotNull String with)
      Since:
      1.16.4
    • notEndsWith

      @NotNull public C notEndsWith(@NotNull @NotNull String with)
      Since:
      1.16.4
    • notStartsWith

      @NotNull public C notStartsWith(@NotNull @NotNull String with)
      Since:
      1.16.4
    • ensureSize

      @NotNull public C ensureSize(@NotNull @NotNull String label, int size)
      Since:
      1.16.4
    • getAllPossibleValues

      @NotNull @Internal protected abstract @NotNull Set<T> getAllPossibleValues()
    • getName

      @NotNull @Internal protected abstract @NotNull String getName(@NotNull T value)