ItemsRegistry

Service for getting items by theirs ID. Also, can be used to match ID with item.

Properties

Link copied to clipboard
abstract val knownIds: Collection<String>

Returns all known item IDs.

Inherited properties

Link copied to clipboard
open val id: String

Returns the ID of the service. It should match regex [a-z0-9._-].

Link copied to clipboard
open val isEnabled: Boolean

Returns true if the service is initialized may be used. Default implementation always returns true.

Functions

Link copied to clipboard
open fun getItem(itemId: String): ItemStackT?

Returns item by given itemId, or null if the ID not found in this registry.

open fun getItem(itemId: String, payload: Any?): ItemStackT?

Returns item stack with specified payload by given itemId, or null if the ID not found in this registry.

open fun getItem(itemId: String, amount: Int): ItemStackT?

Returns item stack with specified amount by given itemId, or null if ID not found in this registry.

abstract fun getItem(itemId: String, payload: Any?, amount: Int): ItemStackT?

Returns item stack with specified amount and payload by given itemId, or null if ID not found in this registry.

Link copied to clipboard
abstract fun getItemId(item: ItemStackT): String?

Returns ID representing given item, or null if the ID not found in this registry.

Link copied to clipboard
abstract fun isItemExists(itemId: String): Boolean

Returns true if item with given itemId exists.

Link copied to clipboard
open fun isSameItem(item: ItemStackT, itemId: String): Boolean

Returns true if given item represented with given itemId.