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
ConstructorsConstructorDescriptionCustomItemDataService(Plugin plugin, String key) This creates a newCustomItemDataServicefor the givenPluginand the provided data key. -
Method Summary
Modifier and TypeMethodDescriptiongetItemData(ItemStack item) getItemData(ItemMeta meta) getKey()booleanhasEqualItemData(ItemMeta meta1, ItemMeta meta2) This method compares the custom data stored on twoItemMetaobjects.voidsetItemData(ItemStack item, String id) This method stores the given id on the providedItemStackvia persistent data.voidsetItemData(ItemMeta meta, String id) This method stores the given id on the providedItemMetavia persistent data.
-
Constructor Details
-
CustomItemDataService
This creates a newCustomItemDataServicefor the givenPluginand the provided data key.- Parameters:
plugin- ThePluginfor this service to usekey- The key under which to store data
-
-
Method Details