Class StackUtils

java.lang.Object
io.github.sefiraat.networks.utils.StackUtils

public class StackUtils extends Object
  • Constructor Details

    • StackUtils

      public StackUtils()
  • Method Details

    • getAsQuantity

      @Nonnull public static ItemStack getAsQuantity(@Nonnull ItemStack itemStack, int amount)
    • itemsMatch

      public static boolean itemsMatch(@Nullable ItemStack itemStack1, @Nullable ItemStack itemStack2)
    • itemsMatch

      public static boolean itemsMatch(@Nonnull ItemStackCache cache, @Nullable ItemStack itemStack, boolean checkLore)
      Checks if items match each other, checks go in order from lightest to heaviest
      Parameters:
      cache - The cached ItemStack to compare against
      itemStack - The ItemStack being evaluated
      Returns:
      True if items match
    • canQuickEscapeMetaVariant

      public boolean canQuickEscapeMetaVariant(@Nonnull ItemMeta metaOne, @Nonnull ItemMeta metaTwo)
    • putOnCooldown

      @ParametersAreNonnullByDefault public static void putOnCooldown(ItemStack itemStack, int durationInSeconds)
      Heal the entity by the provided amount
      Parameters:
      itemStack - The LivingEntity to heal
      durationInSeconds - The amount to heal by
    • isOnCooldown

      @ParametersAreNonnullByDefault public static boolean isOnCooldown(ItemStack itemStack)
      Heal the entity by the provided amount
      Parameters:
      itemStack - The LivingEntity to heal