Object ItemUtils

  • All Implemented Interfaces:

    
    public class ItemUtils
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static ItemUtils INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean isAllowedInVanillaRecipes(ItemStack itemStack)
      final Unit editPersistentDataContainer(ItemStack itemStack, Function1<PersistentDataContainer, Unit> action)
      final List<ItemStack> itemStacks(Material materials)
      final Unit triggerCooldown(Player player, ItemStack item)
      final static Unit damageItem(Player player, ItemStack itemStack) Used to correctly damage the item in the player's hand based on broken block Only handles it if the block is a NexoBlock or NexoFurniture
      final static Boolean isTool(ItemStack itemStack)
      final Boolean isTool(Material material)
      final static ItemStack usingConvertsTo(ItemMeta itemMeta)
      final static Unit usingConvertsTo(FoodComponent foodComponent, ItemStack replacement)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • damageItem

         final static Unit damageItem(Player player, ItemStack itemStack)

        Used to correctly damage the item in the player's hand based on broken block Only handles it if the block is a NexoBlock or NexoFurniture

        Parameters:
        player - the player that broke the NexoBlock or NexoFurniture
        itemStack - the item in the player's hand
      • usingConvertsTo

         final static ItemStack usingConvertsTo(ItemMeta itemMeta)
      • usingConvertsTo

         final static Unit usingConvertsTo(FoodComponent foodComponent, ItemStack replacement)