Is there a better way to compare items?

Discussion in 'Plugin Development' started by stink123456, Nov 6, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    stink123456

    Currently I use this function to compare two item stacks, is there a better way to do this? It doesn't feel propper to use this method.
    Code:java
    1. public static boolean compareItem(ItemStack stack, ItemStack stack2){
    2. if(stack.getItemMeta().equals(stack2.getItemMeta()) && stack.getType().equals(stack2.getType()))return true;
    3. return false;
    4. }

    Thank you!
     
  2. Offline

    teej107

    return someItemStack.equals(anotherItemStack);
     
  3. Offline

    Zupsub

    If you want to ignore the amounts use isSimilair.
     
    mine-care likes this.
Thread Status:
Not open for further replies.

Share This Page