Package com.nexomc.nexo.api
Object NexoItems
-
- All Implemented Interfaces:
public class NexoItems
-
-
Method Summary
Modifier and Type Method Description final static UnitloadItems()final UnitreloadItem(String itemId)final static UnitregisterUpdateCallback(Key key, UpdateCallback callback)This lets plugin-developers register logic that will run on an item anytime it is updated It can run before or after Nexo has updated an item. final static UnitregisterUpdateCallback(Key key, Function1<ItemStack, ItemStack> preUpdate, Function1<ItemStack, ItemStack> postUpdate)final static UnitregisterUpdateCallback(Key key, Function<ItemStack, ItemStack> preUpdate, TriFunction<String, ItemStack, ItemStack, ItemStack> postUpdate)This lets plugin-developers register logic that will run on an item anytime it is updated It can run before or after Nexo has updated an item. final static UnitunregisterUpdateCallback(Key key)final static ItemStackupdateItem(ItemStack item)final static StringidFromItem(ItemBuilder item)final static StringidFromItem(ItemStack item)final static Booleanexists(String itemId)final static Booleanexists(ItemStack itemStack)final static BooleanisSameId(ItemStack firstStack, ItemStack secondStack)Check if two ItemStacks are the same NexoItem If neither ItemStack is a NexoItem, this returns true as well final static ItemBuilderitemFromId(String id)final static Optional<ItemBuilder>optionalItemFromId(String id)final static ItemBuilderbuilderFromItem(ItemStack item)final static List<ItemBuilder>unexcludedItems(File file)final static BooleanhasMechanic(String itemID, String mechanicID)final static Map<File, Map<String, ItemBuilder>>itemMap()final static Map<String, ItemBuilder>entries()final static Set<ItemBuilder>items()final static Set<String>itemNames()final static Array<String>unexcludedItemNames()final NamespacedKeygetITEM_ID()final Map<String, Pair<File, ConfigurationSection>>getItemConfigCache()-
-
Method Detail
-
reloadItem
final Unit reloadItem(String itemId)
-
registerUpdateCallback
final static Unit registerUpdateCallback(Key key, UpdateCallback callback)
This lets plugin-developers register logic that will run on an item anytime it is updated It can run before or after Nexo has updated an item. For example if you are applying a CustomModelData based on xyz, and Nexo resets it. This should be registered in NexoItemsLoadedEvent, as it resets anytime items are reloaded
-
registerUpdateCallback
@Deprecated(message = "", replaceWith = @ReplaceWith(imports = {}, expression = "registerUpdateCallback(key, preUpdate, postUpdate)")) final static Unit registerUpdateCallback(Key key, Function1<ItemStack, ItemStack> preUpdate, Function1<ItemStack, ItemStack> postUpdate)
-
registerUpdateCallback
final static Unit registerUpdateCallback(Key key, Function<ItemStack, ItemStack> preUpdate, TriFunction<String, ItemStack, ItemStack, ItemStack> postUpdate)
This lets plugin-developers register logic that will run on an item anytime it is updated It can run before or after Nexo has updated an item. For example if you are applying a CustomModelData based on xyz, and Nexo resets it. This should be registered in NexoItemsLoadedEvent, as it resets anytime items are reloaded
-
unregisterUpdateCallback
final static Unit unregisterUpdateCallback(Key key)
-
updateItem
final static ItemStack updateItem(ItemStack item)
-
idFromItem
final static String idFromItem(ItemBuilder item)
-
idFromItem
final static String idFromItem(ItemStack item)
-
isSameId
final static Boolean isSameId(ItemStack firstStack, ItemStack secondStack)
Check if two ItemStacks are the same NexoItem If neither ItemStack is a NexoItem, this returns true as well
-
itemFromId
final static ItemBuilder itemFromId(String id)
-
optionalItemFromId
final static Optional<ItemBuilder> optionalItemFromId(String id)
-
builderFromItem
final static ItemBuilder builderFromItem(ItemStack item)
-
unexcludedItems
final static List<ItemBuilder> unexcludedItems(File file)
-
hasMechanic
final static Boolean hasMechanic(String itemID, String mechanicID)
-
entries
final static Map<String, ItemBuilder> entries()
-
items
final static Set<ItemBuilder> items()
-
unexcludedItemNames
final static Array<String> unexcludedItemNames()
-
getITEM_ID
final NamespacedKey getITEM_ID()
-
getItemConfigCache
final Map<String, Pair<File, ConfigurationSection>> getItemConfigCache()
-
-
-
-