Class SlimefunUtils



  • public final class SlimefunUtils
    extends Object
    This utility class holds method that are directly linked to Slimefun. It provides a very crucial method for ItemStack comparison, as well as a simple method to check if an ItemStack is Soulbound or not.
    Author:
    TheBusyBiscuit, Walshy
    • Method Detail

      • hasNoPickupFlag

        public static boolean hasNoPickupFlag​(Item item)
        This method quickly returns whether an Item was marked as "no_pickup" by a Slimefun device.
        Parameters:
        item - The Item to query
        Returns:
        Whether the Item is excluded from being picked up
      • markAsNoPickup

        public static void markAsNoPickup​(Item item,
                                          String context)
        This will prevent the given Item from being picked up. This is useful for display items which the AncientPedestal uses.
        Parameters:
        item - The Item to prevent from being picked up
        context - The context in which this Item was flagged
      • isSoulbound

        public static boolean isSoulbound​(ItemStack item)
        This method checks whether the given ItemStack is considered Soulbound.
        Parameters:
        item - The ItemStack to check for
        Returns:
        Whether the given item is soulbound
      • containsSimilarItem

        public static boolean containsSimilarItem​(Inventory inventory,
                                                  ItemStack itemStack,
                                                  boolean checkLore)
      • isItemSimilar

        public static boolean isItemSimilar​(ItemStack item,
                                            ItemStack sfitem,
                                            boolean checkLore)