Interface CustomItemTagContainer


  • @Deprecated
    public interface CustomItemTagContainer
    Deprecated.
    this API part has been replaced by the PersistentDataHolder API. Please use PersistentDataHolder instead of this.
    This interface represents a map like object, capable of storing custom tags in it.
    • Method Detail

      • hasCustomTag

        <T,​Z> boolean hasCustomTag​(@NotNull
                                         @NotNull NamespacedKey key,
                                         @NotNull
                                         @NotNull ItemTagType<T,​Z> type)
        Deprecated.
        Returns if the item meta has a custom tag registered matching the provided parameters. This method will only return if the found value has the same primitive data type as the provided key. Storing a value using a custom ItemTagType implementation will not store the complex data type. Therefore storing a UUID (by storing a byte[]) will match hasCustomTag("key" , ItemTagType.BYTE_ARRAY). Likewise a stored byte[] will always match your UUID ItemTagType even if it is not 16 bytes long. This method is only usable for custom object keys. Overwriting existing tags, like the the display name, will not work as the values are stored using your namespace.
        Type Parameters:
        T - the generic type of the stored primitive
        Z - the generic type of the eventually created complex object
        Parameters:
        key - the key the value is stored under
        type - the type which primitive storage type has to match the value
        Returns:
        if a value
        Throws:
        NullPointerException - if the key to look up is null
        NullPointerException - if the type to cast the found object to is null
      • isEmpty

        boolean isEmpty()
        Deprecated.
        Returns if the container instance is empty, therefore has no entries inside it.
        Returns:
        the boolean