Package net.tnemc.item.providers
Interface ItemProvider<T>
- Type Parameters:
T- The implementation-specific type of this item stack.
- All Superinterfaces:
Identifiable
- All Known Implementing Classes:
ItemAdderProvider,MMOItemProvider,NexoProvider,NovaProvider,OraxenProvider,SlimefunProvider,VanillaProvider,VanillaProvider
An ItemProvider represents a provider used to give the Locale stack, and provide various item stack
comparisons. This could be used for something such as ItemsAdder, etc.
- Since:
- 0.2.0.0
- Author:
- creatorfromhell
-
Method Summary
Modifier and TypeMethodDescriptionbooleanappliesTo(AbstractItemStack<? extends T> serialized, T item) Checks if the given serialized item stack applies to the specified item.default booleancomponentsEqual(AbstractItemStack<? extends T> original, AbstractItemStack<? extends T> compare) Checks if the components of two items are equal.default booleancomponentsEqual(AbstractItemStack<? extends T> original, T compare) Checks if the components of two items are equal.default booleancomponentsEqual(T original, T compare) Checks if the components of two items are equal.default Tlocale(AbstractItemStack<? extends T> original) locale(AbstractItemStack<? extends T> original, int amount) Creates a copy of the original item stack with a specified amount.default booleansimilar(AbstractItemStack<? extends T> original, AbstractItemStack<? extends T> compare) Returns true if the provided item is similar to this.booleansimilar(AbstractItemStack<? extends T> original, T compare) Checks if the provided item stack is similar to the original item stack.Methods inherited from interface net.tnemc.item.platform.Identifiable
identifier
-
Method Details
-
appliesTo
Checks if the given serialized item stack applies to the specified item.- Parameters:
serialized- The serialized item stack to check against the item.item- The item to check against.- Returns:
- True if the serialized item stack applies to the item, false otherwise.
- Since:
- 0.2.0.0
-
similar
Checks if the provided item stack is similar to the original item stack.- Parameters:
original- The original item stack to compare against.compare- The item stack to compare.- Returns:
- True if the two item stacks are similar, otherwise false.
- Since:
- 0.2.0.0
-
similar
default boolean similar(AbstractItemStack<? extends T> original, AbstractItemStack<? extends T> compare) Returns true if the provided item is similar to this. An item is similar if the basic information is the same, except for the amount. What this includes: - material - display - modelData - flags - lore - attributes - enchantments What this does not include: - Item Data/components.- Parameters:
compare- The stack to compare.- Returns:
- True if the two are similar, otherwise false.
- Since:
- 0.2.0.0, 0.2.0.0
-
componentsEqual
default boolean componentsEqual(AbstractItemStack<? extends T> original, AbstractItemStack<? extends T> compare) Checks if the components of two items are equal.- Parameters:
original- The original item to compare.compare- The item to compare against the original.- Returns:
- true if the components of the two items are equal, otherwise false.
- Since:
- 0.2.0.0
-
componentsEqual
Checks if the components of two items are equal.- Parameters:
original- The original item to compare.compare- The item to compare against the original.- Returns:
- true if the components of the two items are equal, otherwise false.
- Since:
- 0.2.0.0
-
componentsEqual
Checks if the components of two items are equal.- Parameters:
original- The original item to compare.compare- The item to compare against the original.- Returns:
- true if the components of the two items are equal, otherwise false.
- Since:
- 0.2.0.0
-
locale
Creates a copy of the original item stack with a specified amount.- Parameters:
original- The original item stack to copy.amount- The amount for the new item stack.- Returns:
- A new item stack with the specified amount.
- Since:
- 0.2.0.0
-
locale
- Returns:
- An instance of the implementation's locale version of AbstractItemStack.
- Since:
- 0.2.0.0, 0.2.0.0, 0.2.0.0
-