Class CustomItemDataService
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.CustomItemDataService
- All Implemented Interfaces:
Keyed
This Service is responsible for applying NBT data to a
SlimefunItemStack
.
This is used to ensure that the id of a SlimefunItem
is stored alongside any
ItemStack
at all times.- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
ConstructorDescriptionCustomItemDataService
(Plugin plugin, String key) This creates a newCustomItemDataService
for the givenPlugin
and the provided data key. -
Method Summary
Modifier and TypeMethodDescriptiongetItemData
(ItemStack item) getItemData
(ItemMeta meta) getKey()
boolean
hasEqualItemData
(ItemMeta meta1, ItemMeta meta2) This method compares the custom data stored on twoItemMeta
objects.void
setItemData
(ItemStack item, String id) This method stores the given id on the providedItemStack
via persistent data.void
setItemData
(ItemMeta meta, String id) This method stores the given id on the providedItemMeta
via persistent data.
-
Constructor Details
-
CustomItemDataService
This creates a newCustomItemDataService
for the givenPlugin
and the provided data key.- Parameters:
plugin
- ThePlugin
for this service to usekey
- The key under which to store data
-
-
Method Details